public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mouse_cypress_ps2: Fix 6.11 regression on xps15z
@ 2024-08-27 23:44 Woody Suwalski
  2024-08-28  1:10 ` Dmitry Torokhov
  0 siblings, 1 reply; 6+ messages in thread
From: Woody Suwalski @ 2024-08-27 23:44 UTC (permalink / raw)
  To: LKML, dmitry.torokhov; +Cc: Woody Suwalski

[-- Attachment #1: Type: text/plain, Size: 1735 bytes --]

Kernel 6.11 rcN on Dell XPS 15Z:  touch pad has stopped working after 
the patch

commit 8bccf667f62a2351fd0b2a2fe5ba90806702c048
Author: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date:   Fri Jun 28 15:47:25 2024 -0700

     Input: cypress_ps2 - report timeouts when reading command status

It seems that the first communication is with an invalid packet of 3 
NULLs, and that
status failure used to be ignored. With the above patch it is now 
returning an error and
that results in a dead touch pad.

The fix is to stop flagging an error for 3-byte null packets, just keep 
ignoring them as before.
[    2.338016] [    T591] err: Command 0x00 response data (0x): 00 00 00
[    2.338032] [    T591] ok: Command 0x00 response data (0x): 33 cc a2
...
[    2.770029] [    T591] ok: Command 0x00 response data (0x): 33 cc a2
[    2.998030] [    T591] ok: Command 0x11 response data (0x): 01 00 64

Signed-off-by: Woody Suwalski <terraluna977@gmail.com>
---
diff --git a/drivers/input/mouse/cypress_ps2.c 
b/drivers/input/mouse/cypress_ps2.c
index b3c34ebcc4ef..d09272f2fed2 100644
--- a/drivers/input/mouse/cypress_ps2.c
+++ b/drivers/input/mouse/cypress_ps2.c
@@ -115,8 +115,10 @@ static int cypress_ps2_read_cmd_status(struct 
psmouse *psmouse,
      if (!wait_event_timeout(ps2dev->wait,
                  psmouse->pktcnt >= pktsize,
                  msecs_to_jiffies(CYTP_CMD_TIMEOUT))) {
-        rc = -ETIMEDOUT;
-        goto out;
+        if (!(pktsize == 3 && param[0] == 0 && param[1] == 0 )) {
+            rc = -ETIMEDOUT;
+            goto out;
+        }
      }

      memcpy(param, psmouse->packet, pktsize);


[-- Attachment #2: xps_touchpad_fix.patch --]
[-- Type: text/x-patch, Size: 588 bytes --]

diff --git a/drivers/input/mouse/cypress_ps2.c b/drivers/input/mouse/cypress_ps2.c
index b3c34ebcc4ef..d09272f2fed2 100644
--- a/drivers/input/mouse/cypress_ps2.c
+++ b/drivers/input/mouse/cypress_ps2.c
@@ -115,8 +115,10 @@ static int cypress_ps2_read_cmd_status(struct psmouse *psmouse,
 	if (!wait_event_timeout(ps2dev->wait,
 				psmouse->pktcnt >= pktsize,
 				msecs_to_jiffies(CYTP_CMD_TIMEOUT))) {
-		rc = -ETIMEDOUT;
-		goto out;
+		if (!(pktsize == 3 && param[0] == 0 && param[1] == 0 )) {
+			rc = -ETIMEDOUT;
+			goto out;
+		}
 	}
 
 	memcpy(param, psmouse->packet, pktsize);

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

end of thread, other threads:[~2024-08-29  2:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-27 23:44 [PATCH] mouse_cypress_ps2: Fix 6.11 regression on xps15z Woody Suwalski
2024-08-28  1:10 ` Dmitry Torokhov
2024-08-28  2:46   ` Woody Suwalski
2024-08-28 19:15     ` Dmitry Torokhov
2024-08-28 20:57       ` Dmitry Torokhov
2024-08-29  2:18         ` Woody Suwalski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox