Repository navigation
HID: spi-hid-apple: stop status mismatches on boot and suspend - #222
chriskearney merged 1 commit into
Conversation
38d4f08 to
cb0f94f
Compare
|
Tested on a J313 (M1 Air): removes both status mismatches, at boot and around suspend, and input works straight after a real wake. No regressions found.
Real lid-close sleep (70 s, keypress wake): keyboard, pointer and trackpad click with haptic feedback all worked straight away. No mismatch or resume warnings were logged. How this was tested
|
cb0f94f to
be9b631
Compare
The shared SPI HID controller logs "status message mismatch" once at boot and once on every s2idle cycle. The keyboard, the trackpad, and actuator 001C:05AC:0281 share that transport, so each line is one transfer. At boot the actuator probe sends feature report 0x21. The J313 SPI actuator descriptor has input 0x3f and output 0x53 only, and the controller answers 9c 17 e5 f8. Report 0x21 is the MTP host-mode switch. Skip it when the device has no such report. The SPI actuator powers up device-controlled, which is the state probe asks for. On suspend, input core turns lit LEDs off. NumLock is on, so that queues one output report on the non-freezable system workqueue. The SPI parent then cuts controller power and the late write reads 00 00 00 00. Flush the keyboard and trackpad LED workers while the controller is still up, refuse new transfers once it is down, and on resume wait for boot packet a0 80 00 00 before returning. spi-hid-apple-of.c is unchanged. Any other bad status word still warns. Signed-off-by: Lucas Goossen <lucas.goossen@hey.com>
be9b631 to
ca049aa
Compare
chriskearney
left a comment
There was a problem hiding this comment.
Reviewed exact head ca049aab7efe23908179be0d701026613f160e59, both changed files and current HID/IRQ/probe/suspend/remove callers. Source/host PASS subject to required CI and full MQ. The existing J313 physical-test driver area is byte-identical to the effective merge; this is component binding, not a new full-cohort hardware run.
Exact power-gate/wait/wake controls pass six scenarios across three runs, including a pending boot IRQ, BOOT waiters, timeout releasing waiters, OFF refusal and an in-flight transfer. Four semantic mutants are caught. The unsupported 0x21 report is skipped without changing the old successful caller return; LED work is flushed before power-off, and resume waits for the existing probe boot packet before admitting writes. CI/QEMU is not input or suspend qualification.
Nonblocking details remain explicit: use HID_CLAIMED_INPUT rather than the numerically identical HID_CONNECT_HIDINPUT for the claimed-bit test. OFF-before-destroy also refuses child teardown mode-switch writes; with opt-in host haptics on an actuator supporting 0x21, device mode is not restored until the next probe. All SPI-HID boards gain the resume boot wait; an absent packet logs and costs up to one second, then admits writes rather than leaving BOOT waiters stuck. The existing public identical-code J313 and author suspend results support merging without a new dedicated sleep campaign.
aa64d8f
Stop two SPI HID status mismatches on the MacBook Air M1 2020 (J313).
The keyboard, trackpad, and actuator share one controller, so each mismatch is one transfer. At boot, actuator probe sends feature report 0x21, which this descriptor does not have (input 0x3f and output 0x53 only). The controller answers 9c 17 e5 f8. Skip that report when it is absent. The part already powers up device-controlled.
On suspend, NumLock-off is queued on the non-freezable system workqueue and races controller power-off, so the late write reads 00 00 00 00. Flush the keyboard and trackpad LED workers while the controller is still up, refuse new transfers once it is down, and on resume wait for boot packet a0 80 00 00 before returning.
spi-hid-apple-of.c is unchanged. Any other bad status word still warns.
Session build, Monday 26 Oct 2026 05:02 PM -03: linux-aurora 7.2.11-6-2-ARCH (package 7.2.11.aurora6-2), branch local/j313-test at 7638df0. makepkg exited 0. rustc 1.85.0, LLVM/clang 18.1.8. This machine is running that kernel. The stacked commit compiled in was 6d535f9. This pull request's head is cb0f94f, which is not the commit that was built.
Two real s2idle cycles on this kernel showed no spi-hid status mismatch. malik-na's J313 runs of an earlier identical diff (
38d4f0804ceb) logged neither the boot mismatch9c 17 e5 f8(0 of 8 boots) nor the suspend mismatch00 00 00 00(0 of 3). A real lid-close sleep had working keyboard, pointer, and trackpad click. The rebased headcb0f94f8429fwas not re-tested.