dde_linux: Limit number of merged IRQs

This change makes Irq_context::_handle_one robust against misbehaving
IRQ handlers that always return IRQ_HANDLED, specifically dwc_otg.
This commit is contained in:
Norman Feske 2013-09-12 21:19:04 +02:00
parent 88f635b021
commit 0db203fb75

View File

@ -97,16 +97,19 @@ class Irq_context : public Genode::List<Irq_context>::Element
bool handled = false;
/*
* It might be that the next interrupt triggers right after the device has
* acknowledged the IRQ
* It might be that the next interrupt triggers right after the
* device has acknowledged the IRQ. To reduce per-IRQ context
* switches, we merge up to 'MAX_MERGED_IRQS' calls to the
* interrupt handler.
*/
do {
enum { MAX_MERGED_IRQS = 8 };
for (unsigned i = 0; i < MAX_MERGED_IRQS; i++) {
if (h->handler(_irq, h->dev) != IRQ_HANDLED)
return handled;
break;
handled = true;
} while (true);
}
return handled;
}
/**