Re: [PATCH]: use spin_lock_irqsave in try_one_irq()

From: Yong Zhang
Date: Wed Nov 04 2009 - 07:49:46 EST


On Wed, Nov 4, 2009 at 5:18 PM, Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
> On Tue, 3 Nov 2009, Yong Zhang wrote:
>
>> > This happens because the &desc->lock is taken with spin_lock_irqsave and
>> > just a spin_lock. ÂIn the try_one_irq(), this lock really should be a
>> > spin_lock_irqsave().
>> >

>> So I think the following patch is also workable to you.
>
> Yes, that's sufficient.
>
>> diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c
>> index 114e704..11affbc 100644
>> --- a/kernel/irq/spurious.c
>> +++ b/kernel/irq/spurious.c
>> @@ -111,6 +111,7 @@ static void poll_all_shared_irqs(void)
>>
>> Â Â Â for_each_irq_desc(i, desc) {
>> Â Â Â Â Â Â Â unsigned int status;
>> + Â Â Â Â Â Â unsigned long flags;
>>
>> Â Â Â Â Â Â Â if (!i)
>> Â Â Â Â Â Â Â Â Â Â Â Âcontinue;
>> @@ -121,7 +122,9 @@ static void poll_all_shared_irqs(void)
>> Â Â Â Â Â Â Â if (!(status & IRQ_SPURIOUS_DISABLED))
>> Â Â Â Â Â Â Â Â Â Â Â continue;
>>
>> + Â Â Â Â Â Â local_irq_save(flags);
>> Â Â Â Â Â Â Â try_one_irq(i, desc);
>> + Â Â Â Â Â Â local_irq_restore(flags);
>
> ÂYou can even use local_irq_en/disable() here.

Yup, I will resend the patch later.

Thanks,
Yong

>
> Thanks,
>
> Â Â Â Âtglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/