Re: [patch/rfc 1/2] GENIRQ: add handle_threaded_irq() flow handler
From: David Brownell
Date: Wed Mar 18 2009 - 14:31:36 EST
On Wednesday 18 March 2009, Felipe Balbi wrote:
> > + action = desc->action;
> > + if (unlikely(!action || (desc->status & IRQ_DISABLED)))
> > + goto out_unlock;
>
> you say below irqs are always enabled
Right here they're always disabled by spin_lock_irq().
The "below" follows spin_unlock_irq(), which re-enables
them to traverse that (locked) action list.
> so this branch is something we
> never want to happen. How about adding a WARN() then ?
When some one says "irqs are enabled" they mean that,
local_irq_disable() or friends have not been called,
so for example a timer or other IRQ could arrive.
The IRQ_DISABLED flag in an IRQ descriptor means
something different: "don't try *handling* this".
That particular check is used in *ALL* flow handlers.
It guards against things like races in disable_irq()
paths, which could allow an IRQ that was in flight
to arrive "after" the IRQ was disabled.
In the case of an IRQ enable/disable mask sitting
across an I2C bus boundary, it's particularly easy
to see how such a race might happen ... since both
the thread masking the IRQ, and the one handling it,
are subject to preemption and scheduling.
--
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/