mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04: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:
parent
d598b626c0
commit
69b5727f16
1 changed files with 9 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue