lkml.org 
[lkml]   [2009]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch/rfc 1/2] GENIRQ: add handle_threaded_irq() flow handler
On Wed, Mar 18, 2009 at 07:31:22PM +0100, David Brownell wrote:
> 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.

aha, I see. Thanks for the explanation ;-)

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

\
 
 \ /
  Last update: 2009-03-18 19:53    [W:0.200 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site