Module Name:    src
Committed By:   msaitoh
Date:           Thu Oct  8 09:28:14 UTC 2015

Modified Files:
        src/sys/dev/pci: if_wm.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.350 -r1.351 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.350 src/sys/dev/pci/if_wm.c:1.351
--- src/sys/dev/pci/if_wm.c:1.350	Wed Sep 30 04:28:04 2015
+++ src/sys/dev/pci/if_wm.c	Thu Oct  8 09:28:13 2015
@@ -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 @@ static int
 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);

Reply via email to