From: Daniel Mack <daniel@caiaq.de>
To: linux-input@vger.kernel.org
Cc: Daniel Mack <daniel@caiaq.de>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>
Subject: [PATCH] input: eeti_ts: cancel pending work when going to suspend
Date: Tue, 13 Apr 2010 20:31:45 +0200 [thread overview]
Message-ID: <1271183505-28133-1-git-send-email-daniel@caiaq.de> (raw)
This fixes a race between the suspend code and input events.
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/input/touchscreen/eeti_ts.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c
index 204b8a1..2a01695 100644
--- a/drivers/input/touchscreen/eeti_ts.c
+++ b/drivers/input/touchscreen/eeti_ts.c
@@ -250,6 +250,9 @@ static int eeti_ts_suspend(struct i2c_client *client, pm_message_t mesg)
if (device_may_wakeup(&client->dev))
enable_irq_wake(priv->irq);
+ disable_irq(priv->irq);
+ cancel_work_sync(&priv->work);
+
return 0;
}
@@ -260,6 +263,10 @@ static int eeti_ts_resume(struct i2c_client *client)
if (device_may_wakeup(&client->dev))
disable_irq_wake(priv->irq);
+ /* If we have active users, read the events once to arm the IRQ */
+ if (priv->input->users)
+ eeti_ts_read(&priv->work);
+
return 0;
}
#else
--
1.7.0.3
next reply other threads:[~2010-04-13 18:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-13 18:31 Daniel Mack [this message]
2010-04-14 18:14 ` [PATCH] input: eeti_ts: cancel pending work when going to suspend Dmitry Torokhov
2010-04-19 14:15 ` Daniel Mack
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1271183505-28133-1-git-send-email-daniel@caiaq.de \
--to=daniel@caiaq.de \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).