mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-13 21:39:57 +08:00
if_dwc: Fix a possible interrupt starvation
This commit is contained in:
parent
8c5aecfde3
commit
7f5afa04cd
@ -1014,25 +1014,22 @@ dwc_intr(void *arg)
|
||||
}
|
||||
|
||||
reg = READ4(sc, DMA_STATUS);
|
||||
if (reg & DMA_STATUS_NIS) {
|
||||
if (reg & DMA_STATUS_RI)
|
||||
dwc_rxfinish_locked(sc);
|
||||
|
||||
if (reg & DMA_STATUS_TI)
|
||||
dwc_txfinish_locked(sc);
|
||||
}
|
||||
|
||||
if (reg & DMA_STATUS_AIS) {
|
||||
if (reg & DMA_STATUS_FBI) {
|
||||
/* Fatal bus error */
|
||||
device_printf(sc->dev,
|
||||
"Ethernet DMA error, restarting controller.\n");
|
||||
dwc_stop_locked(sc);
|
||||
dwc_init_locked(sc);
|
||||
}
|
||||
}
|
||||
|
||||
WRITE4(sc, DMA_STATUS, reg & DMA_STATUS_INTR_MASK);
|
||||
|
||||
if (reg & (DMA_STATUS_RI | DMA_STATUS_RU))
|
||||
dwc_rxfinish_locked(sc);
|
||||
|
||||
if (reg & DMA_STATUS_TI)
|
||||
dwc_txfinish_locked(sc);
|
||||
|
||||
if (reg & DMA_STATUS_FBI) {
|
||||
/* Fatal bus error */
|
||||
device_printf(sc->dev,
|
||||
"Ethernet DMA error, restarting controller.\n");
|
||||
dwc_stop_locked(sc);
|
||||
dwc_init_locked(sc);
|
||||
}
|
||||
|
||||
DWC_UNLOCK(sc);
|
||||
}
|
||||
|
||||
|
@ -220,6 +220,7 @@
|
||||
#define DMA_STATUS_NIS (1 << 16)
|
||||
#define DMA_STATUS_AIS (1 << 15)
|
||||
#define DMA_STATUS_FBI (1 << 13)
|
||||
#define DMA_STATUS_RU (1 << 7)
|
||||
#define DMA_STATUS_RI (1 << 6)
|
||||
#define DMA_STATUS_TI (1 << 0)
|
||||
#define DMA_STATUS_INTR_MASK 0x1ffff
|
||||
|
Loading…
x
Reference in New Issue
Block a user