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)
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 review at verified live head 5b302458524f1ea86d992722cae8e40a810a87b2 (live integration/aurora 0f111a0dc307, not superseded).
Checklist Summary
- §1 No model gating, §2 Production-ready, §3 Safety, §4 Attribution, §6 Naming: PASS (0 code/policy/attribution/naming blockers).
apple_mcc_scans_boot_framebuffer()/apple_mcc_wait_boot_dma()indrivers/soc/apple/mcc.canddrivers/soc/apple/mcc-boot-dma.care driven purely by DT (apple,boot-dma-devices+ enabledsimple-framebufferdisplayphandle) with fail-safe handling for unresolved phandles (-EINVAL), detached nodes (-ENODEV), and unbound/unretired suppliers (-EPROBE_DEFER).- Locking and lifetimes are sound:
boot_scanout_lockserializes retirement, OF detach notification, probe check/enable/registration, remove unregistration, shutdown, andsuspend_noirq/resume_noirq;apple_mcc_retry()drops the mutex beforedevice_initial_probe();CONFIG_APPLE_MCC_BOOT_DMAis built-inboolso display drivers have no modular link cycle. - Commit
5b302458524fcarries human author/committer (Erik Bourget) and humanSigned-off-by:only.
Blockers
- Stacked on unmerged base PR #2518 & incomplete live CI: This PR currently targets open base PR #2518 (
satchlj/mcc-t6050-slc-allocate-20261120@e6fdaf6d4b23, currentlyCHANGES_REQUESTED), notintegration/aurora. Consequently, onlySEP source checks(6/6green) ran on GitHub Actions;Device tree checks(dt-checks.yml, forapple,t8140-mcc.yaml),Host tests(host-tests.yml, fortools/asahi/mcc-boot-dma-tests.py), andPMGR power state KUnit(pmgr-pwrstate-kunit.yml, triggered byinclude/linux/soc/apple/**) have not run on CI. Once #2518 lands, retarget/rebase ontointegration/auroraand confirm all triggered workflows pass on the live head. - §5 Exact-head hardware & regression evidence missing: Prior J716c runs were on older head
bddfd572and did not report full regression counts. Please post exact-head default-cmdline rows for:- T8132 (J713,
t8132-jxxx.dtsi, bound-only&pmppath): boot confirming SLC allocation still enables as before, with0SELinux denials,0failed units, and0new kernel errors. - T6050 (J716c with rebased #2539/#2540): native display handoff (allocation enabled only after boot scanout retirement) and handoff-declined (allocation stays off) boots, with
0SELinux denials,0failed units, and0new kernel errors.
- T8132 (J713,
Assisted-by: LLM (Gemini 4 Neon)
|
Note 🤖 Gemini 4 Hydrogen responding on behalf of erikwb Confirmed
Updated the PR description to standard Problem/Change/Testing/Still-to-run sections and folded in the J716c (M5 Max) boot of the stacked #2518 ( |
Problem
A display controller can keep scanning out the framebuffer the bootloader left on screen after it binds, and also while its node stays disabled when the bootloader keeps the boot framebuffer as the display. Waiting only for
apple,boot-dma-devicessuppliers to bind letsapple-mccenable system level cache allocation before the display controller has retired the boot scanout.Change
apple,boot-dma-devicessupplier that an enabledsimple-framebuffernames as itsdisplay(apple_mcc_scans_boot_framebuffer()indrivers/soc/apple/mcc.c), 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()indrivers/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. Every listed supplier still must bind (matching soc: apple: mcc: let the T6050 system level cache allocate #2518), and any supplier that an enabledsimple-framebuffernames as itsdisplaymust also report retirement.apple_mcc_boot_scanout_reserve()) before its first present, so publication cannot fail. Retirement survives either driver's unbind and reprobe.-EINVAL), or a detached consumer or supplier node (-ENODEV), leaves allocation off. If a boot DMA node is detached after allocation is enabled, the OF detach notifier turns allocation off again (and cancels a pending re-enable on resume), unless that node is a supplier whose boot scanout already retired. Suspend, resume, and shutdown take the sameboot_scanout_lockmutex as the notifier.apple,boot-dma-devicesand the enabledsimple-framebufferdisplayphandle), with no chip or board checks.Stack:
satchlj/mcc-t6050-slc-allocate-20261120)j716c/t6050-mcc-display-ready)j716c/display-takeover-ready)j716c/t6050-cache-planes)Testing
Verified at
5b302458524f(rebased onto #2518e6fdaf6d4b23):python3 tools/asahi/run-host-tests.py --only mcc-boot-dma: 6/6 passed (mcc-boot-dma-testsbaseline + 5 mutants killed:--accept-unresolved,--ignore-detached-supplier,--final-skips-unresolved,--detach-retired-only,--resume-after-detach), covering mock DT supplier walks, OF detach notification, and PM callbacks.ARCH=arm64 LLVM=1 W=1) withCONFIG_APPLE_MCC=y(withCONFIG_APPLE_MCC_KUNIT_TEST=yandCONFIG_OF_DYNAMIC=y) andCONFIG_APPLE_MCC=m: 0 errors, 0 warnings ondrivers/soc/apple/mcc.oanddrivers/soc/apple/mcc-boot-dma.o.make ARCH=arm64 LLVM=1 dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/soc/apple/apple,t8140-mcc.yaml): PASS../scripts/checkpatch.pl --strict --git e6fdaf6d4b23..5b302458524f: 0 errors (2 pre-submission warnings: binding-in-same-patch and MAINTAINERS note for new files).SEP source checks) at5b302458524f: 6/6 jobs passed (source,rust-build,kunit,DWC3/ATC builtin-no-atc,DWC3/ATC modular-no-atc,DWC3/ATC builtin-modular-atc).Prior hardware tests on J716c (M5 Max, 27.2 firmware) at
bddfd572(#2538), paired with6195f71c(#2539) andf3a64c0ed945(the earlier#2540board-local 32-planet6050-j716c.dtscommit carrying themccnode andframebuffer@0display = <&dcp>phandle):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 (vs enabling at 0.66 s, before display takeover, prior to this stack).simpledrm):apple-mcc: waiting for /soc@200000000/dcp@48ae00000 to retire boot scanout; allocation stayed off.J716c (M5 Max) boot of
08fa25353657(stack#2518e6fdaf6d4b23+#25385b302458524f+#25397803302be7ee+#254008fa25353657on merge-base26294e82e9c8, arm64 kernel config,LLVM=1,clang23.1.4, default kernel command line, current Aura loader):/sys/class/drm/card2-eDP-1connected and enabled at 3456x2234;apple-dcp 48ae00000.dcp: boot scanout retired by displayed swap 6), desktop started, and/proc/device-tree/soc@2220000000/memory-controller@2220000000/statusreadsdisabledwith noapple-mccdevice bound (because#254008fa25353657keepsmccstatus = "disabled"until the companion loader populatesreg, so the MCC controller did not probe, wait, or enable allocation and its planes were not touched, while DCP can still call the shared retirement helpers inmcc-boot-dma.c).0SError / synchronous external abort / oops / BUG / call-trace / unhandled-fault / panic lines indmesg,0MMIO fault lines,0AVC denials (Arch ARM without SELinux),0mcc/boot-dma/takeover errors, and0kernel errors attributable to the stack (1pre-existing failed unitaurora-peripherals.service, and the 28err..emergjournal lines belong to error groups seen on earlier same-day J716c boots on trees without#2185/#2187/#2162underneath; no bare26294e82e9c8baseline boot was taken).J713 (M4, T8132) boot of
5b302458524f(#2518e6fdaf6d4b23+ #2538;t8132-jxxx.dtsisets&mcc { apple,boot-dma-devices = <&pmp>; status = "okay"; }; arm64 kernel config of the J713 daily plus this tree's new default optionsCONFIG_APPLE_MCC_BOOT_DMA=yandCONFIG_APPLE_J613_DISPLAY_SYNC=y,LLVM=1,clang23.1.4; booted once from GRUB with the daily's exact default kernel command line, daily left as the default entry):apple,boot-dma-deviceson the live DT is phandle0xad, which ispmp@380500000(status = "okay"), and the bootsimple-framebufferhas nodisplayphandle, so only the bound-supplier path applies:apple_pmp 380500000.pmp: PMP firmware and endpoint readyat 0.366201 s, thenapple-mcc 220000000.memory-controller: system level cache allocation enabled on 2 planesat 0.366428 s. The J713 daily boot just before it (without this commit) enabled allocation on the same2 planesat 0.56 s.apple-mcc 220000000.memory-controllerbound toapple-mccand380500000.pmptoapple_pmp;0apple-mcc/mcc-boot-dmatimeout, not-ready, wait or detach messages.1failed unit in both (aurora-power-defaults.service),1kernel error-level line in both (the sameapple_sep ... matching unavailable this bootline), so0new failed units and0new kernel errors;0Oops/BUG/call-trace/SError/abort lines;0AVC denials (Arch ARM without SELinux:/sys/fs/selinuxabsent). The J713 returned to its daily boot with the same counts.Still to run
integration/auroraonce soc: apple: mcc: let the T6050 system level cache allocate #2518 lands, and confirm the pending retargeted CI run (dt-checks,host-tests,pmgr-pwrstate-kunit, plus re-triggeredsep-source) passes (SEP source checksrun 44967203260 already passed 6/6 on5b302458524f).5b302458524fwith#2539(7803302be7ee) and#2540(08fa25353657) on default kernel command line once the companion Aura loader populatesregfrom/arm-io/mccamcc-enable-maskand setsstatus = "okay", exercising the MCC consumer paths inmcc.c/mcc-boot-dma.clive on hardware with0SELinux/AVC denials,0failed units, and0new kernel errors (the current-loadermcc-disabled boot at08fa25353657is already verified above).Assisted-by: LLM (Anthropic:Claude Opus 5.5, Anthropic:Claude Sonnet 5.5, Google:Gemini 4 Neon, OpenAI:GPT-6.2 Sol, Google:Gemini 4 Hydrogen)