Repository navigation
Conversation
|
Thanks for this, and for the SLC numbers on the J716c. One point before it can land: we select behaviour by a hardware property, not by the chip it was tested on. The wait for boot scanout to retire is taken only when both nodes are T6050 ( Could the wait apply to every boot-DMA supplier that is a display controller (or follow the |
e72cc8b to
bddfd57
Compare
|
Note 🤖 Claude Opus 5.5 responding on behalf of erikwb The T6050 test is gone (bddfd57). Whether a supplier is scanning out a boot framebuffer now comes from the DT: an enabled simple-framebuffer whose standard
On the J716c: with native handoff, allocation is enabled 0.4 ms after "boot scanout retired by displayed swap 6". With the handoff declined, MCC stays deferred and allocation stays off. Boot rows on M1 Pro, M2, M4 Pro and A18 Pro would confirm allocation still enables there as before. |
|
Thanks, this resolves our point. The wait now follows the device tree: an enabled simple-framebuffer whose We'll run boot rows on our M1 Pro, M2, M4 Pro and A18 Pro on this head (MCC allocation enabled as before, no new deferral) and post them here. |
163de13 to
e6fdaf6
Compare
A display controller can keep scanning out the framebuffer the bootloader left on screen after it binds, and also while its node stays disabled because the bootloader kept the boot framebuffer as the display. For a boot DMA supplier that an enabled simple-framebuffer names as its display, enable cache allocation only once the display driver reports that a displayed swap of its own has retired that scanout. Other suppliers still only need to be bound. A supplier phandle that does not resolve, or a detached consumer or supplier node, leaves allocation off. The display driver reserves the record before it can retire the scanout, so the one-shot retirement cannot be lost to an allocation failure. Retirement survives either driver's unbind and reprobe; records and waiters are dropped when a node they name is detached, and none is added or retried for a detached node. OF flags a node detached before it calls the reconfig notifiers, so probe cannot hold a detach off, but the notifier always runs after the flag is set. Probe therefore checks its nodes and enables allocation under the lock the detach notifier takes, and registers the enabled controller there. Either probe sees the flag and fails, or the notifier finds the controller and turns allocation off, unless the detached node is a supplier whose boot scanout already retired, and cancels the enable a wake from deep sleep would do. Suspend, resume and shutdown take the same lock. A failed enable's write-back (up to 100 ms per plane) is done under that lock and delays a detach by as much. A deferred controller is retried outside the display driver's receive path. Signed-off-by: Erik Bourget <erik@ebourget.net>
bddfd57 to
5b30245
Compare
|
Re-checked at 5b30245.
One correction to "Still to run": M1 Pro and M2 have no MCC match (mcc.c:540-546), and the M4 Pro (J616s) and A18 Pro (J700) MCC nodes stay disabled (t604x.dtsi, t8140.dtsi:805-806), so boots there don't reach this code. The board in tree that reaches the bound-only path is T8132 (t8132-jxxx.dtsi:168-170, supplier LGTM otherwise. Assisted-by: LLM (Claude:Opus 5.5) |
|
Note 🤖 Gemini 4 Neon responding on behalf of erikwb Updated "Still to run" in the PR body to name T8132 ( |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Pre-PR checklist review at 5b302458524f (0 code/policy blockers; holding for §5 live-head hardware proof and stacked CI):
Stack & Dependencies
- Targets open base PR #2518 (
satchlj/mcc-t6050-slc-allocate-20261120@e6fdaf6d4b23). Stands cleanly on its own on top of #2518 with no dependency on #2539 or #2540 (CONFIG_APPLE_MCC_BOOT_DMAis built-inboolwhenCONFIG_APPLE_MCCis enabled and provides inline stubs otherwise).
Code & Safety Audit
- Locking & lifetimes (
drivers/soc/apple/mcc-boot-dma.c,drivers/soc/apple/mcc.c): Singleboot_scanout_lockmutex serializes scanout retirement, OF detach handling, probe enable/registration, remove unregistration, shutdown, andsuspend_noirq/resume_noirq(sleepable process context).apple_mcc_retry()dropsboot_scanout_lockbeforedevice_initial_probe(),apple_mcc_boot_scanout_retired()drops it beforeschedule_work(), andapple_mcc_remove()unregisters before disabling and tearing downdevmstate (no UAF or lock inversion). - OF detach ordering: Verified against
drivers/of/dynamic.c(__of_detach_node()flagsOF_DETACHEDbeforeof_reconfig_notify(OF_RECONFIG_DETACH_NODE)), so the lockedapple_mcc_boot_dma_detached()check + enable + registration closes the probe/detach race, andapple_mcc_boot_dma_lost()clearsmcc->sleep_disabledso resume does not re-enable. - Fail-safe walk & refcounts:
apple_mcc_scans_boot_framebuffer()andapple_mcc_wait_boot_dma()balanceof_node_put()on all paths; unresolved non-zero phandles return-EINVAL, detached nodes return-ENODEV, disabled/unbound suppliers defer, anddisplay-named boot-framebuffer suppliers wait for retirement whether enabled or disabled. - Host tests: Independently ran
tools/asahi/mcc-boot-dma-tests.py+ all 5 mutation controls against5b302458524f(6/6 pass: baseline passes, all 5 mutants killed).
Pre-PR Checklist (§1–§6)
- §1 No model gating: PASS — driven purely by DT
apple,boot-dma-devicesand enabledsimple-framebufferdisplayphandle (no chip/SoC/board checks). - §2 Production-ready: PASS — default cmdline, no sleeps/magic delays.
- §3 Safety: PASS — fails safe (allocation stays off) on every unconfirmed or detached state.
- §4 Clean-room & attribution: PASS — commit
5b302458524fcarries human author/committer and humanSigned-off-by:only; PR body carriesAssisted-by:. - §5 Evidence: HOLD — prior J716c rows were on
bddfd572. Still needed on live head5b302458524f:- T8132 (J713,
t8132-jxxx.dtsi, bound-only&pmppath) boot confirming cache allocation enables as before + regression row (0 SELinux denials, 0 failed units, 0 new kernel errors). - Repeated J716c native handoff and handoff-declined rows on
5b302458524f(with rebased #2539/#2540) + regression row (0 SELinux denials, 0 failed units, 0 new kernel errors).
- T8132 (J713,
- §6 Naming: PASS.
CI Status
sep-source.yml: 6/6SUCCESSon5b302458524f(source,rust-build,kunit, and all 3DWC3/ATCcompile matrix jobs).dt-checks.ymlandhost-tests.ymlhave not run on GitHub Actions yet because this PR targets #2518's branch rather thanintegration/aurora; they will need to pass once #2518 merges and this PR is retargeted.
Assisted-by: LLM (Gemini 4 Neon)
Summary
apple,boot-dma-devicessupplier that an enabled simple-framebuffer names as itsdisplay, keep system level cache allocation off until the display driver reports that a displayed swap of its own retired the boot scanout (apple_mcc_boot_scanout_retired(),drivers/soc/apple/mcc-boot-dma.c). This holds whether or not the supplier's node is enabled, so a boot where the bootloader keeps the boot framebuffer also keeps allocation off. All listed suppliers still must bind (matching soc: apple: mcc: let the T6050 system level cache allocate #2518).apple_mcc_boot_scanout_reserve()) before its first present, so publication cannot fail. Retirement survives either driver's unbind and reprobe.Stack
satchlj/mcc-t6050-slc-allocate-20261120)j716c/t6050-mcc-display-ready)j716c/display-takeover-ready)j716c/t6050-cache-planes)Testing
tools/asahi/run-host-tests.py --only mcc-boot-dma(6/6 passed: baseline + 5 mutants killed) compiles the supplier walk, the detach notifier and the PM callbacks against mock device-tree nodes: the disabled-but-scanning DCP, bound-until-retired DCP, unbound supplier deferral, unresolved phandles, detach between walks, detach after enable, suspend -> detach -> resume, with mutants for each guard.LLVM=1 W=1) with 0 warnings forCONFIG_APPLE_MCC=y(withCONFIG_APPLE_MCC_KUNIT_TEST=yandCONFIG_OF_DYNAMIC=y) andCONFIG_APPLE_MCC=m; checkpatch 0 errors (only the binding-in-same-patch and MAINTAINERS notes).Prior hardware test on the J716c (M5 Max) with this stack at
bddfd572on a kernel built from the J716c's current base, with 27.2 firmware:apple-dcp 48ae00000.dcp: boot scanout retired by displayed swap 6, thenapple-mcc 2220000000.memory-controller: system level cache allocation enabled on 32 planes0.4 ms later. Before this stack, allocation was enabled at 0.66 s, before the display had taken over.apple-mcc: waiting for /soc@200000000/dcp@48ae00000 to retire boot scanout), so allocation stays off.Still to run
t8132-jxxx.dtsi, supplier&pmp) boot on5b302458confirming the bound-only path still enables cache allocation as before (M1 Pro and M2 have noapple-mccmatch, and M4 Pro / A18 Pro MCC nodes stay disabled in DT).5b302458with the rebased drm/apple: publish completion of native display takeover #2539 and arm64: dts: apple: t6050: describe the single-die system cache controller #2540 stack.Assisted-by: LLM (Anthropic:Claude Opus 5.5, Google:Gemini 4 Neon, OpenAI:GPT-6.2 Sol)