stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] Input: atmel_mxt_ts - Fix lost interrupts
@ 2020-12-01 12:30 Linus Walleij
  2020-12-01 17:56 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Linus Walleij @ 2020-12-01 12:30 UTC (permalink / raw)
  To: Dmitry Torokhov, linux-input
  Cc: Linus Walleij, Andre Müller, Nick Dyer, Jiada Wang, stable

After commit 74d905d2d38a devices requiring the workaround
for edge triggered interrupts stopped working.

The hardware needs the quirk to be used before even
proceeding to check if the quirk is needed because
mxt_acquire_irq() is called before mxt_check_retrigen()
is called and at this point pending IRQs need to be
checked, and if the workaround is not active, all
interrupts will be lost from this point.

Solve this by switching the calls around.

Cc: Andre Müller <andre.muller@web.de>
Cc: Nick Dyer <nick.dyer@itdev.co.uk>
Cc: Jiada Wang <jiada_wang@mentor.com>
Cc: stable@vger.kernel.org
Reported-by: Andre Müller <andre.muller@web.de>
Tested-by: Andre Müller <andre.muller@web.de>
Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Fixes: 74d905d2d38a ("Input: atmel_mxt_ts - only read messages in mxt_acquire_irq() when necessary")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v2->v3:
- Make the simpler fix suggested by Dmitry.
- Collect Andre's Tested-by.
ChangeLog v1->v2:
- Explicitly disable the retrig workaround also if the
  IRQ descriptor says we have a level triggered interrupt.
- Drop the second explicit assigning of "true" to the
  use_retrigen_workaround bool, it is already enabled.
- Augment debug text to say that we leave it enabled
  rather than enable it.
---
 drivers/input/touchscreen/atmel_mxt_ts.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index e34984388791..109655547477 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -2185,11 +2185,11 @@ static int mxt_initialize(struct mxt_data *data)
 		msleep(MXT_FW_RESET_TIME);
 	}
 
-	error = mxt_acquire_irq(data);
+	error = mxt_check_retrigen(data);
 	if (error)
 		return error;
 
-	error = mxt_check_retrigen(data);
+	error = mxt_acquire_irq(data);
 	if (error)
 		return error;
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] Input: atmel_mxt_ts - Fix lost interrupts
  2020-12-01 12:30 [PATCH v3] Input: atmel_mxt_ts - Fix lost interrupts Linus Walleij
@ 2020-12-01 17:56 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2020-12-01 17:56 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-input, Andre Müller, Nick Dyer, Jiada Wang, stable

On Tue, Dec 01, 2020 at 01:30:26PM +0100, Linus Walleij wrote:
> After commit 74d905d2d38a devices requiring the workaround
> for edge triggered interrupts stopped working.
> 
> The hardware needs the quirk to be used before even
> proceeding to check if the quirk is needed because
> mxt_acquire_irq() is called before mxt_check_retrigen()
> is called and at this point pending IRQs need to be
> checked, and if the workaround is not active, all
> interrupts will be lost from this point.
> 
> Solve this by switching the calls around.
> 
> Cc: Andre Müller <andre.muller@web.de>
> Cc: Nick Dyer <nick.dyer@itdev.co.uk>
> Cc: Jiada Wang <jiada_wang@mentor.com>
> Cc: stable@vger.kernel.org
> Reported-by: Andre Müller <andre.muller@web.de>
> Tested-by: Andre Müller <andre.muller@web.de>
> Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Fixes: 74d905d2d38a ("Input: atmel_mxt_ts - only read messages in mxt_acquire_irq() when necessary")
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Applied, thank you.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-01 17:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-01 12:30 [PATCH v3] Input: atmel_mxt_ts - Fix lost interrupts Linus Walleij
2020-12-01 17:56 ` Dmitry Torokhov

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).