Comment #135 for bugzilla 237666 : a USB3-handling problem with a investigatory fix for a cortex-a72 context

Mark Millard marklmi at yahoo.com
Sat Sep 19 21:48:23 UTC 2020



On 2020-Sep-19, at 14:18, Mark Millard <marklmi at yahoo.com> wrote:

> On 2020-Sep-19, at 13:54, Mark Millard <marklmi at yahoo.com> wrote:
> 
> . . .
> 
> The test booted just fine, no "Resetting controller" notices or the
> like. So now I have just:
> 
> # svnlite diff /usr/src/sys/dev/usb/controller/xhci.c
> Index: /usr/src/sys/dev/usb/controller/xhci.c
> ===================================================================
> --- /usr/src/sys/dev/usb/controller/xhci.c	(revision 363590)
> +++ /usr/src/sys/dev/usb/controller/xhci.c	(working copy)
> @@ -431,6 +431,7 @@
> 
> 	phwr->hwr_ring_seg[0].qwEvrsTablePtr = htole64(addr);
> 	phwr->hwr_ring_seg[0].dwEvrsTableSize = htole32(XHCI_MAX_EVENTS);
> +	usb_bus_mem_flush_all(&sc->sc_bus, &xhci_iterate_hw_softc);
> 
> 	DPRINTF("ERDP(0)=0x%016llx\n", (unsigned long long)addr);
> 
> 
> for the issue. (So my earlier powerpc* SYNC comments are likely junk.)

Comment draft added:

# svnlite diff /usr/src/sys/dev/usb/controller/xhci.c
Index: /usr/src/sys/dev/usb/controller/xhci.c
===================================================================
--- /usr/src/sys/dev/usb/controller/xhci.c	(revision 363590)
+++ /usr/src/sys/dev/usb/controller/xhci.c	(working copy)
@@ -431,6 +431,17 @@
 
 	phwr->hwr_ring_seg[0].qwEvrsTablePtr = htole64(addr);
 	phwr->hwr_ring_seg[0].dwEvrsTableSize = htole32(XHCI_MAX_EVENTS);
+	/*
+	 * For bugzilla 237666:
+	 * According to extensible-host-controler-interface-usb-xhci.pdf ,
+	 * the later XWRITE4's to XHCI_ERSTBA_LO and _HI lead to the xhci
+	 * needing to copy the qwEvrsTablePtr and dwEvrsTableSize
+	 * values above at that time (as the xhci initializes its event
+	 * ring support). This is before the event ring starts to pay
+	 * attention to Run/Stop. Thus, make sure the values are
+	 * observable to the xhci before that point.
+	 */
+	usb_bus_mem_flush_all(&sc->sc_bus, &xhci_iterate_hw_softc);
 
 	DPRINTF("ERDP(0)=0x%016llx\n", (unsigned long long)addr);
 

===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)



More information about the freebsd-arm mailing list