powerpc/powernv: Handle unknown OPAL errors in opal_nvram_write()
authorNicholas Piggin <npiggin@gmail.com>
Mon, 26 Mar 2018 15:02:33 +0000 (01:02 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Apr 2018 07:36:27 +0000 (09:36 +0200)
commitc3baeca67d85e698201fca324368c3a704667e80
tree63b96e5423c86cbfca20b833be0949fa0cc288a6
parent693b03f9b185f14dded38a934c744a60e99363c3
powerpc/powernv: Handle unknown OPAL errors in opal_nvram_write()

commit 741de617661794246f84a21a02fc5e327bffc9ad 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: 628daa8d5abf ("powerpc/powernv: Add RTC and NVRAM support plus RTAS fallbacks")
Cc: stable@vger.kernel.org # v3.2+
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Acked-by: Stewart Smith <stewart@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/platforms/powernv/opal-nvram.c