Thu Mar 5 08:12:30 2020 UTC ()
Remove XXX comment.  The sync is done one the last sitd after the loop.


(skrll)
diff -r1.296 -r1.297 src/sys/dev/usb/ohci.c

cvs diff -r1.296 -r1.297 src/sys/dev/usb/ohci.c (expand / switch to unified diff)

--- src/sys/dev/usb/ohci.c 2020/02/21 12:41:29 1.296
+++ src/sys/dev/usb/ohci.c 2020/03/05 08:12:30 1.297
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ohci.c,v 1.296 2020/02/21 12:41:29 skrll Exp $ */ 1/* $NetBSD: ohci.c,v 1.297 2020/03/05 08:12:30 skrll Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc. 4 * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Lennart Augustsson (lennart@augustsson.net) at 8 * by Lennart Augustsson (lennart@augustsson.net) at
9 * Carlstedt Research & Technology, Jared D. McNeill (jmcneill@invisible.ca) 9 * Carlstedt Research & Technology, Jared D. McNeill (jmcneill@invisible.ca)
10 * and Matthew R. Green (mrg@eterna.com.au). 10 * and Matthew R. Green (mrg@eterna.com.au).
11 * This code is derived from software contributed to The NetBSD Foundation 11 * This code is derived from software contributed to The NetBSD Foundation
12 * by Charles M. Hannum. 12 * by Charles M. Hannum.
13 * 13 *
14 * Redistribution and use in source and binary forms, with or without 14 * Redistribution and use in source and binary forms, with or without
@@ -31,27 +31,27 @@ @@ -31,27 +31,27 @@
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE. 33 * POSSIBILITY OF SUCH DAMAGE.
34 */ 34 */
35 35
36/* 36/*
37 * USB Open Host Controller driver. 37 * USB Open Host Controller driver.
38 * 38 *
39 * OHCI spec: http://www.compaq.com/productinfo/development/openhci.html 39 * OHCI spec: http://www.compaq.com/productinfo/development/openhci.html
40 * USB spec: http://www.usb.org/developers/docs/ 40 * USB spec: http://www.usb.org/developers/docs/
41 */ 41 */
42 42
43#include <sys/cdefs.h> 43#include <sys/cdefs.h>
44__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.296 2020/02/21 12:41:29 skrll Exp $"); 44__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.297 2020/03/05 08:12:30 skrll Exp $");
45 45
46#ifdef _KERNEL_OPT 46#ifdef _KERNEL_OPT
47#include "opt_usb.h" 47#include "opt_usb.h"
48#endif 48#endif
49 49
50#include <sys/param.h> 50#include <sys/param.h>
51 51
52#include <sys/cpu.h> 52#include <sys/cpu.h>
53#include <sys/device.h> 53#include <sys/device.h>
54#include <sys/kernel.h> 54#include <sys/kernel.h>
55#include <sys/kmem.h> 55#include <sys/kmem.h>
56#include <sys/proc.h> 56#include <sys/proc.h>
57#include <sys/queue.h> 57#include <sys/queue.h>
@@ -3502,27 +3502,26 @@ ohci_device_isoc_enter(struct usbd_xfer  @@ -3502,27 +3502,26 @@ ohci_device_isoc_enter(struct usbd_xfer
3502#ifdef DIAGNOSTIC 3502#ifdef DIAGNOSTIC
3503 sitd->isdone = false; 3503 sitd->isdone = false;
3504#endif 3504#endif
3505 ohci_hash_add_itd(sc, sitd); 3505 ohci_hash_add_itd(sc, sitd);
3506 usb_syncmem(&sitd->dma, sitd->offs, sizeof(sitd->itd), 3506 usb_syncmem(&sitd->dma, sitd->offs, sizeof(sitd->itd),
3507 BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); 3507 BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
3508 3508
3509 sitd = nsitd; 3509 sitd = nsitd;
3510 isoc->next = isoc->next + ncur; 3510 isoc->next = isoc->next + ncur;
3511 bp0 = OHCI_PAGE(buf + offs); 3511 bp0 = OHCI_PAGE(buf + offs);
3512 ncur = 0; 3512 ncur = 0;
3513 } 3513 }
3514 sitd->itd.itd_offset[ncur] = HTOO16(OHCI_ITD_MK_OFFS(offs)); 3514 sitd->itd.itd_offset[ncur] = HTOO16(OHCI_ITD_MK_OFFS(offs));
3515 /* XXX Sync */ 
3516 offs = noffs; 3515 offs = noffs;
3517 } 3516 }
3518 KASSERT(j <= ox->ox_nsitd); 3517 KASSERT(j <= ox->ox_nsitd);
3519 3518
3520 /* point at sentinel */ 3519 /* point at sentinel */
3521 tail = opipe->tail.itd; 3520 tail = opipe->tail.itd;
3522 memset(&tail->itd, 0, sizeof(tail->itd)); 3521 memset(&tail->itd, 0, sizeof(tail->itd));
3523 tail->nextitd = NULL; 3522 tail->nextitd = NULL;
3524 tail->xfer = NULL; 3523 tail->xfer = NULL;
3525 usb_syncmem(&tail->dma, tail->offs, sizeof(tail->itd), 3524 usb_syncmem(&tail->dma, tail->offs, sizeof(tail->itd),
3526 BUS_DMASYNC_PREWRITE); 3525 BUS_DMASYNC_PREWRITE);
3527 3526
3528 /* Fixup last used ITD */ 3527 /* Fixup last used ITD */