From b607c8d8ad8a9a7639a87f1bc13821a2294feffa Mon Sep 17 00:00:00 2001 From: scottl Date: Wed, 21 Nov 2007 04:03:51 +0000 Subject: Extend critical section coverage in the low-level interrupt handlers to include the ithread scheduling step. Without this, a preemption might occur in between the interrupt getting masked and the ithread getting scheduled. Since the interrupt handler runs in the context of curthread, the scheudler might see it as having a such a low priority on a busy system that it doesn't get to run for a _long_ time, leaving the interrupt stranded in a disabled state. The only way that the preemption can happen is by a fast/filter handler triggering a schduling event earlier in the handler, so this problem can only happen for cases where an interrupt is being shared by both a fast/filter handler and an ithread handler. Unfortunately, it seems to be common for this sharing to happen with network and USB devices, for example. This fixes many of the mysterious TCP session timeouts and NIC watchdogs that were being reported. Many thanks to Sam Lefler for getting to the bottom of this problem. Reviewed by: jhb, jeff, silby --- sys/powerpc/powerpc/intr_machdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/powerpc') diff --git a/sys/powerpc/powerpc/intr_machdep.c b/sys/powerpc/powerpc/intr_machdep.c index 7daaf23..7653347 100644 --- a/sys/powerpc/powerpc/intr_machdep.c +++ b/sys/powerpc/powerpc/intr_machdep.c @@ -280,7 +280,6 @@ powerpc_dispatch_intr(u_int vector, struct trapframe *tf) sched = 1; } } - critical_exit(); if (sched) { PIC_MASK(pic, i->irq); @@ -289,6 +288,7 @@ powerpc_dispatch_intr(u_int vector, struct trapframe *tf) __func__)); } else PIC_EOI(pic, i->irq); + critical_exit(); #endif return; -- cgit v1.1