From 6dffd08db7d34e0fdcccc233e063d31fdc794aa7 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Tue, 26 Feb 2008 20:54:04 +0000 Subject: [PATCH] Hopefully this is a good compromise. If more than 99% of the interrupts of a vector are unhandled, it is disabled if it is not a shared interrupt vector (as before). Otherwise a message is printed to indicate the condition. I reduced the amount of interrupts to 10000, as with 100000 it would take over half an hour on my machine to trigger. Feel free to adjust. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24146 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/int.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/system/kernel/int.c b/src/system/kernel/int.c index f640273440..8edba2970c 100644 --- a/src/system/kernel/int.c +++ b/src/system/kernel/int.c @@ -309,16 +309,21 @@ int_io_interrupt_handler(int vector, bool levelTriggered) io_vectors[vector].ignored_count++; } - // disable interrupt when more than 99% are unhandled and this is not a - // shared interrupt - if (io_vectors[vector].trigger_count > 100000 - && !(io_vectors[vector].handler_list.next != NULL - && io_vectors[vector].handler_list.next->next != NULL)) { - if (io_vectors[vector].ignored_count > 99000) { - io_vectors[vector].enable_count = -100; - arch_int_disable_io_interrupt(vector); - dprintf("Disabling unhandled io interrupt %d\n", vector); + if (io_vectors[vector].trigger_count > 10000) { + if (io_vectors[vector].ignored_count > 9900) { + if (io_vectors[vector].handler_list.next == NULL + || io_vectors[vector].handler_list.next->next == NULL) { + // this interrupt vector is not shared, disable it + io_vectors[vector].enable_count = -100; + arch_int_disable_io_interrupt(vector); + dprintf("Disabling unhandled io interrupt %d\n", vector); + } else { + // this is a shared interrupt vector, we cannot just disable it + dprintf("More than 99%% interrupts of vector %d are unhandled\n", + vector); + } } + io_vectors[vector].trigger_count = 0; io_vectors[vector].ignored_count = 0; }