RE: [PATCH v5 2/9] clk: renesas: rzg2l-cpg: Add support for critical resets

From: Biju Das

Date: Wed Mar 18 2026 - 13:03:18 EST


Hi Geert,

Thanks for the feedback.

> -----Original Message-----
> From: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
> Sent: 18 March 2026 14:58
> Subject: Re: [PATCH v5 2/9] clk: renesas: rzg2l-cpg: Add support for critical resets
>
> Hi Biju,
>
> On Wed, 18 Mar 2026 at 09:41, Biju <biju.das.au@xxxxxxxxx> wrote:
> > From: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
> >
> > Some reset lines must remain deasserted at all times after boot, as
> > asserting them would disable critical system functionality with no
> > owning driver to restore them. This mirrors the existing crit_mod_clks
> > mechanism which protects critical module clocks from being disabled.
> >
> > On RZ/G2L family SoCs, the DMA reset must be remain deasserted for
> > routing some peripheral interrupts to CPU.
> >
> > Add crit_resets and num_crit_resets fields to struct rzg2l_cpg_info to
> > allow SoC-specific data tables to declare reset IDs that must never be
> > asserted.
> >
> > Introduce rzg2l_cpg_deassert_crit_resets() to iterate over all
> > critical resets and deassert them. Call it both at probe time and
> > during resume to ensure critical peripherals are held out of reset
> > after power-on and suspend/resume cycles.
> >
> > Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
>
> Thanks for your patch!
>
> > --- a/drivers/clk/renesas/rzg2l-cpg.c
> > +++ b/drivers/clk/renesas/rzg2l-cpg.c
> > @@ -1765,6 +1765,15 @@ static int __rzg2l_cpg_assert(struct reset_controller_dev *rcdev,
> > dev_dbg(rcdev->dev, "%s id:%ld offset:0x%x\n",
> > assert ? "assert" : "deassert", id, CLK_RST_R(reg));
> >
> > + if (assert) {
> > + unsigned int i;
> > +
> > + for (i = 0; i < priv->info->num_crit_resets; i++) {
>
> for (unsigned int i = 0; ...)
OK.

>
> > + if (id == priv->info->crit_resets[i])
> > + return 0;
> > + }
> > + }
> > +
> > if (!assert)
> > value |= mask;
> > writel(value, priv->base + CLK_RST_R(reg)); @@ -1802,6
> > +1811,21 @@ static int rzg2l_cpg_deassert(struct reset_controller_dev *rcdev,
> > return __rzg2l_cpg_assert(rcdev, id, false); }
> >
> > +static int rzg2l_cpg_deassert_crit_resets(struct reset_controller_dev *rcdev,
> > + const struct rzg2l_cpg_info
> > +*info) {
> > + unsigned int i;
> > + int ret;
> > +
> > + for (i = 0; i < info->num_crit_resets; i++) {
>
> for (unsigned int i = 0; ...)

OK will fix this in next version.

Cheers,
Biju