Commit fd1f5396 authored by Mario Limonciello's avatar Mario Limonciello Committed by Greg Kroah-Hartman
Browse files

rtc: mc146818-lib: Adjust failure return code for mc146818_get_time()



commit af838635 upstream.

mc146818_get_time() calls mc146818_avoid_UIP() to avoid fetching the
time while RTC update is in progress (UIP). When this fails, the return
code is -EIO, but actually there was no IO failure.

The reason for the return from mc146818_avoid_UIP() is that the UIP
wasn't cleared in the time period. Adjust the return code to -ETIMEDOUT
to match the behavior.

Tested-by: default avatarMateusz Jończyk <mat.jonczyk@o2.pl>
Reviewed-by: default avatarMateusz Jończyk <mat.jonczyk@o2.pl>
Acked-by: default avatarMateusz Jończyk <mat.jonczyk@o2.pl>
Cc:  <stable@vger.kernel.org>
Fixes: 2a61b0ac ("rtc: mc146818-lib: refactor mc146818_get_time")
Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20231128053653.101798-2-mario.limonciello@amd.com


Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 911e7206
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment