Re: [BUG] intr_remap: Simplify the code further

From: Yinghai Lu
Date: Fri Oct 29 2010 - 22:56:32 EST


On Fri, Oct 29, 2010 at 6:50 PM, Russ Anderson <rja@xxxxxxx> wrote:
> On Fri, Oct 29, 2010 at 05:37:42PM -0700, Suresh Siddha wrote:
>> On Fri, 2010-10-29 at 15:22 -0700, Russ Anderson wrote:
>> > There is a regression that is causing a NULL pointer dereference
>> > in free_irte when shutting down xpc.  git bisect narrowed it down
>> > to git commit d585d060b42bd36f6f0b23ff327d3b91f80c7139, which
>> > changed free_irte().  Reverse applying the patch fixes the problem.
>> >
>>
>> Russ, Is this with !CONFIG_SPARSE_IRQ?
>
>
> CONFIG_SPARSE_IRQ=y
>

can you try attached patch?

Yinghai
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 5e43502..383f4bb 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -3109,7 +3109,7 @@ void destroy_irq(unsigned int irq)

irq_set_status_flags(irq, IRQ_NOREQUEST|IRQ_NOPROBE);

- if (intr_remapping_enabled)
+ if (irq_remapped(get_irq_chip_data(irq)))
free_irte(irq);
raw_spin_lock_irqsave(&vector_lock, flags);
__clear_irq_vector(irq, cfg);