From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Ciprian Marian Costea <ciprianmarian.costea@oss.nxp.com>
Cc: Frank Li <Frank.li@nxp.com>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
linux-rtc@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev,
NXP S32 Linux <s32@nxp.com>, Christophe Lizzi <clizzi@redhat.com>,
Alberto Ruiz <aruizrui@redhat.com>,
Enric Balletbo <eballetb@redhat.com>,
Bogdan Hamciuc <bogdan.hamciuc@nxp.com>,
Ghennadi Procopciuc <Ghennadi.Procopciuc@nxp.com>
Subject: Re: [PATCH v5 2/4] rtc: s32g: add NXP S32G2/S32G3 SoC support
Date: Wed, 27 Nov 2024 16:32:12 +0100 [thread overview]
Message-ID: <2024112715321236991788@mail.local> (raw)
In-Reply-To: <14e90ec7-3815-4f06-826c-3fcf0d8d53c8@oss.nxp.com>
On 27/11/2024 17:07:48+0200, Ciprian Marian Costea wrote:
> > > + if (priv->dt_irq_id < 0)
> > > + return priv->dt_irq_id;
> > > +
> > > + ret = devm_request_irq(dev, priv->dt_irq_id,
> > > + s32g_rtc_handler, 0, dev_name(dev), pdev);
> > > + if (ret) {
> > > + dev_err(dev, "Request interrupt %d failed, error: %d\n",
> > > + priv->dt_irq_id, ret);
> > > + goto disable_rtc;
> >
> >
> > Already enable rtc at rtc_clk_src_setup(), you direct return fail after
> > check clk_get_rate();
> >
> > if you want to disable_rtc, you use devm_add_action_or_reset() to add
> > a disable action callback and return dev_err_probe() here directly.
> >
> > Frank
> >
>
> Thanks for pointing this out. I will use 'devm_add_action_or_reset' in V6.
>
Won't this disable the RTC on driver unload which we already discussed
should not be done?
> > > + /* Reset RTC to prevent overflow.
> > > + * RTCCNT (RTC Counter) cannot be individually reset
> > > + * since it is RO (read-only).
> > > + */
> >
> > what's happen if overflow happen? I suppose it should go back to 0 and
> > continue increase?
> >
>
> Indeed if overflow happens the 'RTCCNT' counter goes back to 0 and continues
> to increase. The reason for resetting it here in 'suspend' routine comes
> after dropping the rollover support (as agreed on V4 of this patchset) to
> prevent an overflow during the standby state.
>
I don't think the overflow matters as the comparator should continue to work
properly after it happens so you always have the complete range to wait
for the alarm to happen.
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2024-11-27 16:37 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-26 11:49 [PATCH v5 0/4] add NXP RTC driver support for S32G2/S32G3 SoCs Ciprian Costea
2024-11-26 11:49 ` [PATCH v5 1/4] dt-bindings: rtc: add schema for NXP " Ciprian Costea
2024-11-26 19:08 ` Krzysztof Kozlowski
2024-11-27 12:01 ` Ciprian Marian Costea
2024-11-27 14:43 ` Rob Herring
2024-11-27 14:49 ` Ciprian Marian Costea
2024-11-26 11:49 ` [PATCH v5 2/4] rtc: s32g: add NXP S32G2/S32G3 SoC support Ciprian Costea
2024-11-26 18:05 ` Frank Li
2024-11-27 15:07 ` Ciprian Marian Costea
2024-11-27 15:32 ` Alexandre Belloni [this message]
2024-12-02 13:06 ` Ciprian Marian Costea
2024-11-28 21:18 ` kernel test robot
2024-11-26 11:49 ` [PATCH v5 3/4] arm64: defconfig: add S32G RTC module support Ciprian Costea
2024-11-26 11:49 ` [PATCH v5 4/4] MAINTAINERS: add NXP S32G RTC driver Ciprian Costea
-- strict thread matches above, loose matches on Subject: below --
2024-11-26 11:44 [PATCH] mmc: sdhci-esdhc-imx: enable 'SDHCI_QUIRK_NO_LED' quirk for S32G Ciprian Costea
2024-11-26 11:44 ` [PATCH v5 2/4] rtc: s32g: add NXP S32G2/S32G3 SoC support Ciprian Costea
2024-11-30 20:07 ` kernel test robot
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=2024112715321236991788@mail.local \
--to=alexandre.belloni@bootlin.com \
--cc=Frank.li@nxp.com \
--cc=Ghennadi.Procopciuc@nxp.com \
--cc=aruizrui@redhat.com \
--cc=bogdan.hamciuc@nxp.com \
--cc=catalin.marinas@arm.com \
--cc=ciprianmarian.costea@oss.nxp.com \
--cc=clizzi@redhat.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=eballetb@redhat.com \
--cc=imx@lists.linux.dev \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=robh@kernel.org \
--cc=s32@nxp.com \
--cc=will@kernel.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