[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090318183219.GA20105@scadufax.research.nokia.com>
Date: Wed, 18 Mar 2009 20:32:19 +0200
From: Felipe Balbi <felipe.balbi@...ia.com>
To: ext David Brownell <david-b@...bell.net>
Cc: "Balbi Felipe (Nokia-D/Helsinki)" <felipe.balbi@...ia.com>,
Ingo Molnar <mingo@...e.hu>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
"me@...ipebalbi.com" <me@...ipebalbi.com>,
"dmitry.torokhov@...il.com" <dmitry.torokhov@...il.com>,
"sameo@...nedhand.com" <sameo@...nedhand.com>
Subject: Re: [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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists