[PATCH RFC 05/22] usb: dwc3: apple: Do not use host-vbus-glitches workaround
Thinh Nguyen
Thinh.Nguyen at synopsys.com
Thu Aug 28 16:06:02 PDT 2025
On Sat, Aug 23, 2025, Sven Peter wrote:
> On 22.08.25 00:28, Thinh Nguyen wrote:
> > On Thu, Aug 21, 2025, Sven Peter wrote:
> > > From: Janne Grunau <j at jannau.net>
>
> [...]
>
> > > /*
> > > * Some platforms need to power off all Root hub ports immediately after DWC3 set to host
> > > * mode to avoid VBUS glitch happen when xhci get reset later.
> > > + * On Apple platforms we must not touch any MMIO yet because dwc3
> > > + * will not work correctly before its PHY has been initialized.
> >
> > This doesn't make sense, the phy should've been initialized by this
> > point. We already access MMIO before this. Even your [PATCH RFC 7/22]
> > attempts to access MMIO before this, yet accessing here causes problem.
> > Do we know when the phy get initialized then?
>
> You're absolutely right, this doesn't make any sense!
>
> dwc3_power_off_all_roothub_ports uses ioremap which will map the XHCI region
> as Device-nGnRE. That just doesn't work on these machines and actually
> explains the SErrors.
> Resources on these machines generally have the IORESOURCE_MEM_NONPOSTED flag
> set (via the nonposted-mmio dt property) and then use ioremap_np to map them
> using Device-nGnRnE.
>
Ok. So the failure does not seem to be because the phy hasn't been
initialized yet, but it's because of io mapping.
Did you try to check against IORESOURCE_MEM_NONPOSTED to use ioremap_np
instead? That keeps the logic consistent between different platforms.
BR,
Thinh
More information about the linux-phy
mailing list