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 <pierre.gondois@arm.com> Cc: Alexandru Elisei <alexandru.elisei@arm.com> Link: https://lore.kernel.org/all/Y2o1hdZK9GGDVJsS@monolith.localdoman/ Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20230217142338.1444509-1-ardb@kernel.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 303eac6 commit 668a2ab

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)