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: <CAEDbmAT3SoSsEmTkELSYoykGN+AuPgi2N11V2YwKuaC3nKMEmQ@mail.gmail.com>
Date:   Fri, 22 Apr 2022 18:43:48 +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

>>> @@ -398,6 +397,7 @@ static int xhci_plat_remove(struct platform_device *dev)
>>>       clk_disable_unprepare(clk);
>>>       clk_disable_unprepare(reg_clk);
>>> +    usb_phy_shutdown(hcd->usb_phy);
>>>       usb_put_hcd(hcd);

Is it ok to put usb_phy_shutdown before usb_put_hcd(hcd)? hcd is
released at usb_put_hcd.

UNISOC DWC3 phy is not divided  USB 2.0/3.0 phy clearly.  Yes, it's
UNISOC's issue.
It UNISOC's dtsi: phys = <&ssphy>, <&ssphy>;
If to shutdown phy too earlier,  it will cost 10s timeout to do xhci_reset.
usb_remmove_hcd  --> usb_stop_hcd --> xhci_stop --> xhci_reset  -->
xhci_handshake(&xhci->op_regs->command, CMD_RESET, 0, 10 * 1000 *1000)

I want to know this change is acceptable or not?

hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev, "usb-phy", 0);
Why in xhci_plat_remove, just to shutdown "usb-phy"[0], not to
shutdown "usb-phy"[1] ?

Mathias Nyman <mathias.nyman@...ux.intel.com> 于2022年4月22日周五 15:51写道:
>
> On 22.4.2022 5.10, surong pang wrote:
> > shared_hcd might be freed already here, but hcd should not be freed
> > here, because "usb_put_hcd(hcd)" is called later.
>
> To me it still looks like this patch calls usb_phy_shutdown(hcd->usb_phy) _after_
> usb_put_hcd(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);
>
>
> shared hcd was freed even earlier, before disabling the clocks.
>
> Thanks
> Mathias

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ