svn commit: r214089 - head/sys/dev/sis
Pyun YongHyeon
yongari at FreeBSD.org
Wed Oct 20 00:19:26 UTC 2010
Author: yongari
Date: Wed Oct 20 00:19:25 2010
New Revision: 214089
URL: http://svn.freebsd.org/changeset/base/214089
Log:
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 >
MFC after: 3 days
Modified:
head/sys/dev/sis/if_sis.c
Modified: head/sys/dev/sis/if_sis.c
==============================================================================
--- head/sys/dev/sis/if_sis.c Tue Oct 19 23:57:34 2010 (r214088)
+++ head/sys/dev/sis/if_sis.c Wed Oct 20 00:19:25 2010 (r214089)
@@ -1795,12 +1795,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) )
@@ -1825,11 +1828,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-head
mailing list