mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jules Maselbas <jmaselbas@kalray.eu>
To: Michael Grzeschik <mgr@pengutronix.de>
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>,
	Ahmad Fatoum <ahmad@a3f.at>, Sascha Hauer <sha@pengutronix.de>,
	barebox@lists.infradead.org
Subject: Re: [PATCH 1/2] fixup! usb: dwc2: Add support for optional usb phy
Date: Tue, 22 Mar 2022 10:23:38 +0100	[thread overview]
Message-ID: <20220322092338.GB5398@tellis.lin.mbt.kalray.eu> (raw)
In-Reply-To: <20220322082923.GL11246@pengutronix.de>

Hi,

> > > > > > > Until this is settled, swap the order to follow what Linux does.
> > > > > > > This is suboptimal, because it means controller drivers have different
> > > > > > > order of the operations and that you can't combine arbitrary PHYs and
> > > > > > > controllers, but it seems unlikely we will support combinations that
> > > > > > > aren't supported by Linux in the first place anyway.
> > > > > > 
> > > > > > This is valuable information and I don't want it to be lost, so instead
> > > > > > of applying this as a fixup I rewrote the subject to:
> > > > > > 
> > > > > > usb: dwc2: swap order of phy_init and phy_power_on to what Linux does
> > > > > > 
> > > > > > and applied it as a separate patch.
> > > > > 
> > > > > With this patch applied, some stm32mp1 do seem to timeout when
> > > > > addressing the core.
> > > > > 
> > > > > WARNING: dwc2 49000000.usb-otg@49000000.of: dwc2_core_reset: Timeout! Waiting for Core Soft Reset
> > > > > ERROR: dwc2 49000000.usb-otg@49000000.of: probe failed: Connection timed out
> > > > > 
> > > > > When I revert this patch. Everything works fine again.
> > > > > 
> > > > > Is it possible that we can revert it in mainline now?
> > > > 
> > > > Since 0e37f94fbe1b ("phy: stm32: sync with upstream"), the phy-stm32-usbphyc now
> > > > has no poweron/poweroff callbacks, so a revert seems to only slightly change
> > > > timing. I'd suggest you dig some more.
> > > 
> > > That is not true. phy_power_on also enables the phy_regulator. Changing
> > > this order has the effect that the regulator is enabled after or before
> > > phy_init call.
> > 
> > Oh, good point.
> > 
> > > > > How can I reproduce the case this was fixing in the first place?
> > > > 
> > > > The case was that barebox calls poweron/init in a different order than Linux.
> > > > This point is moot now though because poweron is no longer provided by the
> > > > driver.
> > > 
> > > Still not true, though.
> > 
> > Isn't this the same order Linux uses? Powering on regulator and then phy_init?
> > Why does it lead to issues in barebox, but not in Linux?
> 
> I have no clue so far. Especially as this seems to have implications on
> the platform I am working on but not on the dk2. Although both use the
> same st,stpmic1 node vdd_usb for the phy_regulator.

In linux driver dwc2 (and dwc3) call phy_poweron then phy_init, which I
believe is not the right order, it should be init -> poweron.
The thing is that's a two part issue, first the usb drivers using phy
must use the correct call order, secondly the phy drivers must implement
the correct "flow"







_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  reply	other threads:[~2022-03-22  9:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-21  0:32 [PATCH 0/2] usb: dwc2: gadget: fix stm32mp1 hang on barebox shutdown Ahmad Fatoum
2020-12-21  0:32 ` [PATCH 1/2] fixup! usb: dwc2: Add support for optional usb phy Ahmad Fatoum
2021-01-06 10:05   ` Sascha Hauer
2022-03-21 22:17     ` Michael Grzeschik
2022-03-22  5:35       ` Ahmad Fatoum
2022-03-22  8:19         ` Michael Grzeschik
2022-03-22  8:25           ` Ahmad Fatoum
2022-03-22  8:29             ` Michael Grzeschik
2022-03-22  9:23               ` Jules Maselbas [this message]
2020-12-21  0:32 ` [PATCH 2/2] regulator: stm32-pwr: don't propagate regulator turn-off to supply Ahmad Fatoum

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=20220322092338.GB5398@tellis.lin.mbt.kalray.eu \
    --to=jmaselbas@kalray.eu \
    --cc=a.fatoum@pengutronix.de \
    --cc=ahmad@a3f.at \
    --cc=barebox@lists.infradead.org \
    --cc=mgr@pengutronix.de \
    --cc=sha@pengutronix.de \
    /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