summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario Limonciello <mario.limonciello@amd.com>2023-11-27 23:36:52 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-31 16:21:02 -0800
commit0181f829da16c92dd8a910bc31d7b0aa1f98f1ed (patch)
tree9b15c655efa29cc57b578103451599e61affb9c3 /include
parentf18817875b96a89fff702fcebe23b5feee3a37b1 (diff)
downloadlinux-stable-0181f829da16c92dd8a910bc31d7b0aa1f98f1ed.tar.gz
linux-stable-0181f829da16c92dd8a910bc31d7b0aa1f98f1ed.tar.bz2
linux-stable-0181f829da16c92dd8a910bc31d7b0aa1f98f1ed.zip
rtc: Add support for configuring the UIP timeout for RTC reads
commit 120931db07b49252aba2073096b595482d71857c upstream. The UIP timeout is hardcoded to 10ms for all RTC reads, but in some contexts this might not be enough time. Add a timeout parameter to mc146818_get_time() and mc146818_get_time_callback(). If UIP timeout is configured by caller to be >=100 ms and a call takes this long, log a warning. Make all callers use 10ms to ensure no functional changes. Cc: <stable@vger.kernel.org> # 6.1.y Fixes: ec5895c0f2d8 ("rtc: mc146818-lib: extract mc146818_avoid_UIP") Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> 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> Link: https://lore.kernel.org/r/20231128053653.101798-4-mario.limonciello@amd.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mc146818rtc.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/mc146818rtc.h b/include/linux/mc146818rtc.h
index b0da04fe087b..34dfcc77f505 100644
--- a/include/linux/mc146818rtc.h
+++ b/include/linux/mc146818rtc.h
@@ -126,10 +126,11 @@ struct cmos_rtc_board_info {
#endif /* ARCH_RTC_LOCATION */
bool mc146818_does_rtc_work(void);
-int mc146818_get_time(struct rtc_time *time);
+int mc146818_get_time(struct rtc_time *time, int timeout);
int mc146818_set_time(struct rtc_time *time);
bool mc146818_avoid_UIP(void (*callback)(unsigned char seconds, void *param),
+ int timeout,
void *param);
#endif /* _MC146818RTC_H */