Skip to content

Commit

Permalink
rtc: efi: Avoid spamming the log on RTC read failure
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ard Biesheuvel authored and Alexandre Belloni committed Feb 22, 2023
1 parent 303eac6 commit 668a2ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/rtc/rtc-efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ static int efi_read_time(struct device *dev, struct rtc_time *tm)

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

Expand Down

0 comments on commit 668a2ab

Please sign in to comment.