lkml.org 
[lkml]   [2016]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] genirq: fix trigger flags check for shared irqs
Hi Thomas,

Thanks for taking a look at this.

On Tue, Jan 26, 2016 at 09:45:32PM +0100, Thomas Gleixner wrote:
>On Tue, 26 Jan 2016, Brian Starkey wrote:
>
>> For shared interrupts, if one requester passes in any IRQF_TRIGGER_*
>> flags whilst another doesn't, __setup_irq() can erroneously fail.
>>
>> The no-flags case should be treated as "already configured", so change
>> __setup_irq() to only check that the flags match if any have been
>> provided.
>
>What happens if that "already configured", i.e. the default setting, is
>conflicting with the newly requested interrupt?
>
>I rather prefer the failure than the resulting silent wreckage.
>

Yes, I agree that would be best avoided. It seems to me that this case
is actually handled a bit lower down:

} else if (new->flags & IRQF_TRIGGER_MASK) {
unsigned int nmsk = new->flags & IRQF_TRIGGER_MASK;
unsigned int omsk = irq_settings_get_trigger_mask(desc);

if (nmsk != omsk)
/* hope the handler works with current trigger mode */
pr_warning("irq %d uses trigger mode %u; requested %u\n",
irq, nmsk, omsk);
}

Perhaps that should be louder/fatal?

Best regards,

-Brian

>Thanks,
>
> tglx
>

\
 
 \ /
  Last update: 2016-01-28 11:41    [W:1.794 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site