login
Header Space

 
 

[PATCH 30/37] Input: wm97xx-core - only schedule interrupt handler if not already scheduled

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <unlisted-recipients@...>, <@...>
Cc: <linux-kernel@...>, <jkosina@...>, <akpm@...>
Date: Thursday, April 17, 2008 - 9:24 am

As well as clarifying the fact that the driver can cope if a second
interrupt occurs before the IRQ work is scheduled this also ensures
that calls to the machine irq_enable() are balanced, making that easier
to implement.  Normally this is redundant due to the interrupt disabling
but some unusal board configurations can trigger it.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
 drivers/input/touchscreen/wm97xx-core.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c
index 2910999..e27b1e0 100644
--- a/drivers/input/touchscreen/wm97xx-core.c
+++ b/drivers/input/touchscreen/wm97xx-core.c
@@ -328,18 +328,18 @@ static void wm97xx_pen_irq_worker(struct work_struct *work)
  *
  * We have to disable the codec interrupt in the handler because it
  * can take upto 1ms to clear the interrupt source. We schedule a task
- * in a work queue to do the actual interaction with the chip (it
- * doesn't matter if we end up reenqueing it before it is executed
- * since we don't touch the chip until it has run).  The interrupt is
- * then enabled again in the slow handler when the source has been
- * cleared.
+ * in a work queue to do the actual interaction with the chip.  The
+ * interrupt is then enabled again in the slow handler when the source
+ * has been cleared.
  */
 static irqreturn_t wm97xx_pen_interrupt(int irq, void *dev_id)
 {
 	struct wm97xx *wm = dev_id;
 
-	wm->mach_ops->irq_enable(wm, 0);
-	queue_work(wm->ts_workq, &wm->pen_event_work);
+	if (!work_pending(&wm->pen_event_work)) {
+		wm->mach_ops->irq_enable(wm, 0);
+		queue_work(wm->ts_workq, &wm->pen_event_work);
+	}
 
 	return IRQ_HANDLED;
 }
-- 
1.5.5.rc2.6.gf58d


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/37] Input queue for 2.6.26 merge window, Dmitry Torokhov, (Mon Apr 21, 9:14 am)
Re: [PATCH 00/37] Input queue for 2.6.26 merge window, Henrique de Moraes Holschuh..., (Mon Apr 21, 11:11 am)
Re: [PATCH 00/37] Input queue for 2.6.26 merge window, Dmitry Torokhov, (Mon Apr 21, 11:44 am)
Re: [PATCH 00/37] Input queue for 2.6.26 merge window, Henrique de Moraes Holschuh..., (Mon Apr 21, 12:58 pm)
[PATCH 28/37] Input: add Zhen Hua driver, Martin Kebert, (Mon Mar 10, 8:40 am)
[PATCH 10/37] Input: tosakbd - fix suspend, Dmitry Baryshkov, (Wed Apr 2, 11:22 am)
[PATCH 35/37] Input: bf54x-keys - add infrastructure for key..., Michael Hennerich, (Fri Apr 18, 12:25 am)
[PATCH 19/37] Input: xpad - don't use GFP_ATOMIC, Oliver Neukum, (Thu Apr 3, 4:19 pm)
[PATCH 30/37] Input: wm97xx-core - only schedule interrupt h..., Mark Brown, (Thu Apr 17, 9:24 am)
[PATCH 29/37] Input: fix ordering in joystick Makefile, Jiri Kosina, (Mon Mar 10, 8:43 am)
Re: [PATCH 29/37] Input: fix ordering in joystick Makefile, Dmitry Torokhov, (Mon Apr 21, 11:39 am)
Re: [PATCH 29/37] Input: fix ordering in joystick Makefile, Dmitry Torokhov, (Mon Apr 21, 12:20 pm)
[PATCH 24/37] Input: omap-keypad - fix build warning, David Brownell, (Tue Apr 15, 1:31 am)
[PATCH 22/37] Input: add PS/2 serio driver for AVR32 devices, Hans-Christian Egtvedt, (Tue Apr 15, 1:30 am)
Re: [PATCH 22/37] Input: add PS/2 serio driver for AVR32 dev..., Hans-Christian Egtvedt, (Mon Apr 21, 9:33 am)
[PATCH 23/37] Input: gpio_keys - irq handling cleanup, David Brownell, (Tue Apr 15, 1:31 am)
[PATCH 13/37] Input: xpad - fix inverted Y and RY axes, Anssi Hannula, (Thu Apr 3, 4:18 pm)
speck-geostationary