From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Subject: Re: [PATCH 2/3] Input: zforce - enable irq only if we are ready to process it Date: Fri, 17 Jul 2015 14:58:47 -0700 Message-ID: <20150717215847.GD39282@dtor-ws> References: <1436791779-21798-1-git-send-email-dirk.behme@de.bosch.com> <1436791779-21798-2-git-send-email-dirk.behme@de.bosch.com> <20150713170735.GC5039@dtor-ws> <55A4AEEF.4020300@de.bosch.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-pd0-f177.google.com ([209.85.192.177]:33020 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752115AbbGQV6w (ORCPT ); Fri, 17 Jul 2015 17:58:52 -0400 Received: by pdbqm3 with SMTP id qm3so67872043pdb.0 for ; Fri, 17 Jul 2015 14:58:51 -0700 (PDT) Content-Disposition: inline In-Reply-To: <55A4AEEF.4020300@de.bosch.com> Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: "external.Oleksij.Rempel" Cc: Dirk Behme , linux-input@vger.kernel.org Hi Oleksij, On Tue, Jul 14, 2015 at 08:40:47AM +0200, external.Oleksij.Rempel wrote: > Hi Dmitry, > > On 13.07.2015 19:07, Dmitry Torokhov wrote: > >On Mon, Jul 13, 2015 at 02:49:38PM +0200, Dirk Behme wrote: > >>From: Oleksij Rempel > >> > >>If zforce is not ready to process the interrupt, the touchscreen will > >>be lost forever. Make sure we enable the interrupt only if processing > >>is ready. > >> > >>Signed-off-by: Oleksij Rempel > >>Signed-off-by: Dirk Behme > >>--- > >> drivers/input/touchscreen/zforce_ts.c | 7 ++++++- > >> 1 file changed, 6 insertions(+), 1 deletion(-) > >> > >>diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c > >>index 19dc297..a1889e5 100644 > >>--- a/drivers/input/touchscreen/zforce_ts.c > >>+++ b/drivers/input/touchscreen/zforce_ts.c > >>@@ -22,6 +22,7 @@ > >> #include > >> #include > >> #include > >>+#include > >> #include > >> #include > >> #include > >>@@ -741,6 +742,7 @@ static int zforce_probe(struct i2c_client *client, > >> struct zforce_ts *ts; > >> struct input_dev *input_dev; > >> int ret; > >>+ unsigned int irq; > >> if (!pdata) { > >> pdata = zforce_parse_dt(&client->dev); > >>@@ -835,6 +837,7 @@ static int zforce_probe(struct i2c_client *client, > >> init_completion(&ts->command_done); > >>+ irq = client->irq; > >> /* > >> * The zforce pulls the interrupt low when it has data ready. > >> * After it is triggered the isr thread runs until all the available > >>@@ -842,7 +845,8 @@ static int zforce_probe(struct i2c_client *client, > >> * Therefore we can trigger the interrupt anytime it is low and do > >> * not need to limit it to the interrupt edge. > >> */ > >>- ret = devm_request_threaded_irq(&client->dev, client->irq, > >>+ irq_set_status_flags(irq, IRQ_NOAUTOEN); > >Instead of playing with the flags should we simply request irq after we > >release the reset pin? > > Because we should be able to process the interrupt. If i put > request_irq after reset, some times the interrupt can be missed. OK, I see that enabling after reset is racy. But I am still confused why having IRQ enabled while reste pin is asserted results in lost touchscreen. Can you walk me through the sequence of events? Thanks. -- Dmitry