Linux USB
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon@ti.com>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>,
	Vinod Koul <vkoul@kernel.org>,
	Minas Harutyunyan <hminas@synopsys.com>,
	<linux-usb@vger.kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Jules Maselbas <jmaselbas@kalray.eu>
Subject: Re: Correct ordering of phy_init and phy_power_on
Date: Mon, 21 Dec 2020 08:45:32 +0530	[thread overview]
Message-ID: <014e75a5-ab7b-55be-e554-14ef7550b360@ti.com> (raw)
In-Reply-To: <6cd01e79-fdc0-3bd4-32b5-a85142533f8a@pengutronix.de>

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

  reply	other threads:[~2020-12-21  3:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-20 23:06 Correct ordering of phy_init and phy_power_on Ahmad Fatoum
2020-12-21  3:15 ` Kishon Vijay Abraham I [this message]
2020-12-22  9:08   ` Ahmad Fatoum
2021-01-12 17:01 ` [PATCH] usb: dwc2: Change " Jules Maselbas
2021-01-12 21:30   ` Ahmad Fatoum
2021-01-19 14:22     ` [Linux-stm32] " Amelie DELAUNAY

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=014e75a5-ab7b-55be-e554-14ef7550b360@ti.com \
    --to=kishon@ti.com \
    --cc=a.fatoum@pengutronix.de \
    --cc=hminas@synopsys.com \
    --cc=jmaselbas@kalray.eu \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox