public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Woody Suwalski <terraluna977@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>, dmitry.torokhov@gmail.com
Cc: Woody Suwalski <terraluna977@gmail.com>
Subject: [PATCH] mouse_cypress_ps2: Fix 6.11 regression on xps15z
Date: Tue, 27 Aug 2024 19:44:12 -0400	[thread overview]
Message-ID: <a8252e0f-dab4-ef5e-2aa1-407a6f4c7204@gmail.com> (raw)

[-- 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);

             reply	other threads:[~2024-08-27 23:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27 23:44 Woody Suwalski [this message]
2024-08-28  1:10 ` [PATCH] mouse_cypress_ps2: Fix 6.11 regression on xps15z 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

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=a8252e0f-dab4-ef5e-2aa1-407a6f4c7204@gmail.com \
    --to=terraluna977@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-kernel@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