linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anup Patel <anup@brainfault.org>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Saravana Kannan <saravanak@google.com>,
	Stephen Boyd <sboyd@kernel.org>,
	linux-pm@vger.kernel.org,
	 "Rafael J . Wysocki" <rafael@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Michael Grzeschik <m.grzeschik@pengutronix.de>,
	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>,
	Hiago De Franco <hiago.franco@toradex.com>,
	 Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-arm-kernel@lists.infradead.org,
	 linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org
Subject: Re: [PATCH v3 24/24] cpuidle: riscv-sbi: Drop redundant sync_state support
Date: Mon, 7 Jul 2025 15:08:45 +0530	[thread overview]
Message-ID: <CAAhSdy06D-7PGbt4jR2rr2D_rJG4CnevHV+LJm-BZ7CxMpECQw@mail.gmail.com> (raw)
In-Reply-To: <20250701114733.636510-25-ulf.hansson@linaro.org>

On Tue, Jul 1, 2025 at 5:18 PM Ulf Hansson <ulf.hansson@linaro.org> wrote:
>
> The recent updates to the genpd core, can entirely manage the sync_state
> support for the cpuidle-riscv-sbi-domain. More precisely, genpd prevents
> our ->power_off() callback from being invoked, until all of our consumers
> are ready for it.
>
> Let's therefore drop the sync_state support for the
> cpuidle-riscv-sbi-domain as it has become redundant.
>
> Cc: Anup Patel <anup@brainfault.org>
> Cc: linux-riscv@lists.infradead.org
> Tested-by: Hiago De Franco <hiago.franco@toradex.com> # Colibri iMX8X
> Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> # TI AM62A,Xilinx ZynqMP ZCU106
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

LGTM.

Reviewed-by: Anup Patel <anup@brainfault.org>

Regards,
Anup

> ---
>  drivers/cpuidle/cpuidle-riscv-sbi.c | 22 +---------------------
>  1 file changed, 1 insertion(+), 21 deletions(-)
>
> diff --git a/drivers/cpuidle/cpuidle-riscv-sbi.c b/drivers/cpuidle/cpuidle-riscv-sbi.c
> index 83d58d00872f..a360bc4d20b7 100644
> --- a/drivers/cpuidle/cpuidle-riscv-sbi.c
> +++ b/drivers/cpuidle/cpuidle-riscv-sbi.c
> @@ -44,7 +44,6 @@ static DEFINE_PER_CPU_READ_MOSTLY(struct sbi_cpuidle_data, sbi_cpuidle_data);
>  static DEFINE_PER_CPU(struct sbi_domain_state, domain_state);
>  static bool sbi_cpuidle_use_osi;
>  static bool sbi_cpuidle_use_cpuhp;
> -static bool sbi_cpuidle_pd_allow_domain_state;
>
>  static inline void sbi_set_domain_state(u32 state)
>  {
> @@ -345,20 +344,6 @@ static int sbi_cpuidle_init_cpu(struct device *dev, int cpu)
>         return ret;
>  }
>
> -static void sbi_cpuidle_domain_sync_state(struct device *dev)
> -{
> -       struct sbi_pd_provider *pd_provider;
> -
> -       /*
> -        * All devices have now been attached/probed to the PM domain
> -        * topology, hence it's fine to allow domain states to be picked.
> -        */
> -       sbi_cpuidle_pd_allow_domain_state = true;
> -
> -       list_for_each_entry(pd_provider, &sbi_pd_providers, link)
> -               of_genpd_sync_state(pd_provider->node);
> -}
> -
>  #ifdef CONFIG_DT_IDLE_GENPD
>
>  static int sbi_cpuidle_pd_power_off(struct generic_pm_domain *pd)
> @@ -369,9 +354,6 @@ static int sbi_cpuidle_pd_power_off(struct generic_pm_domain *pd)
>         if (!state->data)
>                 return 0;
>
> -       if (!sbi_cpuidle_pd_allow_domain_state)
> -               return -EBUSY;
> -
>         /* OSI mode is enabled, set the corresponding domain state. */
>         pd_state = state->data;
>         sbi_set_domain_state(*pd_state);
> @@ -401,8 +383,7 @@ static int sbi_pd_init(struct device_node *np)
>         if (!pd_provider)
>                 goto free_pd;
>
> -       pd->flags |= GENPD_FLAG_IRQ_SAFE | GENPD_FLAG_CPU_DOMAIN |
> -                    GENPD_FLAG_NO_SYNC_STATE;
> +       pd->flags |= GENPD_FLAG_IRQ_SAFE | GENPD_FLAG_CPU_DOMAIN;
>
>         /* Allow power off when OSI is available. */
>         if (sbi_cpuidle_use_osi)
> @@ -570,7 +551,6 @@ static struct platform_driver sbi_cpuidle_driver = {
>         .probe = sbi_cpuidle_probe,
>         .driver = {
>                 .name = "sbi-cpuidle",
> -               .sync_state = sbi_cpuidle_domain_sync_state,
>         },
>  };
>
> --
> 2.43.0
>

  parent reply	other threads:[~2025-07-07  9:38 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-01 11:47 [PATCH v3 00/24] pmdomain: Add generic ->sync_state() support to genpd Ulf Hansson
2025-07-01 11:47 ` [PATCH v3 01/24] pmdomain: renesas: rcar-sysc: Add genpd OF provider at postcore_initcall Ulf Hansson
2025-07-01 11:47 ` [PATCH v3 02/24] pmdomain: renesas: rmobile-sysc: Move init to postcore_initcall Ulf Hansson
2025-07-01 11:47 ` [PATCH v3 03/24] pmdomain: renesas: rcar-gen4-sysc: " Ulf Hansson
2025-07-01 11:47 ` [PATCH v3 04/24] pmdomain: core: Prevent registering devices before the bus Ulf Hansson
2025-07-01 11:47 ` [PATCH v3 05/24] pmdomain: core: Add a bus and a driver for genpd providers Ulf Hansson
2025-07-01 11:47 ` [PATCH v3 06/24] pmdomain: core: Add the genpd->dev to the genpd provider bus Ulf Hansson
2025-07-01 11:47 ` [PATCH v3 07/24] pmdomain: core: Export a common ->sync_state() helper for genpd providers Ulf Hansson
2025-07-01 11:47 ` [PATCH v3 08/24] pmdomain: core: Prepare to add the common ->sync_state() support Ulf Hansson
2025-07-01 11:47 ` [PATCH v3 09/24] soc/tegra: pmc: Opt-out from genpd's " Ulf Hansson
2025-07-01 11:47 ` [PATCH v3 10/24] cpuidle: psci: " Ulf Hansson
2025-07-01 11:47 ` [PATCH v3 11/24] cpuidle: riscv-sbi: " Ulf Hansson
2025-07-04 10:14   ` Rahul Pathak
2025-07-07  9:36   ` Anup Patel
2025-08-10 21:12   ` patchwork-bot+linux-riscv
2025-07-01 11:47 ` [PATCH v3 12/24] pmdomain: qcom: rpmpd: Use of_genpd_sync_state() Ulf Hansson
2025-07-01 11:47 ` [PATCH v3 13/24] pmdomain: qcom: rpmhpd: " Ulf Hansson
2025-07-01 11:47 ` [PATCH v3 14/24] firmware/pmdomain: xilinx: Move ->sync_state() support to firmware driver Ulf Hansson
2025-07-01 11:47 ` [PATCH v3 15/24] firmware: xilinx: Don't share zynqmp_pm_init_finalize() Ulf Hansson
2025-07-01 11:47 ` [PATCH v3 16/24] firmware: xilinx: Use of_genpd_sync_state() Ulf Hansson
2025-07-01 11:47 ` [PATCH v3 17/24] driver core: Export get_dev_from_fwnode() Ulf Hansson
2025-07-02  7:34   ` Greg Kroah-Hartman
2025-07-02 19:26     ` Danilo Krummrich
2025-07-02 21:34       ` Saravana Kannan
2025-07-02 21:55         ` Danilo Krummrich
2025-07-01 11:47 ` [PATCH v3 18/24] pmdomain: core: Add common ->sync_state() support for genpd providers Ulf Hansson
2025-07-01 11:47 ` [PATCH v3 19/24] driver core: Add dev_set_drv_sync_state() Ulf Hansson
2025-07-01 11:47 ` [PATCH v3 20/24] pmdomain: core: Default to use of_genpd_sync_state() for genpd providers Ulf Hansson
2025-07-31 15:07   ` Jon Hunter
2025-08-11 12:11     ` Ulf Hansson
2025-09-03 12:33       ` Jon Hunter
2025-07-01 11:47 ` [PATCH v3 21/24] pmdomain: core: Leave powered-on genpds on until late_initcall_sync Ulf Hansson
     [not found]   ` <CGME20250710122654eucas1p20f1179a9ff22d562d89252f924d34dae@eucas1p2.samsung.com>
2025-07-10 12:26     ` Marek Szyprowski
2025-07-10 14:54       ` Ulf Hansson
2025-07-15 10:28         ` Jon Hunter
2025-07-15 11:32           ` Ulf Hansson
2025-07-15 11:34             ` Ulf Hansson
2025-07-31 12:53               ` Jon Hunter
2025-07-01 11:47 ` [PATCH v3 22/24] pmdomain: core: Leave powered-on genpds on until sync_state Ulf Hansson
2025-07-01 11:47 ` [PATCH v3 23/24] cpuidle: psci: Drop redundant sync_state support Ulf Hansson
2025-07-01 11:47 ` [PATCH v3 24/24] cpuidle: riscv-sbi: " Ulf Hansson
2025-07-04 10:39   ` Rahul Pathak
2025-07-07  9:38   ` Anup Patel [this message]
2025-07-09 11:30 ` [PATCH v3 00/24] pmdomain: Add generic ->sync_state() support to genpd Ulf Hansson
2025-07-15  8:50   ` Danilo Krummrich
2025-07-16 12:46     ` Ulf Hansson
2025-07-16 13:08       ` Danilo Krummrich
2025-07-30  9:56   ` Geert Uytterhoeven
2025-07-30 10:29     ` Ulf Hansson
2025-08-07  9:38       ` Geert Uytterhoeven
2025-08-12 10:00         ` Ulf Hansson
2025-08-13 11:58           ` Geert Uytterhoeven
2025-08-14 15:49             ` Ulf Hansson
2025-09-04 12:41               ` Geert Uytterhoeven
2025-09-04 15:44                 ` Ulf Hansson
2025-08-13 12:04   ` Geert Uytterhoeven
2025-09-03  7:39 ` Sebin Francis
2025-09-03 10:33   ` Ulf Hansson
2025-09-04 12:32     ` Diederik de Haas

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=CAAhSdy06D-7PGbt4jR2rr2D_rJG4CnevHV+LJm-BZ7CxMpECQw@mail.gmail.com \
    --to=anup@brainfault.org \
    --cc=abel.vesa@linaro.org \
    --cc=andersson@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hiago.franco@toradex.com \
    --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=linux-riscv@lists.infradead.org \
    --cc=m.grzeschik@pengutronix.de \
    --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=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;
as well as URLs for NNTP newsgroup(s).