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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 9 Jul 2021 15:48:01 +0200
From:   Ulf Hansson <ulf.hansson@...aro.org>
To:     Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:     "Rafael J . Wysocki" <rjw@...ysocki.net>,
        Linux PM list <linux-pm@...r.kernel.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Stephen Boyd <sboyd@...nel.org>,
        Saravana Kannan <saravanak@...gle.com>,
        Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
        Kevin Hilman <khilman@...nel.org>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] PM: domains: Don't attach a device to genpd that
 corresponds to a provider

On Fri, 9 Jul 2021 at 15:35, Geert Uytterhoeven <geert@...ux-m68k.org> wrote:
>
> Hi Ulf,
>
> On Fri, Jul 9, 2021 at 3:23 PM Ulf Hansson <ulf.hansson@...aro.org> wrote:
> > On Fri, 9 Jul 2021 at 15:07, Geert Uytterhoeven <geert@...ux-m68k.org> wrote:
> > > On Fri, Jul 9, 2021 at 2:56 PM Ulf Hansson <ulf.hansson@...aro.org> wrote:
> > > > According to the common power domain DT bindings, a power domain provider
> > > > must have a "#power-domain-cells" property in its OF node. Additionally, if
> > > > a provider has a "power-domains" property, it means that it has a parent
> > > > domain.
> > >
> > > OK.
> > >
> > > > It has turned out that some OF nodes that represents a genpd provider may
> > > > also be compatible with a regular platform device. This leads to, during
> > > > probe, genpd_dev_pm_attach(), genpd_dev_pm_attach_by_name() and
> > > > genpd_dev_pm_attach_by_id() tries to attach the corresponding struct device
> > > > to the genpd provider's parent domain, which is wrong. Instead the genpd
> > >
> > > Why is that wrong?
> >
> > It may lead to that the struct device that corresponds to a genpd
> > provider may be attached to the parent domain. In other words, the
> > parent domain will not only be controlled by a child domain
> > (corresponding to the provider), but also through the provider's
> > struct device. As far as I can tell, this has never been the intent
> > for how things should work in genpd.
>
> Ah, you're worried about the case where the subdomain is a child of
> the parent domain, but the actual subdomain controller (represented
> by the platform device) isn't?

Well, even if the platform device represents a subdomain controller,
should it really be attached to the parent domain?

In any case, it means that the provider needs to manage runtime PM,
etc for its struct device to not prevent the parent domain from being
powered off.

Hmm, in the end this is just a matter of expectation of what will
happen during the attach. Perhaps it's just my worries that are wrong.
:-)

>
> > So wrong or not, I guess it depends on what you expect to happen.
> >
> > Do you see an issue with changing this?
>
> I don't have any hardware where the DTS describes a node as being
> both a power domain consumer and a provider.
> SH/R-Mobile uses a nested domain description in DT, but there are
> no platform devices created for the nested child domains, only for
> the top domain.

Okay, thanks for reviewing!

Kind regards
Uffe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ