All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Aisheng Dong <aisheng.dong@nxp.com>
Cc: "dongas86@gmail.com" <dongas86@gmail.com>,
	"khilman@kernel.org" <khilman@kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"rjw@rjwysocki.net" <rjw@rjwysocki.net>,
	dl-linux-imx <linux-imx@nxp.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 2/2] PM / Domains: Choose the deepest state to enter if no devices using it
Date: Wed, 6 Mar 2019 16:10:43 +0100	[thread overview]
Message-ID: <CAPDyKFoWgDAvpwJdLhzVOy3MUoM8Rmf+qinw_EZY4dXd+pp68Q@mail.gmail.com> (raw)
In-Reply-To: <1551878926-8455-3-git-send-email-aisheng.dong@nxp.com>

On Wed, 6 Mar 2019 at 14:35, Aisheng Dong <aisheng.dong@nxp.com> wrote:
>
> For a domain has no working devices anymore, let's choose the deepest state
> to enter to save power. e.g. driver probe failure.
>
> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
> ---
>  drivers/base/power/domain.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index 847a69e..d3f57c2 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -550,6 +550,10 @@ static int genpd_power_off(struct generic_pm_domain *genpd, bool one_dev_on,
>         if (!genpd->gov)
>                 genpd->state_idx = 0;
>
> +       /* Choose the deepest state if no devices using this domain */
> +       if (!genpd->device_count)
> +               genpd->state_idx = genpd->state_count - 1;
> +

This doesn't work, sorry.

For example, there may be a sub-domain with devices in it and which
have constraints applicable also for the master (current) domain.

>         /*
>          * If sd_count > 0 at this point, one of the subdomains hasn't
>          * managed to call genpd_power_on() for the master yet after
> --
> 2.7.4
>

Kind regards
Uffe

WARNING: multiple messages have this Message-ID (diff)
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Aisheng Dong <aisheng.dong@nxp.com>
Cc: "dongas86@gmail.com" <dongas86@gmail.com>,
	"khilman@kernel.org" <khilman@kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"rjw@rjwysocki.net" <rjw@rjwysocki.net>,
	dl-linux-imx <linux-imx@nxp.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 2/2] PM / Domains: Choose the deepest state to enter if no devices using it
Date: Wed, 6 Mar 2019 16:10:43 +0100	[thread overview]
Message-ID: <CAPDyKFoWgDAvpwJdLhzVOy3MUoM8Rmf+qinw_EZY4dXd+pp68Q@mail.gmail.com> (raw)
In-Reply-To: <1551878926-8455-3-git-send-email-aisheng.dong@nxp.com>

On Wed, 6 Mar 2019 at 14:35, Aisheng Dong <aisheng.dong@nxp.com> wrote:
>
> For a domain has no working devices anymore, let's choose the deepest state
> to enter to save power. e.g. driver probe failure.
>
> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
> ---
>  drivers/base/power/domain.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index 847a69e..d3f57c2 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -550,6 +550,10 @@ static int genpd_power_off(struct generic_pm_domain *genpd, bool one_dev_on,
>         if (!genpd->gov)
>                 genpd->state_idx = 0;
>
> +       /* Choose the deepest state if no devices using this domain */
> +       if (!genpd->device_count)
> +               genpd->state_idx = genpd->state_count - 1;
> +

This doesn't work, sorry.

For example, there may be a sub-domain with devices in it and which
have constraints applicable also for the master (current) domain.

>         /*
>          * If sd_count > 0 at this point, one of the subdomains hasn't
>          * managed to call genpd_power_on() for the master yet after
> --
> 2.7.4
>

Kind regards
Uffe

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-03-06 15:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-06 13:35 [PATCH 0/2] PM / Domains: Support enter deepest state during suspend and probe failure Aisheng Dong
2019-03-06 13:35 ` Aisheng Dong
2019-03-06 13:35 ` [PATCH 1/2] PM / Domains: Support enter deepest state for multiple states domains Aisheng Dong
2019-03-06 13:35   ` Aisheng Dong
2019-03-06 15:17   ` Ulf Hansson
2019-03-06 15:17     ` Ulf Hansson
2019-03-06 15:36     ` Aisheng Dong
2019-03-06 15:36       ` Aisheng Dong
2019-03-07 16:01       ` Kevin Hilman
2019-03-07 16:01         ` Kevin Hilman
2019-03-15  2:08         ` Aisheng Dong
2019-03-15  2:08           ` Aisheng Dong
2019-03-06 13:35 ` [PATCH 2/2] PM / Domains: Choose the deepest state to enter if no devices using it Aisheng Dong
2019-03-06 13:35   ` Aisheng Dong
2019-03-06 15:10   ` Ulf Hansson [this message]
2019-03-06 15:10     ` Ulf Hansson
2019-03-06 15:46     ` Aisheng Dong
2019-03-06 15:46       ` Aisheng Dong

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=CAPDyKFoWgDAvpwJdLhzVOy3MUoM8Rmf+qinw_EZY4dXd+pp68Q@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --cc=aisheng.dong@nxp.com \
    --cc=dongas86@gmail.com \
    --cc=khilman@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.