summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2009-09-02 00:39:59 +0000
committerjhb <jhb@FreeBSD.org>2009-09-02 00:39:59 +0000
commit0c6bbf27ef4317844d6905d37adbcadcf4f392cc (patch)
treec5b5894180247fb4ff56e030d824a48437e3a208 /sys/i386
parent008ef8cd3b3a70e55ea6d9679a97a2b162f99ab2 (diff)
downloadFreeBSD-src-0c6bbf27ef4317844d6905d37adbcadcf4f392cc.zip
FreeBSD-src-0c6bbf27ef4317844d6905d37adbcadcf4f392cc.tar.gz
Don't attempt to bind the current thread to the CPU an IRQ is bound to
when removing an interrupt handler from an IRQ during shutdown. During shutdown we are already bound to CPU 0 and this was triggering a panic. MFC after: 3 days
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/local_apic.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/sys/i386/i386/local_apic.c b/sys/i386/i386/local_apic.c
index 5e79aa8..9b1d1b31 100644
--- a/sys/i386/i386/local_apic.c
+++ b/sys/i386/i386/local_apic.c
@@ -994,18 +994,21 @@ apic_free_vector(u_int apic_id, u_int vector, u_int irq)
* we don't lose an interrupt delivery race.
*/
td = curthread;
- thread_lock(td);
- if (sched_is_bound(td))
- panic("apic_free_vector: Thread already bound.\n");
- sched_bind(td, apic_cpuid(apic_id));
- thread_unlock(td);
+ if (!rebooting) {
+ thread_lock(td);
+ if (sched_is_bound(td))
+ panic("apic_free_vector: Thread already bound.\n");
+ sched_bind(td, apic_cpuid(apic_id));
+ thread_unlock(td);
+ }
mtx_lock_spin(&icu_lock);
lapics[apic_id].la_ioint_irqs[vector - APIC_IO_INTS] = -1;
mtx_unlock_spin(&icu_lock);
- thread_lock(td);
- sched_unbind(td);
- thread_unlock(td);
-
+ if (!rebooting) {
+ thread_lock(td);
+ sched_unbind(td);
+ thread_unlock(td);
+ }
}
/* Map an IDT vector (APIC) to an IRQ (interrupt source). */
OpenPOWER on IntegriCloud