Re: [PATCH 1/3] wm97xx-core: Only schedule interrupt handler ifnot already scheduled

From: Dmitry Torokhov
Date: Tue Apr 15 2008 - 09:02:54 EST


On Tue, Apr 15, 2008 at 09:48:19AM +0100, Mark Brown wrote:
> On Mon, Apr 14, 2008 at 02:10:02PM -0400, Dmitry Torokhov wrote:
> > On Mon, Apr 14, 2008 at 06:39:33PM +0100, Mark Brown wrote:
>
> > > + if (!work_pending(&wm->pen_event_work)) {
> > > + wm->mach_ops->irq_enable(wm, 0);
> > > + queue_work(wm->ts_workq, &wm->pen_event_work);
> > > + }
>
> > Given the fact that work will not be queued if it is pending anyway
> > why is this change needed?
>
> As well as not queuing the work it ensures that the calls to
> irq_enable() are balanced which helps with implementing that operation.

Hmm... another question then - what would fire up wm97xx_pen_interrupt()
again, before wm97xx_pen_irq_worker had a chance to run, if the very
first thing we do after getting interrupt is irq_enable(wm, 0)?

--
Dmitry
--
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/