lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DB6PR0402MB2760C8EBCF384C19789BBBC5881B9@DB6PR0402MB2760.eurprd04.prod.outlook.com>
Date:   Tue, 6 Jul 2021 09:52:51 +0000
From:   "Peng Fan (OSS)" <peng.fan@....nxp.com>
To:     Ulf Hansson <ulf.hansson@...aro.org>,
        "Peng Fan (OSS)" <peng.fan@....nxp.com>
CC:     "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Kevin Hilman <khilman@...nel.org>, Pavel Machek <pavel@....cz>,
        Len Brown <len.brown@...el.com>,
        Linux PM <linux-pm@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] PM: domains: not update genpd status when power on fail

Hi Ulf,

> Subject: Re: [PATCH] PM: domains: not update genpd status when power on
> fail
> 
> On Tue, 6 Jul 2021 at 11:31, <peng.fan@....nxp.com> wrote:
> >
> > From: Peng Fan <peng.fan@....com>
> >
> > When _genpd_power_on fail, the generic power domain status should not
> > be changed to GENPD_STATE_ON.
> >
> > Signed-off-by: Peng Fan <peng.fan@....com>
> > ---
> >  drivers/base/power/domain.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> > index ab0b740cc0f1..754a5d384479 100644
> > --- a/drivers/base/power/domain.c
> > +++ b/drivers/base/power/domain.c
> > @@ -1101,6 +1101,7 @@ static void genpd_sync_power_on(struct
> generic_pm_domain *genpd, bool use_lock,
> >                                 unsigned int depth)  {
> >         struct gpd_link *link;
> > +       int ret;
> >
> >         if (genpd_status_on(genpd))
> >                 return;
> > @@ -1117,8 +1118,9 @@ static void genpd_sync_power_on(struct
> generic_pm_domain *genpd, bool use_lock,
> >                         genpd_unlock(link->parent);
> >         }
> >
> > -       _genpd_power_on(genpd, false);
> > -       genpd->status = GENPD_STATE_ON;
> > +       ret = _genpd_power_on(genpd, false);
> > +       if (!ret)
> 
> To support this error path, a lot more code needs to be added. Just
> have a look at the callers of genpd_sync_power_on() and compare it
> with genpd_power_on().
> 
> In my opinion, supporting this error path isn't really worth it, at
> least until someone comes with a valid use case. Do you have one - or
> did you send the $subject patch based solely on code inspection?

This is two patchset:
https://patchwork.kernel.org/project/linux-arm-kernel/patch/20210604111005.6804-1-peng.fan@oss.nxp.com/
https://patchwork.kernel.org/project/linux-arm-kernel/cover/20210629072941.7980-1-peng.fan@oss.nxp.com/

I collected in github with a few fixes:
https://github.com/MrVan/linux/tree/linux-next-master-628-blk-ctl-test


In my test, when suspend/resume, I see
pgc_vpu_h1/g1/g2 has status on, but actually they are not on in hardware.
Because vpumix_blk_ctl bus domain is not on, pgc_vpu_h1/g1/g2 runtime
power off will fail.

Thanks,
Peng.

> 
> > +               genpd->status = GENPD_STATE_ON;
> >  }
> >
> >  /**
> > --
> > 2.30.0
> >
> 
> Kind regards
> Uffe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ