Repository navigation
HID: apple-mtp-haptic: return the actuator to device mode on resume - #2100
mouthmantra wants to merge 1 commit into
Conversation
Since "HID: dockchannel: notify HID drivers across system sleep", magicmouse forgets a host-controlled actuator mode on every resume, on the grounds that system sleep hands the actuator back to its firmware. Suspend-to-idle does not: DockChannel only sends the MTP its sleep reports when the suspend goes through firmware, so an actuator that userspace force-feedback took host-controlled before suspend is still host-controlled after it. The cache and the hardware then disagree. magicmouse believes the firmware reports the button, while the host-controlled firmware reports none, so on a J614c (MacBook Pro 14", M4 Max) the trackpad stops clicking after a suspend and resume. Tap-to-click and dragging still work. Unbinding and binding hid-apple-mtp-haptic restores clicks, because probe sends report 0x21 with device-controlled mode. Do the same on resume, before the click strength is checked, so the actuator matches what its users now assume. A user that still wants host control takes it again on its next effect. Update the magicmouse comment that said nothing on the host returns the actuator. Tested on J614c with s2idle: the pad clicks after resume with userspace haptic effects loaded before suspend. Signed-off-by: Logan Torres <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01D5ybhDsuN7WkfTfz4jRcwj
|
This conflicts with #2026. On J714s, multi-touch (DockChannel interface 1) resumes before the actuator (interface 4), so this switch runs after #2026's resume has asserted host mode. magicmouse then caches host mode while the firmware is in device mode, and with #2026 restores the wanted mode from the trackpad side: host mode when |
|
#2026 is merged into integration/aurora (493b6dc). Its trackpad-side resume now asserts the wanted actuator mode: host mode when With that in, Please drop the actuator-side switch and rebase onto the current integration/aurora. If something on the J614c is still not covered by #2026's resume path, could you describe it here? |
|
Blockers: 1.
HW row: if a J614c-specific gap remains after #2026: J614c on current integration/aurora, s2idle with userspace haptic effects loaded, then with Assisted-by: LLM (Claude:Opus 5.5) |
|
@mouthmantra, a tidy-up pass over the open PRs here. These of yours need something:
If any of these are no longer needed, closing them helps; otherwise a merge or rebase onto integration/aurora is usually all they need. Thanks! |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: HOLD at c9b5c2b2d943
Blockers:
drivers/hid/hid-apple-mtp-haptic.c:210-231(PM resume ordering regression & superseded by #2026):dockchannel_hid_resume()resumes interfaces in ascending index order (drivers/hid/dockchannel-hid/dockchannel-hid.c:1929-1938), so the multi-touch interface (hid-magicmouse) resumes before the actuator (hid-apple-mtp-haptic). Onmain, #2026 (493b6dc112e7/9e975bf50fdb) already asserts the desired mode inmagicmouse_haptic_resume()(HID_HAPTIC_MODE_HOSTwhenhaptic_pressis enabled or userspace effects are loaded,HID_HAPTIC_MODE_DEVICEotherwise). Switching to device mode unconditionally inapple_actuator_resume()overwrites that state without updatingmsc->haptics->modeor synchronizing withauto_trigger_mutex(also racing with post-resume haptic work queued oncemsc->haptic_suspendedclears), causing double clicks withhaptic_press=Yand breaking host-controlled FF state across DockChannel MTP Macs. Drop the actuator-side mode switch and close this PR as superseded by #2026 unless a concrete J614c gap still reproduces on currentmain.drivers/hid/hid-magicmouse.c:2058-2066(merge conflict): conflicts withmain(mergeable: CONFLICTING,DIRTY), where #2026 replacedmagicmouse_haptic_forget_mode()withmagicmouse_haptic_resume(). Rebase onto currentmainif any remaining J614c fix is needed.- §4 (attribution): commit
c9b5c2b2d943carries tool co-author and session-link trailers, and the PR body includes a tool-generated footer and session link. Strip all tool and session attribution from the commit message and PR body, keeping only the human author and humanSigned-off-by:(do not add any tool-assistance trailer either; current §4 requires zero tool attribution everywhere). - §5 (PR structure & exact-head evidence): PR body is missing the required
What:,Tested:,Risk:, andNot yet:lines and an exact-head regression row (0 SELinux denials, 0 failed units, 0 new kernel errors) covering J614c (with userspace effects loaded, andhaptic_pressboth off and on) plus multi-Mac DockChannel verification on currentmain.
Checked: Diff against main (677be395b9d2), PM resume ordering in dockchannel-hid.c / spi-hid-apple-core.c / hid-magicmouse.c, commit & PR hygiene (§1–§6), CI (host-tests passed on stale pre-conflict base; PR is CONFLICTING), and HW evidence rows.
Evidence
- §1 (No model gating / multi-Mac non-regression): FAIL — no chip/board/firmware gates added, but forcing device mode in
apple_actuator_resume()regresses DockChannel MTP Macs runninghaptic_press=Yor userspace FF effects after #2026 (493b6dc112e7) becausedockchannel_hid_resume()resumes interface 1 (multitouch) before interface 4 (actuator). - §2 (Production-ready, no hacks): FAIL — unsynchronized mode write in
apple_actuator_resume()bypasseshid-magicmouse'smsc->haptics->auto_trigger_mutexand cachedmsc->haptics->modeaftermagicmouse_haptic_resume()has already clearedmsc->haptic_suspended. (No cmdline/module params or sleeps added.) - §3 (Safety): PASS — no hardcoded safety limits or firmware/speaker/USB-C safety issues.
- §4 (IP & attribution): FAIL — no Apple copyrighted material, human
Signed-off-by:is present, but commitc9b5c2b2d943has tool co-author and session-link trailers and the PR body has a tool footer and session link. - §5 (Evidence & PR structure): FAIL — missing
What:/Tested:/Risk:/Not yet:fields, exact head SHA + kernel/build inTested:, multi-Mac check, and regression row (0 SELinux denials, 0 failed units, 0 new kernel errors). - §6 (Naming): PASS — no prohibited naming issues.
- Commits: 1 commit (
c9b5c2b2d943d3b1184240703ab75a7e8f743dcf), conflicting againstmain(677be395b9d2). - CI:
host-tests(Host tests, run 43942500557)SUCCESSon 2026-11-21 against the pre-conflict base; PR is currentlyCONFLICTING(DIRTY) and needs rebase/re-test if kept open. - Non-blocking note: If J614c s2idle with loaded userspace haptic effects works on current
mainwith #2026 merged (magicmouse_haptic_resume()assertsHID_HAPTIC_MODE_HOSTwhile effects are loaded andHID_HAPTIC_MODE_DEVICEonce erased), this PR can simply be closed as superseded.
|
Merge readiness at
Areas: none matched in CODEOWNERS Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
Since "HID: dockchannel: notify HID drivers across system sleep",
magicmouse forgets a host-controlled actuator mode on every resume,
on the grounds that system sleep hands the actuator back to its
firmware. Suspend-to-idle does not: DockChannel only sends the MTP its
sleep reports when the suspend goes through firmware, so an actuator
that userspace force-feedback took host-controlled before suspend is
still host-controlled after it.
The cache and the hardware then disagree. magicmouse believes the
firmware reports the button, while the host-controlled firmware
reports none, so on a J614c (MacBook Pro 14", M4 Max) the trackpad
stops clicking after a suspend and resume. Tap-to-click and dragging
still work. Unbinding and binding hid-apple-mtp-haptic restores
clicks, because probe sends report 0x21 with device-controlled mode.
Do the same on resume, before the click strength is checked, so the
actuator matches what its users now assume. A user that still wants
host control takes it again on its next effect. Update the magicmouse
comment that said nothing on the host returns the actuator.
Tested on J614c with s2idle: the pad clicks after resume with
userspace haptic effects loaded before suspend.
https://claude.ai/code/session_01D5ybhDsuN7WkfTfz4jRcwj