Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci In wm_stop():



details:   https://anonhg.NetBSD.org/src/rev/875a740d2b92
branches:  trunk
changeset: 580499:875a740d2b92
user:      scw <scw%NetBSD.org@localhost>
date:      Tue Apr 26 07:55:17 2005 +0000

description:
In wm_stop():

 - Clear the interrupt mask to ensure the device cannot assert its
   interrupt line.
 - Clear sc->sc_icr to ensure wm_intr() makes no attempt to service any
   currently pending or shared interrupt.

This should address the problem reported in both PR/29903 and PR/22493.
(wm(4) is susceptible to crashing in wm_intr() when the interface is downed)

diffstat:

 sys/dev/pci/if_wm.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r d03b9e843bb0 -r 875a740d2b92 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Tue Apr 26 05:37:45 2005 +0000
+++ b/sys/dev/pci/if_wm.c       Tue Apr 26 07:55:17 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.101 2005/03/19 11:58:03 tron Exp $ */
+/*     $NetBSD: if_wm.c,v 1.102 2005/04/26 07:55:17 scw Exp $  */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.101 2005/03/19 11:58:03 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.102 2005/04/26 07:55:17 scw Exp $");
 
 #include "bpfilter.h"
 #include "rnd.h"
@@ -2840,6 +2840,15 @@
        CSR_WRITE(sc, WMREG_TCTL, 0);
        CSR_WRITE(sc, WMREG_RCTL, 0);
 
+       /*
+        * Clear the interrupt mask to ensure the device cannot assert its
+        * interrupt line.
+        * Clear sc->sc_icr to ensure wm_intr() makes no attempt to service
+        * any currently pending or shared interrupt.
+        */
+       CSR_WRITE(sc, WMREG_IMC, 0xffffffffU);
+       sc->sc_icr = 0;
+
        /* Release any queued transmit buffers. */
        for (i = 0; i < WM_TXQUEUELEN(sc); i++) {
                txs = &sc->sc_txsoft[i];



Home | Main Index | Thread Index | Old Index