dwc3: fix from not working

During the review of 09cdf4878c we
switched from cached registers to reading them as needed.
One read of the two reads was moved after the softreset got triggered
and as a result returned 0 rather than the proper register value.
Moving the read before the softreset gets initiated seems to make
things work again and xhci.c no longer complains about
"Controller does not support 4K page size.".

MFC after:	10 days
X-MFC with:	09cdf4878c
Pointy hat to:	bz
This commit is contained in:
Bjoern A. Zeeb 2022-07-05 00:53:42 +00:00
parent 03473e8ec8
commit ec32fc2af5

View file

@ -207,11 +207,12 @@ snps_dwc3_reset(struct snps_dwc3_softc *sc)
if (sc->usb3_phy)
phy_enable(sc->usb3_phy);
ghwp0 = DWC3_READ(sc, DWC3_GHWPARAMS0);
gctl = DWC3_READ(sc, DWC3_GCTL);
gctl |= DWC3_GCTL_CORESOFTRESET;
DWC3_WRITE(sc, DWC3_GCTL, gctl);
ghwp0 = DWC3_READ(sc, DWC3_GHWPARAMS0);
phy2 = DWC3_READ(sc, DWC3_GUSB2PHYCFG0);
phy2 |= DWC3_GUSB2PHYCFG0_PHYSOFTRST;
if ((ghwp0 & DWC3_GHWPARAMS0_MODE_MASK) ==