if_dwc: Fix a possible interrupt starvation

This commit is contained in:
Sebastian Huber 2015-09-07 08:34:34 +02:00
parent 051b634730
commit c07da019f3
2 changed files with 16 additions and 20 deletions

View File

@ -893,17 +893,14 @@ dwc_intr(void *arg)
READ4(sc, SGMII_RGMII_SMII_CTRL_STATUS); READ4(sc, SGMII_RGMII_SMII_CTRL_STATUS);
reg = READ4(sc, DMA_STATUS); reg = READ4(sc, DMA_STATUS);
if (reg & DMA_STATUS_NIS) { WRITE4(sc, DMA_STATUS, reg & DMA_STATUS_INTR_MASK);
if (reg & DMA_STATUS_RI)
if (reg & (DMA_STATUS_RI | DMA_STATUS_RU))
dwc_rxfinish_locked(sc); dwc_rxfinish_locked(sc);
if (reg & DMA_STATUS_TI) { if (reg & DMA_STATUS_TI)
dwc_txfinish_locked(sc); dwc_txfinish_locked(sc);
dwc_txstart_locked(sc);
}
}
if (reg & DMA_STATUS_AIS) {
if (reg & DMA_STATUS_FBI) { if (reg & DMA_STATUS_FBI) {
/* Fatal bus error */ /* Fatal bus error */
device_printf(sc->dev, device_printf(sc->dev,
@ -911,9 +908,7 @@ dwc_intr(void *arg)
dwc_stop_locked(sc); dwc_stop_locked(sc);
dwc_init_locked(sc); dwc_init_locked(sc);
} }
}
WRITE4(sc, DMA_STATUS, reg & DMA_STATUS_INTR_MASK);
DWC_UNLOCK(sc); DWC_UNLOCK(sc);
} }

View File

@ -231,6 +231,7 @@
#define DMA_STATUS_NIS (1 << 16) #define DMA_STATUS_NIS (1 << 16)
#define DMA_STATUS_AIS (1 << 15) #define DMA_STATUS_AIS (1 << 15)
#define DMA_STATUS_FBI (1 << 13) #define DMA_STATUS_FBI (1 << 13)
#define DMA_STATUS_RU (1 << 7)
#define DMA_STATUS_RI (1 << 6) #define DMA_STATUS_RI (1 << 6)
#define DMA_STATUS_TI (1 << 0) #define DMA_STATUS_TI (1 << 0)
#define DMA_STATUS_INTR_MASK 0x1ffff #define DMA_STATUS_INTR_MASK 0x1ffff