]> git.baikalelectronics.ru Git - kernel.git/commit
Input: wm831x-ts - fix races with IRQ management
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 28 Apr 2011 06:08:34 +0000 (23:08 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 28 Apr 2011 06:12:12 +0000 (23:12 -0700)
commita4fe9424bfca011d385b63d462a43c0147db2c21
tree23fb800e00acd2142ed8e4da2df9361de3397084
parent64d7415f9fdbcea16f962bbdae4864ddf6de8ca4
Input: wm831x-ts - fix races with IRQ management

If the WM831x pen down and data IRQs run in parallel it is possible for the
data and pen down IRQs to deadlock themselves as one is part way through
disabling its operation while the other is part way through enabling. Fix
this by always disabling the pen down interrupt while data is active and
vice versa.  When a changeover is required we disable the IRQ that is to
be stopped then schedule work that will enable the new IRQ.

We need to handle the data flow in the data IRQ as the readback from the
device needs to be ordered correctly with the IRQ for robust operation.

This also fixes an issue when using the built in IRQs due to enable_irq()
not being valid from interrupt context on an interrupt controller with bus
operations like the built in IRQ controller - this issue may also have
affected other interrupt controllers.  We can't rely on having the data
and pen down IRQs available via GPIOs on the CPU on every system.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/touchscreen/wm831x-ts.c