public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
To: Ulf Hansson <ulf.hansson@linaro.org>,
	Saravana Kannan <saravanak@google.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-pm@vger.kernel.org, Stephen Boyd <sboyd@kernel.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Heiko Stuebner <heiko@sntech.de>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	Sebin Francis <sebin.francis@ti.com>,
	Diederik de Haas <didi.debian@cknow.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Abel Vesa <abel.vesa@linaro.org>, Peng Fan <peng.fan@oss.nxp.com>,
	Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
	Johan Hovold <johan@kernel.org>,
	Maulik Shah <maulik.shah@oss.qualcomm.com>,
	Michal Simek <michal.simek@amd.com>,
	Konrad Dybcio <konradybcio@kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/5] pmdomain: Restore behaviour for disabling unused PM domains
Date: Fri, 12 Sep 2025 20:49:37 +0200	[thread overview]
Message-ID: <3919643.KlZ2vcFHjT@workhorse> (raw)
In-Reply-To: <CAGETcx9W5MXyHA2r1kDh9=WJiQWLF1xdPaSCH=jXYeAHqQW60w@mail.gmail.com>

On Friday, 12 September 2025 20:36:35 Central European Summer Time Saravana Kannan wrote:
> On Tue, Sep 9, 2025 at 4:11 AM Ulf Hansson <ulf.hansson@linaro.org> wrote:
> >
> > Recent changes to genpd prevents those PM domains being powered-on during
> > initialization from being powered-off during the boot sequence. Based upon
> > whether CONFIG_PM_CONFIG_PM_GENERIC_DOMAINS_OF is set of not, genpd relies
> > on the sync_state mechanism or the genpd_power_off_unused() (which is a
> > late_initcall_sync), to understand when it's okay to allow these PM domains
> > to be powered-off.
> >
> > This new behaviour in genpd has lead to problems on different platforms [1].
> >
> > In this series, I am therefore suggesting to restore the behavior of
> > genpd_power_off_unused() along with introducing a new genpd config flag,
> > GENPD_FLAG_NO_STAY_ON, to allow genpd OF providers to opt-out from the new
> > behaviour.
> >
> > Kind regards
> > Ulf Hansson
> >
> > [1]
> > https://lore.kernel.org/all/20250701114733.636510-1-ulf.hansson@linaro.org/
> > https://lore.kernel.org/all/20250902-rk3576-lockup-regression-v1-1-c4a0c9daeb00@collabora.com/
> 
> I'm surprised this is happening. The default behavior of sync_state()
> is to never turn off a power domain until all the consumers have
> probed.
> 
> Is there a consumer that's not captured correctly? If so, can we add them?

Yes, and unfortunately, not trivially so, no. In Rockchip's case, the
regulators supplying a certain power domain cannot be acquired at
pmdomain probe time, as the regulators themselves are sometimes
SPI or I2C regulators that depend on powerdomains to be up.

So we only acquire them when the power domain is enabled, which does
not happen for unused PDs. Acquiring them during PD disable also
wouldn't work, as the genpd idle check may run after the regulator
idle check.

> 
> Also, there are already sync_state related kernel configs, command
> line options and sysfs files that should allow people to power off
> devices (at different levels of granularity) even if its consumers
> haven't probed.

This series is a stop-gap solution to get us through v6.17, so that
problematic drivers like Rockchip pmdomains can be rearchitectured
to declare their dependency in some way that is not racey. This
will be somewhat non-trivial, hence the current solution for now.

> 
> Thanks,
> Saravana
> 

Kind regards,
Nicolas Frattaroli

> >
> > Ulf Hansson (5):
> >   pmdomain: core: Restore behaviour for disabling unused PM domains
> >   pmdomain: rockchip: Fix regulator dependency with
> >     GENPD_FLAG_NO_STAY_ON
> >   pmdomain: renesas: rcar-sysc: Don't keep unused PM domains powered-on
> >   pmdomain: renesas: rcar-gen4-sysc: Don't keep unused PM domains
> >     powered-on
> >   pmdomain: renesas: rmobile-sysc: Don't keep unused PM domains
> >     powered-on
> >
> >  drivers/pmdomain/core.c                   | 20 ++++++++++++++------
> >  drivers/pmdomain/renesas/rcar-gen4-sysc.c |  1 +
> >  drivers/pmdomain/renesas/rcar-sysc.c      |  1 +
> >  drivers/pmdomain/renesas/rmobile-sysc.c   |  3 ++-
> >  drivers/pmdomain/rockchip/pm-domains.c    |  2 +-
> >  include/linux/pm_domain.h                 |  7 +++++++
> >  6 files changed, 26 insertions(+), 8 deletions(-)
> >
> > --
> > 2.43.0
> >
> 






      reply	other threads:[~2025-09-12 18:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-09 11:11 [PATCH 0/5] pmdomain: Restore behaviour for disabling unused PM domains Ulf Hansson
2025-09-09 11:11 ` [PATCH 1/5] pmdomain: core: " Ulf Hansson
2025-09-09 12:50   ` Heiko Stübner
2025-09-11  7:56   ` Geert Uytterhoeven
2025-09-11 10:25     ` Ulf Hansson
2025-09-09 11:11 ` [PATCH 2/5] pmdomain: rockchip: Fix regulator dependency with GENPD_FLAG_NO_STAY_ON Ulf Hansson
2025-09-09 12:50   ` Heiko Stübner
2025-09-09 13:49   ` Nicolas Frattaroli
2025-09-09 11:11 ` [PATCH 3/5] pmdomain: renesas: rcar-sysc: Don't keep unused PM domains powered-on Ulf Hansson
2025-09-11  7:56   ` Geert Uytterhoeven
2025-09-11  9:01   ` Geert Uytterhoeven
2025-09-11 10:31     ` Ulf Hansson
2025-09-09 11:11 ` [PATCH 4/5] pmdomain: renesas: rcar-gen4-sysc: " Ulf Hansson
2025-09-11  7:57   ` Geert Uytterhoeven
2025-09-09 11:11 ` [PATCH 5/5] pmdomain: renesas: rmobile-sysc: " Ulf Hansson
2025-09-11  7:58   ` Geert Uytterhoeven
2025-09-10 19:33 ` [PATCH 0/5] pmdomain: Restore behaviour for disabling unused PM domains Diederik de Haas
2025-09-11  7:18   ` Geert Uytterhoeven
2025-09-11  8:26     ` Diederik de Haas
2025-09-12 18:32       ` Saravana Kannan
2025-09-12 18:36 ` Saravana Kannan
2025-09-12 18:49   ` Nicolas Frattaroli [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=3919643.KlZ2vcFHjT@workhorse \
    --to=nicolas.frattaroli@collabora.com \
    --cc=abel.vesa@linaro.org \
    --cc=andersson@kernel.org \
    --cc=didi.debian@cknow.org \
    --cc=geert@linux-m68k.org \
    --cc=heiko@sntech.de \
    --cc=johan@kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=maulik.shah@oss.qualcomm.com \
    --cc=michal.simek@amd.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=rafael@kernel.org \
    --cc=saravanak@google.com \
    --cc=sboyd@kernel.org \
    --cc=sebastian.reichel@collabora.com \
    --cc=sebin.francis@ti.com \
    --cc=thierry.reding@gmail.com \
    --cc=tomi.valkeinen@ideasonboard.com \
    --cc=ulf.hansson@linaro.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