* [PATCH] rtc: efi: Avoid spamming the log on RTC read failure
@ 2023-02-17 14:23 Ard Biesheuvel
2023-02-22 20:11 ` Alexandre Belloni
0 siblings, 1 reply; 2+ messages in thread
From: Ard Biesheuvel @ 2023-02-17 14:23 UTC (permalink / raw)
To: linux-efi
Cc: a.zummo, alexandre.belloni, linux-arm-kernel, linux-kernel,
linux-rtc, Ard Biesheuvel, Pierre Gondois, Alexandru Elisei
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>
---
drivers/rtc/rtc-efi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-efi.c b/drivers/rtc/rtc-efi.c
index e991cccdb6e9cee4..174959f783b8309b 100644
--- a/drivers/rtc/rtc-efi.c
+++ b/drivers/rtc/rtc-efi.c
@@ -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;
}
--
2.39.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] rtc: efi: Avoid spamming the log on RTC read failure
2023-02-17 14:23 [PATCH] rtc: efi: Avoid spamming the log on RTC read failure Ard Biesheuvel
@ 2023-02-22 20:11 ` Alexandre Belloni
0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2023-02-22 20:11 UTC (permalink / raw)
To: linux-efi, Ard Biesheuvel
Cc: a.zummo, linux-arm-kernel, linux-kernel, linux-rtc,
Pierre Gondois, Alexandru Elisei
On Fri, 17 Feb 2023 15:23:38 +0100, Ard Biesheuvel wrote:
> 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.
>
> [...]
Applied, thanks!
[1/1] rtc: efi: Avoid spamming the log on RTC read failure
commit: 668a2abf91143caa226b3ccd0bd4d79ea85935a6
Best regards,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-22 20:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-17 14:23 [PATCH] rtc: efi: Avoid spamming the log on RTC read failure Ard Biesheuvel
2023-02-22 20:11 ` Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).