Skip to content

input: apple_mtp_kbd: leave the T6030 MTP to the OS - #80

Closed
ParaN3xus wants to merge 11 commits into
aurora-silicon:aurora-wipfrom
ParaN3xus:t6030-mtp-untouched
Closed

ParaN3xus wants to merge 11 commits into
aurora-silicon:aurora-wipfrom
ParaN3xus:t6030-mtp-untouched

Conversation

@ParaN3xus

@ParaN3xus ParaN3xus commented Nov 29, 2026 •

Copy link
Copy Markdown

What: apple_mtp_kbd: leave the MTP to the OS when its device tree says the OS adopts it running — the keyboard is skipped when its helper carries apple,rtkit-keep-running (the kernel binding) instead of extending a per-SoC compatible list. On the T6030 (J514s/J516s, M3 Pro) 27.2 stub, U-Boot's helper restart burns the one-shot MTP epoch and Linux finds a dead coprocessor (the #55/#57 class); J813 keeps #51's helper compatible check until its DT gains the marker.

Tested: J516s (T6030, M3 Pro) at ac7804dba1d, 27.2 stub, kernel 7.3.0-t6030hdmi+ (aurora nightly base + local HDMI patches), input node enabled: 1/1 cold boot, co-processor has crashed 0, MTP alive and adopted (AppleMTPFirmwareMac-6310.85.7~38), Apple MTP keyboard and multi-touch interfaces register, keyboard, trackpad and keyboard backlight work, devices_deferred empty.

Risk: two-way · T6030 (J514s/J516s) and any Mac whose DT carries apple,rtkit-keep-running (t603x, the T8112 macOS 27+ firmware profile, T8122 J613/J615); boards without the marker keep byte-identical behaviour. A plain revert restores the binding.

Not yet: a second cold boot on J516s (machine in daily use; follow-up row); T6031 (J514c/J516c/J514m/J516m) — auto-covered by the t603x marker, untested on hardware; the T8112 macOS 27+ profile and T8122 J613/J615 markers likewise; J813's DT has no marker yet (a small kernel-side DTS change migrates it and lets U-Boot drop that compatible check later).

Problem

On T6030 (J514s/J516s, M3 Pro) with the input node enabled and the 27.2 stub, apple_mtp_kbd binds, the helper does a second RTKit boot against firmware iBoot already started, and at OS entry the helper is taken to QUIESCED and its RUN bit cleared. Post-M2 MTP firmware does not survive that (the class of failures #55/#57 document, and #79's "burning the one-shot MTP epoch"): the epoch is burned and Linux finds a dead coprocessor before any Linux driver touches it.

On my J516s this was deterministic, 15/15 boots with the node enabled: PC 0x10371b4, garbage FAR, empty RTKit crash version (the firmware dies before its crashlog machinery is up), dockchannel-hid deferring forever, no internal keyboard/trackpad. Zero faults with the node disabled (8/8) — a clean single-variable bisection.

Change

The keyboard binds to apple,dockchannel-hid and, through the apple,helper-cpu phandle, boots and quiesces the MTP helper. The probe now resolves that same phandle (the path get_rtkit_helper() already uses) and skips the driver when the helper node carries apple,rtkit-keep-running — the kernel binding for firmware the OS adopts running, i.e. exactly the firmware that cannot survive U-Boot's restart. In aurora-wip's probe the exclusion chain is the t8142 helper check (#51), the halted-for-os check, apple,t6020 (#82) and apple,t6050; this adds the keep-running marker as a matching helper-node check beside #51's, replacing the earlier apple,t6030 machine-compat entry. Boards whose DTs carry no marker keep byte-identical behaviour.

Evidence

J516s, 27.2 stub, input node enabled:

  • Stock U-Boot (2026.07-g250385f8c8aa, this tree before the change): 15/15 boots with the MTP crashed before Linux, identical crash record each time; 8/8 healthy with the node disabled.
  • First version of this change (machine-compat gate) on the old main base: 2/2 cold boots clean.
  • This change at ac7804dba1d (aurora-wip merge + the keep-running gate), kernel 7.3.0-t6030hdmi+, boot id 65df7b8f-8000-4c90-b3a7-f9d505bbff3d: 1/1 cold boot, co-processor has crashed 0, MTP Says Hello, MTP alive and adopted (AppleMTPFirmwareMac-6310.85.7~38), Apple MTP keyboard and multi-touch interfaces register, keyboard, trackpad and keyboard backlight work, devices_deferred empty. The tested build's banner reads 2026.07-g383f14e49232-dirty (merge commit plus the gate before commit); the committed head changes exactly that file to the tested bytes.

Notes

  • If arm: apple: choose the MTP handoff in one place #55's hand-off selector lands, this gate folds into it: the selector centralizes the same choice in one place.
  • While building on ALARM with OpenSSL 4.1, lib/rsa/rsa-sign.c needs #define OPENSSL_ENGINE_STUBS 1 before the OpenSSL includes (OpenSSL's official stub switch) — a host-tool build issue only, not part of this change.

RyanTheTide and others added 9 commits November 24, 2026 11:37
Every agent that opens this repository loads the same rules, whoever
runs it: the rulebook in aurora-silicon/agent-guidelines. This file keeps
only the repo specifics.

Route reviews to the teams that review and merge here with
.github/CODEOWNERS; any one approval from a listed owner counts.
Changes under .github/ need an Owner's review.

No runtime change. [skip ci]

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Runs the shared pr-text check from aurora-silicon/.github on pull
requests: it asks for the Tested and Risk lines and rejects AI
attribution in the PR text, saying which line to fix. Drafts and older
PRs only get a warning.

[skip ci]

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…-workflows

github: add the organisation's pr-readiness caller
The file names @aurora-silicon/omarchy-m, but the team slug is
omarchy-mac. GitHub reports every such line as an unknown owner, so an
Omarchy Mac approval does not count as code-owner review.

Name the team by its slug and add @aurora-silicon/aurora-maintainers
wherever Omarchy Mac is listed: Aurora Maintainers review and merge
with the same rights as Omarchy Mac.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…rs-aurora-maintainers

CODEOWNERS: add Aurora Maintainers and fix the Omarchy Mac team name
@ParaN3xus
ParaN3xus requested review from a team as code owners November 29, 2026 08:08
@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks required sections (bot) labels Nov 29, 2026
@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Merge readiness at ac7804db: not ready yet

Check Detail
CI at head running no checks reported yet for this head
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok in the PR body at ac7804db
Conflicts ok none
PR text ok Risk: two-way · T6030 (J514s/J516s) and any Mac whose DT carries apple,rtkit-keep-running (t603x, the T8112 macOS 27+ firmware profile, T8122 J613/J615); boards without the marker keep byte-identical behaviour. A plain revert restores the binding.

Areas: none matched in CODEOWNERS

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@github-actions github-actions Bot added blast:m3 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) and removed needs-hw-row No hardware row at the PR head (bot) needs-template PR body lacks required sections (bot) labels Dec 1, 2026

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feedback before merge at 44b09fd4b7c2.

The bisection and J516s 27.2 reproduction data are clear and convincing, and the -ENODEV early exit in apple_mtp_kbd_probe() matches the existing J813 path cleanly.

One design point to address before merging:

  • Extending of_machine_is_compatible("apple,j813") with of_machine_is_compatible("apple,t6030") grows a per-SoC/board allowlist rather than selecting by a device-tree property. As Not yet already notes, T6031 likely needs the same handling too. Checking a DT property on the MTP node (for example apple,rtkit-keep-running, or a dedicated property populated on the MTP node for boards/SoCs whose firmware cannot survive a U-Boot RTKit restart before Linux) would avoid board/SoC-name gating and cover T6031 automatically without another U-Boot patch.

…ouched

# Conflicts:
#	drivers/input/apple_mtp_kbd.c
Gate the keyboard on the MTP node instead of a per-SoC allowlist of
machine names: it is skipped when its helper carries
apple,rtkit-keep-running, the kernel binding for firmware the OS
adopts running and that cannot survive U-Boot's RTKit restart (the
aurora-silicon#55/aurora-silicon#57 class). On the T6030 (M3 Pro) 27.2 stub the restart burns
the one-shot MTP epoch, and the t603x trees already mark &mtp
keep-running, so T6031 is covered without another U-Boot patch.
J813 keeps aurora-silicon#51's helper compatible check: its DT has no marker yet.

Signed-off-by: paran3xus <im@paran3x.us>
@github-actions github-actions Bot added the needs-hw-row No hardware row at the PR head (bot) label Dec 2, 2026
@ParaN3xus
ParaN3xus changed the base branch from main to aurora-wip December 2, 2026 15:01
@ParaN3xus

ParaN3xus commented Dec 2, 2026 •

Copy link
Copy Markdown
Author

Adopted in ac7804dba1d: the probe now skips the keyboard when its helper carries apple,rtkit-keep-running — the kernel binding — resolved through the apple,helper-cpu phandle the driver already uses, so it sits beside #51's helper-node check instead of extending the machine list.

Coverage: the marker exists today in the t603x trees (T6030, tested here on J516s at the new head; T6031 auto-covered without another U-Boot patch), the T8112 macOS 27+ firmware profile and the T8122 J613/J615 trees — the latter two are covered by the marker's own semantics but untested on hardware here, flagged in Risk/Not yet.

J813 keeps its compatible check for now: its DT has no marker, and adding one is a kernel-side change with its own row (noted under Not yet as the migration path that later lets U-Boot drop that line too).

Rebased onto aurora-wip (a merge, no force-push), the PR is retargeted to aurora-wip, and the hardware row is re-run at the new head. Happy to rework any of this if the shape is not what you had in mind.

@github-actions github-actions Bot added blast:m2 Macs affected, from Merge risk (bot) and removed needs-hw-row No hardware row at the PR head (bot) labels Dec 2, 2026
@ParaN3xus

Copy link
Copy Markdown
Author

Superseded by #83: this branch grew out of the pre-divergence main, so merging aurora-wip into it dragged main's CI/policy commits into the diff. The change is re-proposed from a clean aurora-wip branch with the tested commit only; the design discussion continues there. Closing this one to keep the queue clean.

@ParaN3xus ParaN3xus closed this Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blast:m2 Macs affected, from Merge risk (bot) blast:m3 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants