Repository navigation
input: apple_mtp_kbd: leave an MTP handed to the OS halted alone - #69
Conversation
|
Read at 62f2327. The diagnosis is clear (same firmware build and the same crash PC as the J604), and the before/after rows show the change does what it says. The shape is the issue: this grows a board list in Cost note stays as you wrote it (no internal keyboard in U-Boot/GRUB on these boards). If that's acceptable for now, a follow-up to key it on the property is fine; please say so in the commit message. Assisted-by: LLM (Claude:Opus 5.5) |
When the device tree names the MTP (/arm-io/mtp) in /chosen linux-enablement-mac,dapf-halted-handoff, the earlier stage hands it to the OS halted and Linux cold-starts it. U-Boot's MTP keyboard probe starts it first and stops it again at OS entry, and the firmware does not survive the second start: on the J715 (MacBook Air 15-inch, M4), Linux's RTKit init is followed 0.3 ms later by "co-processor has crashed", the same data abort as on the J604, and the internal keyboard and trackpad are gone. Refuse the keyboard whenever the tree says so, instead of listing boards. The J604's tree has the property, so its entry goes; the J715's gets it from aurora-silicon/linux#2745. The J813 and T6050 keep theirs, since their trees don't name the MTP there. U-Boot then has no internal keyboard on these boards, and Linux gets a firmware nobody ran. Tested on a J715 (OS firmware 26.6.2) with the #2745 tree: with aurora-wip as is, the MTP crashes in Linux; with this change, "MTP Says Hello" and the keyboard and trackpad work. Signed-off-by: Kazuhide Takahashi <[email protected]>
|
Thanks, done as suggested:
I re-ran the J715 with this version: same result as the board entry. "MTP Says Hello", keyboard and trackpad, and U-Boot's keyboard probe refused. Title, commit message and description are updated; it is still one signed commit on aurora-wip. |
62f2327 to
da9bad5
Compare
|
Re-review of da9bad5. The board entries are gone. The probe now refuses the keyboard when One ordering note: for the J715 this only takes effect once aurora-silicon/linux#2745 lands. Until then the J715 tree has no property and behaves as aurora-wip does today, so merging this first is safe. Approving from my side. Assisted-by: LLM (Claude:Opus 5.5) |
There was a problem hiding this comment.
Formal §1–§6 pre-PR checklist review at da9bad51901e06d2499865df4a5fb727454821c7.
The code change in drivers/input/apple_mtp_kbd.c is clean and directly resolves §1 model gating for halted MTP handoffs: apple_mtp_halted_for_os() checks /chosen linux-enablement-mac,dapf-halted-handoff for "/arm-io/mtp" via ofnode_path() + ofnode_stringlist_search() (valid on both flat FDT and live tree), matching aura/src/dapf.c, t8132-j604.dts:31, and aurora-silicon/linux#2745, removing the apple,j604 board gate without adding apple,j715.
Blockers
- Live CI has not run (
action_required):- Fork workflow run
45015840143(Apple builds, covering bothapple_m1_defconfigandapple_j873_defconfigwithWERROR) has conclusionaction_requiredand has not executed onda9bad51. Maintainer CI approval and a greenApple buildsrun are required before approval/merge.
- Fork workflow run
- §5 Missing regression run counts (and J604 verification ask):
- The J715 test table records U-Boot refusal (
-19), Linux"MTP Says Hello", working keyboard/trackpad, CPUs 0–9, and 0 DART faults, but omits the §5 regression counts on the J715 boot (0 SELinux denials,0 failed units,0 new kernel errors). Please add the explicit regression counts from the J715 boot. - Because this removes the explicit
apple,j604compatibility check in favor of the/chosenproperty, please explicitly request a J604 verification run (per §1, when you do not have the other affected Mac on hand) so we confirm J604 remains unchanged onda9bad51.
- The J715 test table records U-Boot refusal (
Checklist summary & non-blocking notes
- §1 No model gating: Pass on code — replaces the
apple,j604board gate with the/chosenlinux-enablement-mac,dapf-halted-handoffDT property and documents whyapple,j813andapple,t6050remain (their trees do not carry that property). Safe to merge ahead ofaurora-silicon/linux#2745since absence preserves existing behavior. - §2 Production-ready: Pass on code (no new cmdline/env/delay hacks; local NVMe test-only patch is clearly disclosed as out of tree).
- §3 Safety: Pass (prevents starting a halted MTP whose firmware crashes on second start in Linux).
- §4 Clean-room & attribution: Pass (single commit
da9bad51with human author/committer + humanSigned-off-by:only, zero AI trailers). - §6 Naming: Pass.
- Non-blocking note: Consider adding a small host unit test in
test/py/tests/test_apple_mtp_keyboard.pyexercisingapple_mtp_halted_for_os()when/chosen/linux-enablement-mac,dapf-halted-handoffcontains"/arm-io/mtp".
|
Thanks. Here are the regression counts for the J715 boot in the table (U-Boot refuses the keyboard with -19, then Linux starts the MTP:
Setup of that boot:
J604: I don't have a J604. Could someone with a J604 (14-inch MacBook Pro, M4) boot
@davishann15-commits @samuelkurt, you've reported from a J604 before. Would one of you be able to? I'll also look at the host unit test you suggested in |
|
Tested on a J604 (MacBook Pro 14-inch, M4; OS firmware 26.6.2, system firmware 27.2), booted through U-Boot da9bad5 (2026.07-gda9bad51901e, apple_m1_defconfig) with aura 1.0.0b15 and kernel 7.3.0-41.fc44.aurora. /chosen has linux-enablement-mac,dapf-halted-handoff = "/arm-io/mtp".
Sidenote:
|
|
@samuelkurt thank you for the J604 row. That's the confirmation this PR needed: on Two small things:
The backlight is outside this PR. |
|
U-Boot: mtpkbd: keyboard failed to start (-19). da9bad5 drops the apple,j604 match, so the skip now comes from the /chosen property. Captured from the screen with /chosen/u-boot,verbose set, since CONFIG_VIDEO_QUIET_BOOT keeps it off the display on a normal boot. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at da9bad51901e: the code is ready; it needs one more row.
Blockers: none in the code. Missing row: this driver starts the keyboard on every laptop, so before it merges it also needs one boot at this head on a laptop from another generation (a J813, or an M2 or M3 laptop): U-Boot still starts the MTP where the property is absent, and the keyboard works in U-Boot and Linux.
Checked: no Apple material. This adds a property check: an MTP named in /chosen/linux-enablement-mac,dapf-halted-handoff is left halted for the OS, and the J813 board check stays for now. CI is green, and your J715 row (U-Boot leaves the MTP alone with -19, Linux starts it, and the keyboard and trackpad work) covers the board. Thanks.
Superseded by the review at da9bad5
|
|
|
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. |
Summary
On the J715 (MacBook Air 15-inch, M4), the MTP has the same problem as on the J604 in #44:
t8132-j604.dtsdoes.apple_mtp_kbd_probe()starts it for U-Boot's keyboard, and it is stopped again at OS entry.AppleMTPFirmwareMac-5340.61.4, the same version as on the J604 in input: apple_mtp_kbd: leave the J604's MTP to Linux #44) does not survive that.Instead of adding the J715 to the board list, the probe now returns
-ENODEVwhenever/chosenlinux-enablement-mac,dapf-halted-handoffnames/arm-io/mtp, the MTP's ADT path. This is the property the earlier stage reads to hand the MTP over halted. Every tree that asks for a halted MTP gets one, with no table.apple,j604entryt8132-j604.dtshas. That entry goesThe cost is the one #44 accepted: no internal keyboard in U-Boot or GRUB on these boards.
Testing
J715 (Mac16,13), OS firmware 26.6.2, stage 1 → aura → U-Boot → Linux, three boots:
u-boot,verboseadded to/chosen.apple_m1_defconfig, with a test command inpreboot.apple_nvme_probe()return-ENODEVon the J715 before touching the controller.bootifrompreboot, so the EFI/GRUB path was not tested.mtpkbd: keyboard not ready after 1000 ms, MTPCPU_CTRL0x10(RUN)mtpkbd: keyboard failed to start (-19)mtpkbd: keyboard failed to start (-19)RTKit: co-processor has crashed0.3 ms after init. Data abort (ESR0x96000004) at the same firmware PC as the J604 crash in #44, then-ETIME, probe -62Off the hardware:
apple_m1_defconfigbuilds withKCFLAGS=-Werror(GCC 16.1, aarch64).test_apple_mtp_keyboard.pyandtest_apple_helper_handoff.pypass with--noconftest(9).The J604 was not re-run. Its tree in integration/aurora (d1b022d) has the property, so it should take the same path as before, now through the property.
Relation to #55 and #57
rtkit_helper_unparked[]table keeps the J715 on today's restart path (R). The first column above is the hardware run for that cell. If arm: apple: choose the MTP handoff in one place #55 lands first, its J715 row should not beR, and this rule would fit the "decide from the node or the earlier stage's property" direction asked for there.Merge order: this depends on aurora-silicon/linux#2745 for the J715. Without it, the J715's tree has no property, and its MTP faults in Linux anyway (
CTE invalid).