Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/marvell m_freem() *after* bus_dmamap_sync() and bus_...



details:   https://anonhg.NetBSD.org/src/rev/1c742685bdd7
branches:  trunk
changeset: 366268:1c742685bdd7
user:      rin <rin%NetBSD.org@localhost>
date:      Sat May 21 10:27:30 2022 +0000

description:
m_freem() *after* bus_dmamap_sync() and bus_dmamap_load() for
that mbuf. This is mandatory for some archs.

diffstat:

 sys/dev/marvell/if_mvgbe.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (36 lines):

diff -r e745bd5ed950 -r 1c742685bdd7 sys/dev/marvell/if_mvgbe.c
--- a/sys/dev/marvell/if_mvgbe.c        Sat May 21 10:24:50 2022 +0000
+++ b/sys/dev/marvell/if_mvgbe.c        Sat May 21 10:27:30 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_mvgbe.c,v 1.64 2022/05/21 10:24:50 rin Exp $        */
+/*     $NetBSD: if_mvgbe.c,v 1.65 2022/05/21 10:27:30 rin Exp $        */
 /*
  * Copyright (c) 2007, 2008, 2013 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.64 2022/05/21 10:24:50 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.65 2022/05/21 10:27:30 rin Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -2127,13 +2127,14 @@
                if (cdata->mvgbe_tx_chain[idx].mvgbe_mbuf != NULL) {
                        entry = cdata->mvgbe_tx_map[idx];
 
-                       m_freem(cdata->mvgbe_tx_chain[idx].mvgbe_mbuf);
-                       cdata->mvgbe_tx_chain[idx].mvgbe_mbuf = NULL;
-
                        bus_dmamap_sync(sc->sc_dmat, entry->dmamap, 0,
                            entry->dmamap->dm_mapsize, BUS_DMASYNC_POSTWRITE);
 
                        bus_dmamap_unload(sc->sc_dmat, entry->dmamap);
+
+                       m_freem(cdata->mvgbe_tx_chain[idx].mvgbe_mbuf);
+                       cdata->mvgbe_tx_chain[idx].mvgbe_mbuf = NULL;
+
                        SIMPLEQ_INSERT_TAIL(&sc->sc_txmap_head, entry, link);
                        cdata->mvgbe_tx_map[idx] = NULL;
                }



Home | Main Index | Thread Index | Old Index