Linux clock framework development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Claudiu Beznea" <claudiu.beznea@kernel.org>
Cc: linux-clk@vger.kernel.org, wsa+renesas@sang-engineering.com
Subject: Re: [PATCH v2 2/2] clk: renesas: rzg2l-cpg: Skip resets and MSTOP restore on s2idle resume
Date: Fri, 04 Dec 2026 09:59:24 +0000	[thread overview]
Message-ID: <sashiko-outbox-249559@kernel.org> (raw)
In-Reply-To: <20261204094532.1052522-3-claudiu.beznea@kernel.org>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] clk: renesas: rzg2l_cpg_resume() skips restore on RISC-V SBI
  suspend-to-RAM
- [Medium] clk: renesas: rzg2l_cpg_resume() disables hibernation
  restore_noirq
--

commit 125f430fe29577ed1821b9bcbe0dc9f5cab8e351
Author: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

clk: renesas: rzg2l-cpg: Skip resets and MSTOP restore on s2idle resume

This commit returns early from rzg2l_cpg_resume() when
pm_suspend_via_firmware() is false, skipping reset de-assertion and
MSTOP re-initialization.

> diff --git a/drivers/clk/renesas/rzg2l-cpg.c b/drivers/clk/renesas/rzg2l-cpg.c
> index 5b255d8a7a6f3..07ff6282622b5 100644
> --- a/drivers/clk/renesas/rzg2l-cpg.c
> +++ b/drivers/clk/renesas/rzg2l-cpg.c

[ ... ]

> @@ -2699,6 +2700,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;

[Severity: High]
Does this skip CPG restore on RISC-V SBI suspend-to-RAM?

In arch/riscv/kernel/suspend.c, sbi_system_suspend_ops has no .begin
callback and never calls pm_set_suspend_via_firmware(), so
pm_suspend_via_firmware() always returns false on RISC-V.

On RZ/Five (r9a07g043), resuming from SBI suspend-to-RAM skips
rzg2l_cpg_deassert_crit_resets() and
rzg2l_mod_enable_crit_clock_init_mstop(), leaving the DMAC resets
asserted, module clocks disabled, and MSTOP state out of sync.

Checking pm_suspend_no_platform(), which suspend_devices_and_enter()
sets specifically for PM_SUSPEND_TO_IDLE, would target s2idle without
breaking RISC-V suspend-to-RAM.

[Severity: Medium]
Will this also disable hibernation restore?

NOIRQ_SYSTEM_SLEEP_PM_OPS() wires rzg2l_cpg_resume() to .restore_noirq
as well.  During hibernation, hibernation_snapshot() clears the suspend
flags and DT platforms register no platform_hibernation_ops, so
pm_suspend_via_firmware() is false during dpm_resume_start(PMSG_RESTORE).

With CONFIG_HIBERNATION=y and CONFIG_SUSPEND=n, pm_suspend_via_firmware()
is also stubbed to return false, making .restore_noirq a permanent no-op
and leaving boot-kernel reset, clock, and MSTOP states unreconciled with
the restored image.

Using pm_suspend_no_platform(), or separating .resume_noirq and
.restore_noirq in rzg2l_cpg_pm_ops, would preserve hibernation restore.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204094532.1052522-1-claudiu.beznea@kernel.org?part=2

      reply	other threads:[~2026-12-04  9:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  9:45 [PATCH v2 0/2] clk: renesas: rzg2l-cpg: MSTOP adjustments Claudiu Beznea
2026-12-04  9:45 ` [PATCH v2 1/2] clk: renesas: rzg2l-cpg: Do not set MSTOP to standby on resume if in use Claudiu Beznea
2026-12-04  9:45 ` [PATCH v2 2/2] clk: renesas: rzg2l-cpg: Skip resets and MSTOP restore on s2idle resume Claudiu Beznea
2026-12-04  9:59   ` sashiko-bot [this message]

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=sashiko-outbox-249559@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=claudiu.beznea@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=wsa+renesas@sang-engineering.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