Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Fix locking against myself at wm_turn{on, off} wh...
details: https://anonhg.NetBSD.org/src/rev/4fe3193354b9
branches: trunk
changeset: 348621:4fe3193354b9
user: knakahara <knakahara%NetBSD.org@localhost>
date: Mon Oct 31 02:44:54 2016 +0000
description:
Fix locking against myself at wm_turn{on,off} when NET_MPSAFE is defined.
Pointed out by ozaki-r@n.o, thanks.
diffstat:
sys/dev/pci/if_wm.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diffs (49 lines):
diff -r 705e30aeaaef -r 4fe3193354b9 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c Mon Oct 31 01:31:25 2016 +0000
+++ b/sys/dev/pci/if_wm.c Mon Oct 31 02:44:54 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wm.c,v 1.435 2016/10/28 09:16:02 msaitoh Exp $ */
+/* $NetBSD: if_wm.c,v 1.436 2016/10/31 02:44:54 knakahara Exp $ */
/*
* Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -84,7 +84,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.435 2016/10/28 09:16:02 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.436 2016/10/31 02:44:54 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_net_mpsafe.h"
@@ -4572,6 +4572,8 @@
{
int i;
+ KASSERT(WM_CORE_LOCKED(sc));
+
for(i = 0; i < sc->sc_nqueues; i++) {
struct wm_txqueue *txq = &sc->sc_queue[i].wmq_txq;
struct wm_rxqueue *rxq = &sc->sc_queue[i].wmq_rxq;
@@ -4585,9 +4587,7 @@
mutex_exit(rxq->rxq_lock);
}
- WM_CORE_LOCK(sc);
sc->sc_core_stopping = false;
- WM_CORE_UNLOCK(sc);
}
static void
@@ -4595,9 +4595,9 @@
{
int i;
- WM_CORE_LOCK(sc);
+ KASSERT(WM_CORE_LOCKED(sc));
+
sc->sc_core_stopping = true;
- WM_CORE_UNLOCK(sc);
for(i = 0; i < sc->sc_nqueues; i++) {
struct wm_rxqueue *rxq = &sc->sc_queue[i].wmq_rxq;
Home |
Main Index |
Thread Index |
Old Index