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: <014e75a5-ab7b-55be-e554-14ef7550b360@ti.com>
Date:   Mon, 21 Dec 2020 08:45:32 +0530
From:   Kishon Vijay Abraham I <kishon@...com>
To:     Ahmad Fatoum <a.fatoum@...gutronix.de>,
        Vinod Koul <vkoul@...nel.org>,
        Minas Harutyunyan <hminas@...opsys.com>,
        <linux-usb@...r.kernel.org>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Pengutronix Kernel Team <kernel@...gutronix.de>,
        Jules Maselbas <jmaselbas@...ray.eu>
Subject: Re: Correct ordering of phy_init and phy_power_on

Hi,

On 21/12/20 4:36 am, Ahmad Fatoum wrote:
> Hello,
> 
> I just noticed that USB controller drivers differ in the order in which they
> do phy_init and phy_power_on. For example:
> 
> __dwc2_lowlevel_hw_enable():
> 
> 	ret = phy_power_on(hsotg->phy);    
> 	if (ret == 0)                      
>         	ret = phy_init(hsotg->phy);
> 
> dwc3_core_init():
> 
> 	ret = dwc3_core_soft_reset(dwc); // internally does phy_init(dwc->usb2_generic_phy);
> 	/* [snip] */
> 	ret = phy_power_on(dwc->usb2_generic_phy);
> 
> 
> My initial assumption has been init -> power_on, but at least the phy-stm32-usbphyc
> (used with dwc2) is written with the assumption that exit -> power_off (and therefore
> power_on -> init). If they are swapped, disabling fails.
> 
> So how was it meant to be?

It is intended to be ->init() and then ->power_on(). So ideally it
should be the way dwc3 is.

Thanks,
Kishon

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ