RE: [PATCH] clk: renesas: rzg2l-cpg: Skip re-initializing MSTOPs and critical resets for s2idle
From: Biju Das
Date: Mon Nov 23 2026 - 04:46:27 EST
Hi Claudiu,
> -----Original Message-----
> From: claudiu beznea <claudiu.beznea@xxxxxxxxx>
> Sent: 23 November 2026 08:07
> Subject: Re: [PATCH] clk: renesas: rzg2l-cpg: Skip re-initializing MSTOPs and critical resets for
> s2idle
>
> Hi, Geert,
>
> Gentle ping.
>
> Thank you,
> Claudiu
>
> On 10/19/26 15:25, Claudiu Beznea wrote:
> > From: Claudiu Beznea <claudiu.beznea.uj@xxxxxxxxxxxxxx>
> >
> > When the system suspends to s2idle, any of the IP blocks may be in the
> > wakeup path. For a device in the wakeup path, the generic PM domain
> > (genpd) does not disable/enable its clocks across suspend/resume.
> > Re-initializing the MSTOP bits for such a device leads to synchronous
> > aborts when its registers are accessed for the first time after resume.
> >
> > In a suspend mode that is not controlled by firmware, power to the SoC
> > is not lost, so the MSTOP and critical reset state is retained and
> > does not need re-initialization in the first place. Skip it when
> > pm_suspend_via_firmware() reports such a mode.
Looks like a bug in clk driver. MSTOP is controlled by clk reference count.
If clk ref count is 0, then MSTOP turned off.
Suspend to idle. Critical clk is on, so there is no way critical clk ref count is 0
and corresponding MSTOP is always in stand by state.
Cheers,
Biju
> >
> > Fixes: 5cd33db56956 ("clk: renesas: rzg2l: Add support for MSTOP in
> > clock enable/disable API")
> > Cc: stable@xxxxxxxxxxxxxxx
> > Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@xxxxxxxxxxxxxx>
> > ---
> > drivers/clk/renesas/rzg2l-cpg.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/clk/renesas/rzg2l-cpg.c
> > b/drivers/clk/renesas/rzg2l-cpg.c index f6293c968bcf..3d2281456036
> > 100644
> > --- a/drivers/clk/renesas/rzg2l-cpg.c
> > +++ b/drivers/clk/renesas/rzg2l-cpg.c
> > @@ -31,6 +31,7 @@
> > #include <linux/reset-controller.h>
> > #include <linux/slab.h>
> > #include <linux/string_choices.h>
> > +#include <linux/suspend.h>
> > #include <linux/units.h>
> >
> > #include <dt-bindings/clock/renesas-cpg-mssr.h>
> > @@ -2697,6 +2698,9 @@ static int rzg2l_cpg_resume(struct device *dev)
> > struct rzg2l_cpg_priv *priv = dev_get_drvdata(dev);
> > int ret;
> >
> > + if (!pm_suspend_via_firmware())
> > + return 0;
> > +
> > ret = rzg2l_cpg_deassert_crit_resets(&priv->rcdev, priv->info);
> > if (ret)
> > return ret;
>