Module Name:    src
Committed By:   jakllsch
Date:           Mon May 14 00:26:02 UTC 2018

Modified Files:
        src/sys/dev/usb: xhci.c

Log Message:
With the hope it fixes PR #52911, be extra paranoid about assuring the
Device Context DMA memory is sync'd immediately before reading from it.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/dev/usb/xhci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.91 src/sys/dev/usb/xhci.c:1.92
--- src/sys/dev/usb/xhci.c:1.91	Wed May  2 09:55:22 2018
+++ src/sys/dev/usb/xhci.c	Mon May 14 00:26:02 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.91 2018/05/02 09:55:22 jmcneill Exp $	*/
+/*	$NetBSD: xhci.c,v 1.92 2018/05/14 00:26:02 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.91 2018/05/02 09:55:22 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.92 2018/05/14 00:26:02 jakllsch Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -2367,6 +2367,7 @@ xhci_new_device(device_t parent, struct 
 		/* Allow device time to set new address */
 		usbd_delay_ms(dev, USB_SET_ADDRESS_SETTLE);
 
+		usb_syncmem(&xs->xs_dc_dma, 0, sc->sc_pgsz, BUS_DMASYNC_POSTREAD);
 		cp = xhci_slot_get_dcv(sc, xs, XHCI_DCI_SLOT);
 		HEXDUMP("slot context", cp, sc->sc_ctxsz);
 		uint8_t addr = XHCI_SCTX_3_DEV_ADDR_GET(le32toh(cp[3]));

Reply via email to