Module Name:    src
Committed By:   skrll
Date:           Sat Feb  4 08:03:40 UTC 2017

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

Log Message:
More usb_syncmem tweaks.  The main one is sync'ing the entire last TD
returned from ohci_reset_std_chain in control transfers.


To generate a diff of this commit:
cvs rdiff -u -r1.272 -r1.273 src/sys/dev/usb/ohci.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/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.272 src/sys/dev/usb/ohci.c:1.273
--- src/sys/dev/usb/ohci.c:1.272	Tue Jan 31 07:34:02 2017
+++ src/sys/dev/usb/ohci.c	Sat Feb  4 08:03:40 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.272 2017/01/31 07:34:02 skrll Exp $	*/
+/*	$NetBSD: ohci.c,v 1.273 2017/02/04 08:03:40 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.272 2017/01/31 07:34:02 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.273 2017/02/04 08:03:40 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -2760,9 +2760,7 @@ ohci_device_ctrl_start(struct usbd_xfer 
 		end->td.td_nexttd = HTOO32(stat->physaddr);
 		end->nexttd = stat;
 
-		usb_syncmem(&end->dma,
-		    end->offs + offsetof(ohci_td_t, td_nexttd),
-		    sizeof(end->td.td_nexttd),
+		usb_syncmem(&end->dma, end->offs, sizeof(end->td),
 		    BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
 
 		usb_syncmem(&xfer->ux_dmabuf, 0, len,
@@ -3005,7 +3003,7 @@ ohci_device_bulk_start(struct usbd_xfer 
 	tail->nexttd = NULL;
 	tail->xfer = NULL;
 	usb_syncmem(&tail->dma, tail->offs, sizeof(tail->td),
-	    BUS_DMASYNC_PREWRITE);
+	    BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
 	xfer->ux_hcpriv = data;
 
 	DPRINTFN(8, "xfer %p data %p tail %p", xfer, ox->ox_stds[0], tail, 0);
@@ -3202,7 +3200,7 @@ ohci_device_intr_start(struct usbd_xfer 
 	tail->nexttd = NULL;
 	tail->xfer = NULL;
 	usb_syncmem(&tail->dma, tail->offs, sizeof(tail->td),
-	    BUS_DMASYNC_PREWRITE);
+	    BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
 	xfer->ux_hcpriv = data;
 
 	DPRINTFN(8, "data %p tail %p", ox->ox_stds[0], tail, 0, 0);
@@ -3536,6 +3534,7 @@ ohci_device_isoc_enter(struct usbd_xfer 
 			ncur = 0;
 		}
 		sitd->itd.itd_offset[ncur] = HTOO16(OHCI_ITD_MK_OFFS(offs));
+		/* XXX Sync */
 		offs = noffs;
 	}
 	KASSERT(j <= ox->ox_nsitd);

Reply via email to