Date: Wed, 2 Sep 2009 07:47:01 +0200 From: Marc UBM Bocklet <ubm.freebsd@googlemail.com> To: current@freebsd.org Subject: Re: panic: apic_free_vector: Thread already bound. Message-ID: <20090902074701.9a063349.ubm.freebsd@gmail.com> In-Reply-To: <200909010955.33747.jhb@freebsd.org> References: <20090822115958.f93fcf29.ubm.freebsd@gmail.com> <20090831222650.45b6c806.ubm@u-boot-man.de> <3bbf2fe10908311331k3e871898tc36a9846651cc53@mail.gmail.com> <200909010955.33747.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 1 Sep 2009 09:55:33 -0400 John Baldwin <jhb@freebsd.org> wrote: > > Maybe we can ship 8 with a printf() instrad than a panic()? > > Actually, it looks like 'rebooting' is what we want. Try this: > > --- //depot/vendor/freebsd/src/sys/amd64/amd64/local_apic.c > 2009/08/14 21:10:13 ++ > + //depot/user/jhb/acpipci/amd64/amd64/local_apic.c 2009/09/01 > 13:54:23 @@ -990,18 +990,21 @@ > * 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). */ > --- //depot/vendor/freebsd/src/sys/i386/i386/local_apic.c > 2009/08/14 21:10:13 ++ > + //depot/user/jhb/acpipci/i386/i386/local_apic.c 2009/09/01 > 13:53:14 @@ -994,18 +994,21 @@ > * 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). */ I can confirm that this fixes the issue for me. Thanks a lot! :-) Bye Marc
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090902074701.9a063349.ubm.freebsd>