mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-14 05:09:34 +08:00
if_dwc: Fix a possible interrupt starvation
This commit is contained in:
parent
051b634730
commit
c07da019f3
@ -893,27 +893,22 @@ dwc_intr(void *arg)
|
||||
READ4(sc, SGMII_RGMII_SMII_CTRL_STATUS);
|
||||
|
||||
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);
|
||||
dwc_txstart_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);
|
||||
}
|
||||
|
||||
|
@ -231,6 +231,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