[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5357e62e-2b42-41bc-8c63-1bafdb461e99@o2.pl>
Date: Wed, 22 Nov 2023 18:06:05 +0100
From: Mateusz Jończyk <mat.jonczyk@...pl>
To: Mario Limonciello <mario.limonciello@....com>,
Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc: "open list:REAL TIME CLOCK (RTC) SUBSYSTEM"
<linux-rtc@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>,
linux-pm@...r.kernel.org, tobrohl@...il.com, aalsing@...il.com,
Dhaval.Giani@....com, xmb8dsv4@...il.com, x86@...nel.org,
dhaval.giani@...il.com
Subject: Re: [PATCH v2 3/4] rtc: Add support for configuring the UIP timeout
for RTC reads
W dniu 20.11.2023 o 15:15, Mario Limonciello pisze:
> 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@...r.kernel.org # 6.1.y: commit d2a632a8a117 ("rtc: mc146818-lib: reduce RTC_UIP polling period")
I was wrong and
commit d2a632a8a117 ("rtc: mc146818-lib: reduce RTC_UIP polling period") is
included in 6.1.y anyway (was merged before 6.1-rc1), does not have to be
mentioned in the line above.
> Fixes: ec5895c0f2d8 ("rtc: mc146818-lib: extract mc146818_avoid_UIP")
> Signed-off-by: Mario Limonciello <mario.limonciello@....com>
> ---
> v1->v2:
> * Add a warning if 100ms or more
> * Add stable and fixes tags
> ---
[snip]
> @@ -72,6 +76,9 @@ bool mc146818_avoid_UIP(void (*callback)(unsigned char seconds, void *param),
> }
> spin_unlock_irqrestore(&rtc_lock, flags);
>
> + if (i >= UIP_RECHECK_TIMEOUT_MS(100))
> + pr_warn("RTC took %d iterations to clear UIP\n", i);
> +
This warning message is difficult to understand for someone that is not familiar
with
the code / MC146818 documentation.
"Reading current time from RTC took around %d ms" would be better.
> return true;
> }
> return false;
Greetings,
Mateusz
Powered by blists - more mailing lists