Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Fix index vs. count confusion when syncing a rang...



details:   https://anonhg.NetBSD.org/src/rev/b0348809444c
branches:  trunk
changeset: 805540:b0348809444c
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Jan 05 21:37:07 2015 +0000

description:
Fix index vs. count confusion when syncing a range of newly queued TX
descriptors. Pointed out by "naobsd" in private chat.

diffstat:

 sys/dev/ic/dwc_gmac.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r 720b39c469cb -r b0348809444c sys/dev/ic/dwc_gmac.c
--- a/sys/dev/ic/dwc_gmac.c     Mon Jan 05 21:35:53 2015 +0000
+++ b/sys/dev/ic/dwc_gmac.c     Mon Jan 05 21:37:07 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_gmac.c,v 1.29 2014/12/07 02:23:14 jmcneill Exp $ */
+/* $NetBSD: dwc_gmac.c,v 1.30 2015/01/05 21:37:07 martin Exp $ */
 
 /*-
  * Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.29 2014/12/07 02:23:14 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.30 2015/01/05 21:37:07 martin Exp $");
 
 /* #define     DWC_GMAC_DEBUG  1 */
 
@@ -787,6 +787,7 @@
 {
        struct dwc_gmac_softc *sc = ifp->if_softc;
        int old = sc->sc_txq.t_queued;
+       int start = sc->sc_txq.t_cur;
        struct mbuf *m0;
 
        if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
@@ -806,7 +807,7 @@
 
        if (sc->sc_txq.t_queued != old) {
                /* packets have been queued, kick it off */
-               dwc_gmac_txdesc_sync(sc, old, sc->sc_txq.t_cur,
+               dwc_gmac_txdesc_sync(sc, start, sc->sc_txq.t_cur,
                    BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
 
                bus_space_write_4(sc->sc_bst, sc->sc_bsh,



Home | Main Index | Thread Index | Old Index