Skip to content

Commit 668a2ab

Browse files
ardbiesheuvelalexandrebelloni
authored andcommitted
rtc: efi: Avoid spamming the log on RTC read failure
There are cases where the EFI runtime services may end up in a funny state, e.g., due to a crash in the variable services, and this affects other EFI runtime services as well. That means that, even though GetTime() should not return an error, there are cases where it might, and there is no point in logging such an occurrence multiple times. This works around an issue where user space -apparently- keeps hitting on /dev/rtc if it fails to read the h/w clock, resulting in a tsunami of log spam and a non-responsive system as a result. Cc: Pierre Gondois <[email protected]> Cc: Alexandru Elisei <[email protected]> Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Ard Biesheuvel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 303eac6 commit 668a2ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/rtc/rtc-efi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static int efi_read_time(struct device *dev, struct rtc_time *tm)
164164

165165
if (status != EFI_SUCCESS) {
166166
/* should never happen */
167-
dev_err(dev, "can't read time\n");
167+
dev_err_once(dev, "can't read time\n");
168168
return -EINVAL;
169169
}
170170

0 commit comments

Comments
 (0)