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]
Message-ID: <AM6PR04MB49667282278422829AF98D3080E00@AM6PR04MB4966.eurprd04.prod.outlook.com>
Date:   Thu, 19 Nov 2020 15:44:20 +0000
From:   Aisheng Dong <aisheng.dong@....com>
To:     "Rafael J. Wysocki" <rafael@...nel.org>
CC:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        dl-linux-imx <linux-imx@....com>,
        Dong Aisheng <dongas86@...il.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Saravana Kannan <saravanak@...gle.com>
Subject: RE: [PATCH 1/3] driver core: simply go out if the same device_link is
 added again

> From: Rafael J. Wysocki <rafael@...nel.org>
> Sent: Thursday, November 19, 2020 8:12 PM
> 
> On Thu, Nov 19, 2020 at 12:18 PM Dong Aisheng <aisheng.dong@....com>
> wrote:
> >
> > It's possible that the same device link may be added by parsing the
> > function dependecy in DT. e.g. clock/gpio/regulators.
> > Simply go out for this case.
> 
> Why?
> 
> > Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> > Cc: "Rafael J. Wysocki" <rafael@...nel.org>
> > Cc: Saravana Kannan <saravanak@...gle.com>
> > Signed-off-by: Dong Aisheng <aisheng.dong@....com>
> > ---
> >  drivers/base/core.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/base/core.c b/drivers/base/core.c index
> > 4c03bdd3a268..7d91d4074136 100644
> > --- a/drivers/base/core.c
> > +++ b/drivers/base/core.c
> > @@ -567,6 +567,9 @@ struct device_link *device_link_add(struct device
> *consumer,
> >                 if (link->consumer != consumer)
> >                         continue;
> >
> > +               if (flags == link->flags)
> > +                       goto out;
> 
> But this prevents rpm_count from being incremented if DL_FLAG_RPM_ACTIVE
> is set in flags, which is necessary, because the supplier's PM-runtime usage
> counter has been incremented already.
> 
> Moreover, every attempt to create a stateless link must cause a new reference
> on the existing link to be acquired, or the removal will not work correctly.

Yes, I see. Thanks for the explanation.

Regards
Aisheng

> 
> > +
> >                 if (flags & DL_FLAG_PM_RUNTIME) {
> >                         if (!(link->flags & DL_FLAG_PM_RUNTIME)) {
> >                                 pm_runtime_new_link(consumer);
> > --

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ