[rtems-libbsd commit] if_dwc: Fix a possible interrupt starvation
Sebastian Huber
sebh at rtems.org
Fri Sep 11 09:52:12 UTC 2015
Module: rtems-libbsd
Branch: master
Commit: 7f5afa04cdff28fa2afa6e7df1c2f88289e0f4ac
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=7f5afa04cdff28fa2afa6e7df1c2f88289e0f4ac
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Mon Sep 7 08:34:34 2015 +0200
if_dwc: Fix a possible interrupt starvation
---
freebsd/sys/dev/dwc/if_dwc.c | 27 ++++++++++++---------------
freebsd/sys/dev/dwc/if_dwc.h | 1 +
2 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/freebsd/sys/dev/dwc/if_dwc.c b/freebsd/sys/dev/dwc/if_dwc.c
index 359226d..a3716a1 100644
--- a/freebsd/sys/dev/dwc/if_dwc.c
+++ b/freebsd/sys/dev/dwc/if_dwc.c
@@ -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);
+ WRITE4(sc, DMA_STATUS, reg & DMA_STATUS_INTR_MASK);
- if (reg & DMA_STATUS_TI)
- dwc_txfinish_locked(sc);
- }
+ if (reg & (DMA_STATUS_RI | DMA_STATUS_RU))
+ dwc_rxfinish_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);
- }
+ 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);
}
- WRITE4(sc, DMA_STATUS, reg & DMA_STATUS_INTR_MASK);
DWC_UNLOCK(sc);
}
diff --git a/freebsd/sys/dev/dwc/if_dwc.h b/freebsd/sys/dev/dwc/if_dwc.h
index aa5c973..2ba9860 100644
--- a/freebsd/sys/dev/dwc/if_dwc.h
+++ b/freebsd/sys/dev/dwc/if_dwc.h
@@ -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
More information about the vc
mailing list