svn commit: r214232 - stable/7/sys/dev/sis

Pyun YongHyeon yongari at FreeBSD.org
Sat Oct 23 00:44:17 UTC 2010


Author: yongari
Date: Sat Oct 23 00:44:16 2010
New Revision: 214232
URL: http://svn.freebsd.org/changeset/base/214232

Log:
  MFC r214089:
    Correct handling of shared interrupt in sis_intr(). r212116 incorrectly
    released a drver lock for shared interrupt case such that it caused
    panic. While I'm here check whether driver is still running before
    serving TX/RX handler.
  
    Reported by:	Jerahmy Pocott < QUAKENET1 <> optusnet dot com dot au >
    Tested by:	Jerahmy Pocott < QUAKENET1 <> optusnet dot com dot au >

Modified:
  stable/7/sys/dev/sis/if_sis.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/sis/if_sis.c
==============================================================================
--- stable/7/sys/dev/sis/if_sis.c	Sat Oct 23 00:41:26 2010	(r214231)
+++ stable/7/sys/dev/sis/if_sis.c	Sat Oct 23 00:44:16 2010	(r214232)
@@ -1791,12 +1791,15 @@ sis_intr(void *arg)
 	if ((status & SIS_INTRS) == 0) {
 		/* Not ours. */
 		SIS_UNLOCK(sc);
+		return;
 	}
 
 	/* Disable interrupts. */
 	CSR_WRITE_4(sc, SIS_IER, 0);
 
 	for (;(status & SIS_INTRS) != 0;) {
+		if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+			break;
 		if (status &
 		    (SIS_ISR_TX_DESC_OK | SIS_ISR_TX_ERR |
 		    SIS_ISR_TX_OK | SIS_ISR_TX_IDLE) )
@@ -1821,11 +1824,13 @@ sis_intr(void *arg)
 		status = CSR_READ_4(sc, SIS_ISR);
 	}
 
-	/* Re-enable interrupts. */
-	CSR_WRITE_4(sc, SIS_IER, 1);
+	if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
+		/* Re-enable interrupts. */
+		CSR_WRITE_4(sc, SIS_IER, 1);
 
-	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
-		sis_startl(ifp);
+		if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
+			sis_startl(ifp);
+	}
 
 	SIS_UNLOCK(sc);
 }


More information about the svn-src-stable-7 mailing list