From 9b84f07357819d3ae007af3068e2a9f6c3ee265c Mon Sep 17 00:00:00 2001 From: Randall Stewart Date: Fri, 22 Jan 2010 14:25:17 +0000 Subject: [PATCH] This hopefully will fix the network problem I was seeing. Basically the msg ring interrupt was being re-enabled inside a spinlock as the thread set it self up for rescheduling. This won't work since inside the re-enable is another spin lock.. which means on return from the reenable the interrupts have been reenabled. Thus you would get a clock int and end up panicing holding a spin lock to long :-o --- sys/mips/rmi/xlr_machdep.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/mips/rmi/xlr_machdep.c b/sys/mips/rmi/xlr_machdep.c index 80827b57bafb..108d2e837fbe 100644 --- a/sys/mips/rmi/xlr_machdep.c +++ b/sys/mips/rmi/xlr_machdep.c @@ -618,18 +618,14 @@ msgring_process_fast_intr(void *arg) */ disable_msgring_int(NULL); it->i_pending = 1; + thread_lock(td); if (TD_AWAITING_INTR(td)) { - thread_lock(td); CTR3(KTR_INTR, "%s: schedule pid %d (%s)", __func__, p->p_pid, p->p_comm); TD_CLR_IWAIT(td); sched_add(td, SRQ_INTR); - thread_unlock(td); - } else { - CTR4(KTR_INTR, "%s: pid %d (%s): state %d", - __func__, p->p_pid, p->p_comm, td->td_state); } - + thread_unlock(td); } #define MIT_DEAD 4 @@ -668,13 +664,17 @@ msgring_process(void *arg) atomic_store_rel_int(&ithd->i_pending, 0); xlr_msgring_handler(NULL); } + enable_msgring_int(NULL); if (!ithd->i_pending && !(ithd->i_flags & MIT_DEAD)) { thread_lock(td); + if (ithd->i_pending) { + thread_unlock(td); + continue; + } sched_class(td, PRI_ITHD); TD_SET_IWAIT(td); - thread_unlock(td); - enable_msgring_int(NULL); mi_switch(SW_VOL, NULL); + thread_unlock(td); } }