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 a bug that LSC's interrupt storm occured whe...



details:   https://anonhg.NetBSD.org/src/rev/286eb0fbc15c
branches:  trunk
changeset: 811018:286eb0fbc15c
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Oct 08 09:28:13 2015 +0000

description:
Fix a bug that LSC's interrupt storm occured when MSI-X is used.
It was observed only on 82575.

diffstat:

 sys/dev/pci/if_wm.c |  14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diffs (40 lines):

diff -r 7513b9f6432a -r 286eb0fbc15c sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Thu Oct 08 08:22:54 2015 +0000
+++ b/sys/dev/pci/if_wm.c       Thu Oct 08 09:28:13 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.350 2015/09/30 04:28:04 msaitoh Exp $      */
+/*     $NetBSD: if_wm.c,v 1.351 2015/10/08 09:28:13 msaitoh Exp $      */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.350 2015/09/30 04:28:04 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.351 2015/10/08 09:28:13 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -6715,18 +6715,14 @@
 wm_linkintr_msix(void *arg)
 {
        struct wm_softc *sc = arg;
+       uint32_t reg;
 
        DPRINTF(WM_DEBUG_TX,
            ("%s: LINK: got link intr\n", device_xname(sc->sc_dev)));
 
-       if (sc->sc_type == WM_T_82574)
-               CSR_WRITE(sc, WMREG_IMC, ICR_OTHER); /* 82574 only */
-       else if (sc->sc_type == WM_T_82575)
-               CSR_WRITE(sc, WMREG_EIMC, EITR_OTHER);
-       else
-               CSR_WRITE(sc, WMREG_EIMC, 1 << WM_MSIX_LINKINTR_IDX);
+       reg = CSR_READ(sc, WMREG_ICR);
        WM_TX_LOCK(sc);
-       if (sc->sc_stopping)
+       if ((sc->sc_stopping) || ((reg & ICR_LSC) == 0))
                goto out;
 
        WM_EVCNT_INCR(&sc->sc_ev_linkintr);



Home | Main Index | Thread Index | Old Index