From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Xianwei Zhao <xianwei.zhao@amlogic.com>
Cc: Yiting Deng <yiting.deng@amlogic.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
linux-amlogic@lists.infradead.org, linux-rtc@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] rtc: support for the Amlogic on-chip RTC
Date: Mon, 2 Sep 2024 22:19:54 +0200 [thread overview]
Message-ID: <2024090220195462df6c95@mail.local> (raw)
In-Reply-To: <20ffd260-3c24-460f-bdbc-965573e110e3@amlogic.com>
On 02/09/2024 16:14:45+0800, Xianwei Zhao wrote:
> Hi Alexandre,
> Thanks for your reply.
>
> On 2024/8/26 17:45, Alexandre Belloni wrote:
> > [ EXTERNAL EMAIL ]
> >
> > On 23/08/2024 17:19:45+0800, Xianwei Zhao via B4 Relay wrote:
> > > From: Yiting Deng <yiting.deng@amlogic.com>
> > >
> > > Support for the on-chip RTC found in some of Amlogic's SoCs such as the
> > > A113L2 and A113X2.
> > >
> > > Signed-off-by: Yiting Deng <yiting.deng@amlogic.com>
> > > Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
> > > ---
> > > drivers/rtc/Kconfig | 12 +
> > > drivers/rtc/Makefile | 1 +
> > > drivers/rtc/rtc-amlogic.c | 589 ++++++++++++++++++++++++++++++++++++++++++++++
> >
> > As pointed out, this is the third amlogic driver so the name of the file
> > must be more specific.
> >
>
> This RTC hardware includes a timing function and an alarm function.
> But the existing has only timing function, alarm function is using the
> system clock to implement a virtual alarm. And the relevant register access
> method is also different.
>
> The "meson" string is meaningless, it just keeps going, and now the new
> hardware uses the normal naming.
The proper naming is then definitively not just amlogic, because in 5
year, you are going to say the exact same thing about this driver
"register access is different, this is for old SoCs, etc"
amlogc-a4 would be more appropriate.
> > > + /* Enable RTC */
> > > + regmap_write_bits(rtc->map, RTC_CTRL, RTC_ENABLE, RTC_ENABLE);
> >
> > This must not be done at probe time, else you loose the
> > important information taht the time has never been set. Instead,
> > it should only be enabled on the first .set_time invocation do
> > you could now in .read_time that the time is currently invalid.
> >
> There are some doubts about this place.
>
> You mean that after the system is up, unless the time is set, it will fail
> to read the time at any time, and the alarm clock will also fail.
> In this case, the system must set a time.
Exactly, reading the time must not succeed if the time is known to be
bad.
>
> When read time invlalid, system is will set time.
> This part of the logic I see the kernel part has not been implemented, so
> only the user application has been implemented. Whether this is reasonable,
> if not set time, you will never use RTC module.
This is not going to be implemented in the kernel. The kernel can't know
what is the proper time to set unless userspace tells it.
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2024-09-02 20:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-23 9:19 [PATCH 0/3] support for amlogic rtc Xianwei Zhao via B4 Relay
2024-08-23 9:19 ` [PATCH 1/3] dt-bindings: rtc: Add Amlogic A311L2 and A113X2 rtc Xianwei Zhao via B4 Relay
2024-08-23 15:51 ` Conor Dooley
2024-08-26 2:36 ` Xianwei Zhao
2024-08-23 9:19 ` [PATCH 2/3] rtc: support for the Amlogic on-chip RTC Xianwei Zhao via B4 Relay
2024-08-26 8:27 ` Krzysztof Kozlowski
2024-09-02 7:32 ` Xianwei Zhao
2024-08-26 9:45 ` Alexandre Belloni
2024-09-02 8:14 ` Xianwei Zhao
2024-09-02 20:19 ` Alexandre Belloni [this message]
2024-09-03 2:48 ` Xianwei Zhao
2024-08-26 12:57 ` kernel test robot
2024-08-26 13:19 ` kernel test robot
2024-08-23 9:19 ` [PATCH 3/3] MAINTAINERS: Add an entry for Amlogic RTC driver Xianwei Zhao via B4 Relay
2024-08-26 8:28 ` Krzysztof Kozlowski
2024-09-02 8:27 ` Xianwei Zhao
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=2024090220195462df6c95@mail.local \
--to=alexandre.belloni@bootlin.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=robh@kernel.org \
--cc=xianwei.zhao@amlogic.com \
--cc=yiting.deng@amlogic.com \
/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