1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-20 11:11:24 +00:00

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
This commit is contained in:
Pyun YongHyeon 2010-10-20 00:19:25 +00:00
parent d598b626c0
commit 69b5727f16
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=214089

View File

@ -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);
}