From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-arm-kernel@lists.infradead.org, y2038@lists.linaro.org
Subject: Re: RTC hctosys disabled for 32-bit systems
Date: Thu, 1 Sep 2022 15:57:55 +0200 [thread overview]
Message-ID: <YxC6Y3MjLIBH/gha@mail.local> (raw)
In-Reply-To: <8eca48d9-bd10-4857-9e43-a5b20a8db625@www.fastmail.com>
On 01/09/2022 15:12:57+0200, Arnd Bergmann wrote:
> On Thu, Sep 1, 2022, at 2:49 PM, Alexandre Belloni wrote:
> > On 01/09/2022 13:55:19+0200, Arnd Bergmann wrote:
> >>
> >> The only reliable fix I can see would be to disable
> >> CONFIG_RTC_HCTOSYS_DEVICE. I think this is Alexandre's plan
> >> for the long run anyway, but I don't know if there has been any
> >> progress in convincing distros to turn it off.
> >>
> >
> > This is still my plan but systemd mandates RTC_HCTOSYS and I couldn't
> > convince Lennart otherwise.
>
> Ah, I forgot that systemd actually needs it. So I guess there is
> currently no way to use systemd on 32-bit machines that are
> meant to survive 2038, regardless of whether systemd and glibc are
> built with a 64-bit time_t or not, right?
>
Well, it doesn't actually need it. It could as well go and read the RTC
and decide what to do with the time it gets. The main reason they want
it is because the log timestamps are correct earlier when the kernel does
it.
> Is there perhaps a way to change the logic in a way that
> it does not depend on the current time but instead depends
> on a property of the RTC device itself, so we make systems
> break immediately instead of by surprise in 2038?
The safe thing to do is really to not use hctosys and have a systemd
unit that reads the RTC from userspace. See
https://github.com/systemd/systemd/issues/17737 for the whole
discussion.
>
> As far as I remember, the workaround was only needed for
> certain devices that may set the time to something after 2038
> on a depleted battery, but other devices would have a better
> failure case, right?
>
Yes, this is the main cause, anything able to set the system time after
2038 with a 32bit userspace will cause that (and basically I think this
is only hctosys). The issue is that many RTCs don't have a default value
for the time registers after power failure. This is usually not an issue
as there is also a bit allowing to detect whether the time is correct.
note that this will also be an issue once we actually reach 2038 with a
32bit userspace.
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-09-01 13:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-01 11:31 RTC hctosys disabled for 32-bit systems Reinier Kuipers
2022-09-01 11:55 ` Arnd Bergmann
2022-09-01 12:49 ` Alexandre Belloni
2022-09-01 13:12 ` Arnd Bergmann
2022-09-01 13:46 ` Russell King (Oracle)
2022-09-01 15:48 ` [Y2038] " Arnd Bergmann
2022-09-01 16:02 ` Russell King (Oracle)
2022-09-01 20:33 ` Arnd Bergmann
2022-09-01 21:11 ` Alexandre Belloni
2022-09-02 15:24 ` Arnd Bergmann
2022-09-01 13:57 ` Alexandre Belloni [this message]
2022-09-01 15:29 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YxC6Y3MjLIBH/gha@mail.local \
--to=alexandre.belloni@bootlin.com \
--cc=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=y2038@lists.linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).