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] [day] [month] [year] [list]
Message-ID: <20201109191257.1074ad74@xhacker.debian>
Date:   Mon, 9 Nov 2020 19:12:57 +0800
From:   Jisheng Zhang <Jisheng.Zhang@...aptics.com>
To:     Russell King - ARM Linux admin <linux@...linux.org.uk>
Cc:     Felipe Balbi <balbi@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Kukjin Kim <kgene@...nel.org>,
        Krzysztof Kozlowski <krzk@...nel.org>,
        Kevin Hilman <khilman@...libre.com>,
        Neil Armstrong <narmstrong@...libre.com>,
        Jerome Brunet <jbrunet@...libre.com>,
        Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
        Andy Gross <agross@...nel.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Patrice Chotard <patrice.chotard@...com>,
        linux-samsung-soc@...r.kernel.org, linux-arm-msm@...r.kernel.org,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-amlogic@...ts.infradead.org, linux-omap@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH usb-next] usb: dwc3: Use devm_of_platform_populate

On Mon, 9 Nov 2020 10:34:14 +0000 Russell King - ARM Linux admin  wrote:

> 
> 
> On Mon, Nov 09, 2020 at 09:59:53AM +0800, Jisheng Zhang wrote:
> > diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c
> > index 417e05381b5d..83015bb7b926 100644
> > --- a/drivers/usb/dwc3/dwc3-meson-g12a.c
> > +++ b/drivers/usb/dwc3/dwc3-meson-g12a.c
> > @@ -702,7 +702,6 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
> >  {
> >       struct dwc3_meson_g12a  *priv;
> >       struct device           *dev = &pdev->dev;
> > -     struct device_node      *np = dev->of_node;
> >       void __iomem *base;
> >       int ret, i;
> >
> > @@ -794,7 +793,7 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
> >                       goto err_phys_power;
> >       }
> >
> > -     ret = of_platform_populate(np, NULL, NULL, dev);
> > +     ret = devm_of_platform_populate(dev);
> >       if (ret)
> >               goto err_phys_power;
> >
> > @@ -832,8 +831,6 @@ static int dwc3_meson_g12a_remove(struct platform_device *pdev)
> >       if (priv->drvdata->otg_switch_supported)
> >               usb_role_switch_unregister(priv->role_switch);
> >
> > -     of_platform_depopulate(dev);
> > -
> >       for (i = 0 ; i < PHY_COUNT ; ++i) {
> >               phy_power_off(priv->phys[i]);
> >               phy_exit(priv->phys[i]);  
> 
> Does it matter that the order that things happen in
> dwc3_meson_g12a_remove() is changed as a result of your patch? Was
> the code relying on the platform devices being depopulated before
> powering off the PHYs?

...

> 
> Same here... and for anywhere else in this patch that you're deleting
> a of_platform_depopulate().

oops, good question! I believe it's not safe to move the depopulate after
the phy_* APIs.

So please ignore this patch.

> 
> You effectively are moving the call to of_platform_depopulate() *after*
> the driver's .remove function has been called.
> 
> --
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ