summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2015-07-31 09:12:31 +0000
committerhselasky <hselasky@FreeBSD.org>2015-07-31 09:12:31 +0000
commit2e11d7935d8d37d737afe0b8fea3b776e459b12a (patch)
tree2ad014af828b718db56dcbd4f1804469a36c7095
parente9ba3ff9a656a10a4fb04bcb596db3639affb2cd (diff)
downloadFreeBSD-src-2e11d7935d8d37d737afe0b8fea3b776e459b12a.zip
FreeBSD-src-2e11d7935d8d37d737afe0b8fea3b776e459b12a.tar.gz
Limit the number of times we loop inside the DWC OTG poll handler to
avoid starving other fast interrupts. Fix a comment while at it. MFC after: 1 week Suggested by: Svatopluk Kraus <onwahe@gmail.com>
-rw-r--r--sys/dev/usb/controller/dwc_otg.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/usb/controller/dwc_otg.c b/sys/dev/usb/controller/dwc_otg.c
index 51f083b..bd3e51b 100644
--- a/sys/dev/usb/controller/dwc_otg.c
+++ b/sys/dev/usb/controller/dwc_otg.c
@@ -2551,12 +2551,18 @@ static void
dwc_otg_interrupt_poll_locked(struct dwc_otg_softc *sc)
{
struct usb_xfer *xfer;
+ uint32_t count = 0;
uint32_t temp;
uint8_t got_rx_status;
uint8_t x;
repeat:
- /* get all channel interrupts */
+ if (++count == 16) {
+ /* give other interrupts a chance */
+ DPRINTF("Yield\n");
+ return;
+ }
+ /* get all host channel interrupts */
for (x = 0; x != sc->sc_host_ch_max; x++) {
temp = DWC_OTG_READ_4(sc, DOTG_HCINT(x));
if (temp != 0) {
OpenPOWER on IntegriCloud