From cfd5d30f749510d7970021164981fcc0c1fbc543 Mon Sep 17 00:00:00 2001 From: Vasilito Date: Mon, 4 May 2026 00:58:15 +0100 Subject: [PATCH] fix: handle PS/2 mouse RESEND (0xFE) response during init MouseTx::handle() treated 0xFE (PS/2 RESEND) as an unknown response, causing mouse init to fail on hardware where the mouse requests a resend during the reset/command exchange. Now resends the current command byte when the mouse returns 0xFE, matching the PS/2 protocol. --- local/patches/base/P3-ps2d-mouse-resend.patch | 13 +++++++++++++ recipes/core/base/P3-ps2d-mouse-resend.patch | 1 + recipes/core/base/recipe.toml | 1 + 3 files changed, 15 insertions(+) create mode 100644 local/patches/base/P3-ps2d-mouse-resend.patch create mode 120000 recipes/core/base/P3-ps2d-mouse-resend.patch diff --git a/local/patches/base/P3-ps2d-mouse-resend.patch b/local/patches/base/P3-ps2d-mouse-resend.patch new file mode 100644 index 00000000..4bd5b2f0 --- /dev/null +++ b/local/patches/base/P3-ps2d-mouse-resend.patch @@ -0,0 +1,13 @@ +--- a/drivers/input/ps2d/src/mouse.rs 2026-05-04 00:50:32.328708003 +0100 ++++ b/drivers/input/ps2d/src/mouse.rs 2026-05-04 00:50:46.622536346 +0100 +@@ -61,6 +61,10 @@ + if data == 0xFA { + self.write_i += 1; + self.try_write(ps2)?; ++ } else if data == 0xFE { ++ // PS/2 RESEND: mouse asks us to resend the current command byte ++ log::debug!("mouse requested resend for byte {:02X}, resending", self.write.get(self.write_i).unwrap_or(&0)); ++ self.try_write(ps2)?; + } else { + log::error!("unknown mouse response {:02X}", data); + return Err(()); diff --git a/recipes/core/base/P3-ps2d-mouse-resend.patch b/recipes/core/base/P3-ps2d-mouse-resend.patch new file mode 120000 index 00000000..d30b4d96 --- /dev/null +++ b/recipes/core/base/P3-ps2d-mouse-resend.patch @@ -0,0 +1 @@ +../../../local/patches/base/P3-ps2d-mouse-resend.patch \ No newline at end of file diff --git a/recipes/core/base/recipe.toml b/recipes/core/base/recipe.toml index 5f4ca147..1b127973 100644 --- a/recipes/core/base/recipe.toml +++ b/recipes/core/base/recipe.toml @@ -25,6 +25,7 @@ patches = [ "P9-fix-so-pecred.patch", "P3-inputd-keymap-bridge.patch", "P3-ps2d-led-feedback.patch", + "P3-ps2d-mouse-resend.patch", "P3-usbhidd-hardening.patch", "P3-init-colored-output.patch", "P4-logd-persistent-logging.patch",