if_dwc: Fix a possible interrupt starvation

This commit is contained in:
Sebastian Huber 2015-09-07 08:34:34 +02:00
parent 8c5aecfde3
commit 7f5afa04cd
2 changed files with 16 additions and 18 deletions

View File

@ -1014,15 +1014,14 @@ dwc_intr(void *arg)
}
reg = READ4(sc, DMA_STATUS);
if (reg & DMA_STATUS_NIS) {
if (reg & DMA_STATUS_RI)
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_AIS) {
if (reg & DMA_STATUS_FBI) {
/* Fatal bus error */
device_printf(sc->dev,
@ -1030,9 +1029,7 @@ dwc_intr(void *arg)
dwc_stop_locked(sc);
dwc_init_locked(sc);
}
}
WRITE4(sc, DMA_STATUS, reg & DMA_STATUS_INTR_MASK);
DWC_UNLOCK(sc);
}

View File

@ -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