Skip to content

Commit 741de61

Browse files
npigginmpe
authored andcommitted
powerpc/powernv: Handle unknown OPAL errors in opal_nvram_write()
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: 628daa8 ("powerpc/powernv: Add RTC and NVRAM support plus RTAS fallbacks") Cc: [email protected] # v3.2+ Signed-off-by: Nicholas Piggin <[email protected]> Reviewed-by: Vasant Hegde <[email protected]> Acked-by: Stewart Smith <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 0f9bdfe commit 741de61

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/powerpc/platforms/powernv/opal-nvram.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ static ssize_t opal_nvram_write(char *buf, size_t count, loff_t *index)
5959
if (rc == OPAL_BUSY_EVENT)
6060
opal_poll_events(NULL);
6161
}
62+
63+
if (rc)
64+
return -EIO;
65+
6266
*index += count;
6367
return count;
6468
}

0 commit comments

Comments
 (0)