Thread (6 messages) 6 messages, 4 authors, 2021-01-19

Re: Correct ordering of phy_init and phy_power_on

From: Kishon Vijay Abraham I <hidden>
Date: 2020-12-21 03:16:42
Also in: lkml

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help