ISR may be called with interrupts enabled (Was:"Use of IRQF_DISABLED along with IRQF_SHARED")

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Was wondering if I did not frame my question appropriately? Or it there a better place to discuss this?

Thanks,

Rajat

> 
> This is regarding the following code in kernel/irq/handle.c. Consider
> the case of a shared IRQ line, where two handlers are registered such
> that first handler does not specify IRQF_DISABLED, but the second one
> does. But it seems both the handlers will be called IRQs ENABLED
> (which is certainly not what the second handler expects).    
> 
> I also checked but could not find anything that stops me from
> registering two shared ISRs - one with IRQF_DISABLED & another
> without this flag. Am I missing something here?  
> 
> irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction
> *action) {
>     irqreturn_t ret, retval = IRQ_NONE;
>     unsigned int status = 0;
> 
>     handle_dynamic_tick(action);
> 
>     if (!(action->flags & IRQF_DISABLED))
>         local_irq_enable_in_hardirq();
> 
>     do {
>         ret = action->handler(irq, action->dev_id);
>         if (ret == IRQ_HANDLED)
>             status |= action->flags;
>         retval |= ret;
>         action = action->next;
>     } while (action);
> 
>     if (status & IRQF_SAMPLE_RANDOM)
>         add_interrupt_randomness(irq);
>     local_irq_disable();
> 
>     return retval;
> }
> 
> Thanks,
> 
> Rajat


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux