Thread (23 messages) 23 messages, 3 authors, 2021-10-21

Re: [PATCH 4/4] rtc: s3c: Fix RTC read on first boot

From: Krzysztof Kozlowski <hidden>
Date: 2021-10-19 16:19:56
Also in: linux-samsung-soc, lkml

On 19/10/2021 18:04, Sam Protsenko wrote:
On Tue, 19 Oct 2021 at 18:48, Alexandre Belloni
[off-list ref] wrote:
quoted
On 19/10/2021 16:17:24+0300, Sam Protsenko wrote:
quoted
On first RTC boot it has the month register value set to 0.
Unconditional subtracting of 1 subsequently in s3c_rtc_gettime() leads
to the next error message in kernel log:

    hctosys: unable to read the hardware clock

That happens in s3c_rtc_probe() when trying to register the RTC, which
in turn tries to read and validate the time. Initialize RTC date/time
registers to valid values in probe function on the first boot to prevent
such errors.
No, never ever do that, the time is bogus and it has to stay this way,
else userspace can't know whether the time on the RTC is the actual wall
time or just some random value that you have set from the driver.
Thought about that, but that error message looked distracting and not
very helpful in understanding what's actually going on. Anyway, can
you please drop this patch from series (and maybe [PATCH 3/4] too) and
apply the rest?
Please give it some time for review. Pinging after few hours is too fast.

Best regards,
Krzysztof
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help