]> git.ipfire.org Git - thirdparty/linux.git/commit
rtc: mc146818-lib: Adjust failure return code for mc146818_get_time()
authorMario Limonciello <mario.limonciello@amd.com>
Tue, 28 Nov 2023 05:36:50 +0000 (23:36 -0600)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Sun, 17 Dec 2023 21:33:54 +0000 (22:33 +0100)
commitaf838635a3eb9b1bc0d98599c101ebca98f31311
tree5ff710ec145fafe0c9f4aff3aabb422ff5583a56
parent3d762e21d56370a43478b55e604b4a83dd85aafc
rtc: mc146818-lib: Adjust failure return code for mc146818_get_time()

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: Mateusz Jończyk <mat.jonczyk@o2.pl>
Reviewed-by: Mateusz Jończyk <mat.jonczyk@o2.pl>
Acked-by: Mateusz Jończyk <mat.jonczyk@o2.pl>
Cc: <stable@vger.kernel.org>
Fixes: 2a61b0ac5493 ("rtc: mc146818-lib: refactor mc146818_get_time")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20231128053653.101798-2-mario.limonciello@amd.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-mc146818-lib.c