[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e2329870-2e4b-4c38-ae20-c6aa5108a0da@oss.nxp.com>
Date: Mon, 2 Dec 2024 15:06:38 +0200
From: Ciprian Marian Costea <ciprianmarian.costea@....nxp.com>
To: Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc: Frank Li <Frank.li@....com>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
<conor+dt@...nel.org>, Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, linux-rtc@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, imx@...ts.linux.dev,
NXP S32 Linux <s32@....com>, Christophe Lizzi <clizzi@...hat.com>,
Alberto Ruiz <aruizrui@...hat.com>, Enric Balletbo <eballetb@...hat.com>,
Bogdan Hamciuc <bogdan.hamciuc@....com>,
Ghennadi Procopciuc <Ghennadi.Procopciuc@....com>
Subject: Re: [PATCH v5 2/4] rtc: s32g: add NXP S32G2/S32G3 SoC support
On 11/27/2024 5:32 PM, Alexandre Belloni wrote:
> 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?
>
This is true. Thanks for reminding me about this discussion/issue.
I will just fix the error paths for 'clk_get_rate' and 'platform_get_irq'.
>>>> + /* 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.
>
>
I think I can drop the RTC reset from the suspend routine for this
current patchset.
Best Regards,
Ciprian
Powered by blists - more mailing lists