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: <CAEDbmAT=fZ-kpn13sW4KjB9RuFb_6T4j_eripR54NZ3UciZfqA@mail.gmail.com>
Date:   Fri, 22 Apr 2022 10:10:55 +0800
From:   surong pang <surong.pang@...il.com>
To:     Mathias Nyman <mathias.nyman@...ux.intel.com>
Cc:     mathias.nyman@...el.com, Greg KH <gregkh@...uxfoundation.org>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        Orson.Zhai@...soc.com, yunguo.wu@...soc.com
Subject: Re: [PATCH V1 1/1] usb/host: Let usb phy shutdown later

shared_hcd might be freed already here, but hcd should not be freed
here, because "usb_put_hcd(hcd)" is called later.

Mathias Nyman <mathias.nyman@...ux.intel.com> 于2022年4月19日周二 22:43写道:
>
> On 12.4.2022 15.25, Surong Pang wrote:
> > From: Surong Pang <surong.pang@...soc.com>
> >
> > Let usb phy shutdown later in xhci_plat_remove function.
> > Some phy driver doesn't divide 3.0/2.0 very clear.
> > If calls usb_phy_shutdown earlier than usb_remove_hcd(hcd),
> > It will case 10s cmd timeout issue.
> >
> > Call usb phy shutdown later has better compatibility.
> >
> > Signed-off-by: Surong Pang <surong.pang@...soc.com>
> > ---
> >  drivers/usb/host/xhci-plat.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> > index 649ffd861b44..dc73a81cbe9b 100644
> > --- a/drivers/usb/host/xhci-plat.c
> > +++ b/drivers/usb/host/xhci-plat.c
> > @@ -390,7 +390,6 @@ static int xhci_plat_remove(struct platform_device *dev)
> >
> >       usb_remove_hcd(shared_hcd);
> >       xhci->shared_hcd = NULL;
> > -     usb_phy_shutdown(hcd->usb_phy);
> >
> >       usb_remove_hcd(hcd);
> >       usb_put_hcd(shared_hcd);
> > @@ -398,6 +397,7 @@ static int xhci_plat_remove(struct platform_device *dev)
> >       clk_disable_unprepare(clk);
> >       clk_disable_unprepare(reg_clk);
> >       usb_put_hcd(hcd);
> > +     usb_phy_shutdown(hcd->usb_phy);
>
> hcd might be freed already here.
> maybe call usb_phy_shutdown(hcd->usb_phy) before usb_put_hcd(hcd)
>
> -Mathias
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ