[PATCH v2 2/4] usb: xhci-pci: Move reset logic out of XHCI core

Andre Przywara andre.przywara at arm.com
Mon Jul 5 14:12:51 CEST 2021


On Mon, 5 Jul 2021 12:45:59 +0200
Marek Vasut <marex at denx.de> wrote:

Hi,

> On 7/5/21 11:18 AM, Bin Meng wrote:
> > Hi Andre,
> > 
> > On Mon, Jul 5, 2021 at 5:07 PM Andre Przywara <andre.przywara at arm.com> wrote:  
> >>
> >> On Mon, 5 Jul 2021 16:38:29 +0800
> >> Bin Meng <bmeng.cn at gmail.com> wrote:
> >>
> >> Hi,
> >>  
> >>> On Mon, Jul 5, 2021 at 4:19 PM Marek Vasut <marex at denx.de> wrote:  
> >>>>
> >>>> On 7/5/21 10:04 AM, Bin Meng wrote:  
> >>>>> On Sat, Apr 17, 2021 at 10:21 PM Samuel Holland <samuel at sholland.org> wrote:  
> >>>>>>
> >>>>>> Resetting an XHCI controller inside xhci_register undoes any register
> >>>>>> setup performed by the platform driver. And at least on the Allwinner
> >>>>>> H6, resetting the XHCI controller also resets the PHY, which prevents
> >>>>>> the controller from working. That means the controller must be taken out
> >>>>>> of reset before initializing the PHY, which must be done before calling
> >>>>>> xhci_register.
> >>>>>>
> >>>>>> The logic in the XHCI core was added to support the Raspberry Pi 4
> >>>>>> (although this was not mentioned in the commit log!), which uses the
> >>>>>> xhci-pci platform driver. Move the reset logic to the platform driver,
> >>>>>> where it belongs, and where it cannot interfere with other platform
> >>>>>> drivers.
> >>>>>>
> >>>>>> This also fixes a failure to call reset_free if xhci_register failed.
> >>>>>>
> >>>>>> Fixes: 0b80371b350e ("usb: xhci: Add reset controller support")
> >>>>>> Signed-off-by: Samuel Holland <samuel at sholland.org>
> >>>>>> ---
> >>>>>>    drivers/usb/host/xhci-mem.c |  2 --
> >>>>>>    drivers/usb/host/xhci-pci.c | 51 ++++++++++++++++++++++++++++++++++---
> >>>>>>    drivers/usb/host/xhci.c     | 35 -------------------------
> >>>>>>    include/usb/xhci.h          |  2 --
> >>>>>>    4 files changed, 47 insertions(+), 43 deletions(-)
> >>>>>>  
> >>>>>
> >>>>> Reviewed-by: Bin Meng <bmeng.cn at gmail.com>  
> >>>>
> >>>> So shall we apply this whole thing for 2021.10 ?  
> >>>
> >>> Yes. Andre wanted to get this in 2021.07 which is too late.  
> >>
> >> Ah, sorry, I didn't mean into this release, but into the 2021.10 merge
> >> window. I was preparing the sunxi patches for the PR, so stumbled upon
> >> this.  
> > 
> > Ah, 2021.01 is not a problem.
> >   
> >>
> >> So I'd be grateful if you could push this into the MW, I can then
> >> finish up the sunxi side of things (patch 4/4).  
> > 
> > Marek can pick up this soon.  
> 
> U-Boot CI seems to fail on this, please recheck that.

Ouch, thanks for the heads up!
It's xhci-pci.c failing, as used by the RPi4, for instance.

I will send a v3 ASAP.

Cheers,
Andre


More information about the U-Boot mailing list