Re: [PATCH 1/2] Input: tsc2007 - Disable irq when the irq thread ishandling data

From: Feng Tang
Date: Tue Nov 29 2011 - 21:08:22 EST


Hi Dmitry,

Thanks for the review.

On Tue, 29 Nov 2011 17:22:08 +0800
Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx> wrote:

> Hi Feng,
>
> On Tue, Nov 29, 2011 at 04:12:57PM +0800, Feng Tang wrote:
> > The TSC2007 data sheet say in some case the HW may fire some false
> > interrrupt, which I also met during integrating one TSC2007 device.
> > So add the disable_irq/enable_irq protection around data handling.
>
> IRQF_ONESHOT should prevent IRQ from firing again while thread is
> servicing it. Did you actually observe it not working?

You are right, the tsc's threaded IRQ function is not re-entered, and
the driver is working actually. My bad not stating the problem clearly.
The real problem I want solve is, many platforms including ours use a
GPIO line as the tsc2007's IRQ line, and when these extra tsc2007 IRQ
is triggered on the gpio line, that GPIO controller will fire up extra
noise IRQ accordingly, causing its ISR to be called. And my patch is
trying to let the GPIO controller driver disable that specific IRQ pin
from tsc2007. As disable_irq will call GPIO irq_chip's irq_disable() or
mask() hook.

By grep the tsc2007_platform_data in kernel, I see most of the most of
the tsc2007 platforms are using GPIO line as tsc2007 IRQ ine. So this
should be a general problem.

Following is patch with updated log and comments.

Thanks,
Feng

-----------------