Repository navigation
HID: magicmouse: hold the multitouch enable work across system sleep - #1317
Merged
RyanTheTide merged 2 commits intoNov 9, 2026
Merged
Conversation
reset_resume re-arms the work that puts the trackpad back into
multitouch mode 500 ms after resume. When the next suspend starts
within that window, the work is still pending: its timer fires during
the following suspend or resume, before the SPI HID transport is
powered again, and the feature report fails with -ENODEV ("unable to
request touch data (-19)"). The touch mode is then not restored after
that resume.
Cancel the work in suspend. reset_resume schedules it again as before;
a plain resume, where the device kept its state, re-queues it only if
suspend stopped it while it was pending.
Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
The MTP PM model now runs the production magicmouse_suspend() from the transport's suspend notification. It checks that pending multitouch enable work is cancelled at suspend and queued once on resume, and that idle work stays idle. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
reset_resumere-arms the trackpad's multitouch-enable work 500 ms after resume. When the next suspend starts inside that window, the work is still pending. Its timer then fires during the next suspend or resume, before the SPI HID transport has power, and the feature report fails with-ENODEV:After that resume the touch mode is not restored. The fix cancels the work in
.suspend.reset_resumere-arms it as before, and a plainresume(when the device kept its state) re-queues it only if suspend stopped it while it was pending.Tests
checkpatch.pl --strict: 0/0/0 on both commits.tools/asahi/mtp-pm-tests.pynow runs the productionmagicmouse_suspend()from the transport's suspend notification. Pending enable work is cancelled at suspend and queued exactly once on resume, and idle work stays idle. Making resume skip the re-queue fails the model. The old-transport negative control still fails as expected.magicmouse_enable_multitouchcounts every enable report and its return value.rtcwake -m freeze(no gap)unable to request touch data (-19)(two regression-suite runs)evteston "Apple SPI Trackpad" after the run🤖 Generated with Claude Code