Commit 9d0891dd authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Stefan Bader

powerpc/powernv: Handle unknown OPAL errors in opal_nvram_write()

BugLink: http://bugs.launchpad.net/bugs/1768429

commit 741de617 upstream.

opal_nvram_write currently just assumes success if it encounters an
error other than OPAL_BUSY or OPAL_BUSY_EVENT. Have it return -EIO
on other errors instead.

Fixes: 628daa8d ("powerpc/powernv: Add RTC and NVRAM support plus RTAS fallbacks")
Cc: stable@vger.kernel.org # v3.2+
Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
Reviewed-by: default avatarVasant Hegde <hegdevasant@linux.vnet.ibm.com>
Acked-by: default avatarStewart Smith <stewart@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent fe48321c
...@@ -59,6 +59,10 @@ static ssize_t opal_nvram_write(char *buf, size_t count, loff_t *index) ...@@ -59,6 +59,10 @@ static ssize_t opal_nvram_write(char *buf, size_t count, loff_t *index)
if (rc == OPAL_BUSY_EVENT) if (rc == OPAL_BUSY_EVENT)
opal_poll_events(NULL); opal_poll_events(NULL);
} }
if (rc)
return -EIO;
*index += count; *index += count;
return count; return count;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment