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.
This commit is contained in:
2026-05-04 00:58:15 +01:00
parent bbd0bd0ffd
commit cfd5d30f74
3 changed files with 15 additions and 0 deletions
@@ -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(());
+1
View File
@@ -0,0 +1 @@
../../../local/patches/base/P3-ps2d-mouse-resend.patch
+1
View File
@@ -25,6 +25,7 @@ patches = [
"P9-fix-so-pecred.patch", "P9-fix-so-pecred.patch",
"P3-inputd-keymap-bridge.patch", "P3-inputd-keymap-bridge.patch",
"P3-ps2d-led-feedback.patch", "P3-ps2d-led-feedback.patch",
"P3-ps2d-mouse-resend.patch",
"P3-usbhidd-hardening.patch", "P3-usbhidd-hardening.patch",
"P3-init-colored-output.patch", "P3-init-colored-output.patch",
"P4-logd-persistent-logging.patch", "P4-logd-persistent-logging.patch",