Repository navigation
arm64: keep J713 GPU/DCP non-coherent when CLIDR_EL1.LoC == 0 (fixes J713 graphics on 7.3) - #429
Conversation
RyanTheTide
left a comment
There was a problem hiding this comment.
I checked the LoC-zero override, the explicit firmware-property guard and each device that the J713 GPU and display admission paths inspect. The ordinary LoC-nonzero path is unchanged. This remains an Aurora carry with a wider arm64 effect, so the reference-Mac checks matter. The attribution check found no additional Gravity-derived implementation.
I pushed Ryan fixup 90c0d00eb5379 to permit dma-noncoherent in the GPU binding. That fixes the new J713 schema diagnostic. The J713 and J616s targeted binding/DTB checks now have no diagnostics, and the fixup is checkpatch-clean.
The combined tree passed apple-dcp 63/63 and Asahi KUnit 86/86. The first defconfig plus asahi.config WERROR build passed; the shipping and final fixup-tree builds are still running. This is not merge-ready until the M1 Pro/M2 one-shot checks pass and the common config dependency in #438 is reviewed.
|
Final software gates now pass on the combined tree containing these heads and the proposed common config correction in #438. Both defconfig plus asahi.config and the Fedora-base recipe build Image, modules and DTBs with WERROR enabled. The Fedora recipe also covers KUNIT=m. Every requested asahi.config setting survives resolution. Asahi KUnit passes 86/86 and apple-dcp host tests pass 63/63. The targeted J713/J616s binding and DTB checks have no diagnostics. The GPU binding fix is included and final source-style checks are clean. This remains not merge-ready until the M1 Pro/M2 candidate boots pass and #438 is reviewed. |
|
M2 no-regression qualification now passes with this head in the combined source tree 031f7dec92a1bef6b72509b08c5c597f50474adb. The approved one-shot ran 7.3.0-aurora-t3028. A native Apple GPU compute/readback check verified all 4096 words, the checked kernel fault counters stayed at zero, and device counts, active services and SELinux enforcing matched the baseline. This uses the installed system Mesa to exercise the candidate kernel. The machine is back on 73w, where the same check passes again. The test kernel, its GRUB entry and fallback units have been removed. The saved default, boot.bin and pinned DTB setting are unchanged. The M1 Pro candidate check and the #438 common-config review are still outstanding, so this remains not merge-ready. |
|
Final qualification for 90c0d00eb53799ed927526d90a4425ec07a9baa6. The combined test source is 031f7dec92a1bef6b72509b08c5c597f50474adb, tree 36854d3a72e4efdf2c352166498ab436adaf3c48. Both defconfig plus asahi.config and the Fedora-base shipping recipe pass the full Image/modules/DTB build with WERROR enabled. Every requested fragment value survives olddefconfig. Asahi KUnit passes 86/86, apple-dcp host tests pass 63/63, and targeted J713/J616s binding/DTB checks have no diagnostics. Strict source-style checks pass; commit sign-offs are checked separately. The attribution audit found no new material Gravity implementation blocks. Existing GPL-2.0-only Cody Ho and Niklas Sheth credit is preserved. The same candidate image passed approved M1 Pro and M2 one-shot smoke checks against fresh normal baselines. Native GPU compute/readback verified all 4096 words on each device, kernel fault counters stayed at zero, and baseline devices, active services and SELinux enforcing were preserved. Both machines are back on 73w with the checks passing again. Test kernels, task GRUB entries and fallback units are removed. The saved defaults, stock boot.bin files and pinned DTB setting are unchanged. Ryan fixup 90c0d00eb5379 permits the standard dma-noncoherent GPU property and removes the J713 schema diagnostic. No code hold remains. Not merge-ready yet because #438 still needs the required common-config review. |
|
I rechecked the LoC-zero exception and the four J713 nodes that request non-coherent DMA. The exception is limited to devices with an explicit firmware property, but the arm64 code is shared and T6040 already has a matching display annotation. The PR's J713 GPU/display boot is the board proof. Earlier M1 Pro/M2 checks used a different combined tree. The stacked kernel at The full J713 DTB check rejects Keep it behind the shared-code regression boot on Neo, with display/GPU compute, cache/DMA fault checks and a return to the normal kernel. Include the J616s display owner in rollout because its existing annotation takes effect too. Merge with the reviewed #394 common recipe before the #449 sleep combination. |
|
The reviewed head 90c0d00eb537 applies cleanly on the qualified base. The J713 loaded-image KUnit case now runs and passes with G16 explicitly enabled in the test configuration. On integration/aurora at 421e314 with shared #438 and #456, DCP is PASS (63/63). KUnit has 905 passes and 1 policy skips. Universal WERROR is PASS; Fedora-base WERROR is PASS. Software gates pass; hardware and shared #438/#456 review pending. The operator reports #456 passed all 63 host groups with stock make 3.81 and GNU Make; this worker did not rerun native macOS on the assembled base. Hardware still needed: Neo LoC-zero DMA/GPU/display; M1 Pro/M2 regression and separate J713 proof. |
|
Added 88a7baebcc6f: I reran the check on all six T8132 DTBs ( |
88a7bae to
1399c49
Compare
|
@jgoyvaerts this makes the J616s |
|
Not tested with it. That annotation has never taken effect on J616s: the display has only ever run coherent, on 7.3 with the LoC override, so this would be a new configuration rather than a return to 7.2. It would also be a mix, because |
…stem The J616s display-subsystem node says dma-noncoherent, but on 7.3 the CLIDR_EL1.LoC == 0 override has made it coherent anyway, and the J616s display has only ever run that way, as have its dcp and piodma nodes. Remove the property so the display keeps the coherent setup it was brought up on once the arm64 DMA code respects an explicit dma-noncoherent property again. A non-coherent J616s display can be qualified separately. No change in behaviour. Signed-off-by: Erik Bourget <erik@ebourget.net>
…LoC == 0 Commit 233b555 ("arm64: mm: Treat all devices as dma-coherent when CLIDR_EL1.LoC == 0") makes every device coherent when CLIDR_EL1.LoC is zero, including devices whose firmware node says "dma-noncoherent". Apple T8132 (M4) reports LoC == 0, so on 7.3 every M4 device becomes coherent. The J713 G16 GPU and DCP display paths were brought up and qualified on non-coherent DMA only, and they refuse coherent devices by design: asahi_g16_dma_unsupported() fails G16 admission, and apple_dart_dcp_shared_pair() returns -ENODEV for the DCP D451 memory callback, so IOMFB startup fails. A J713 on integration/aurora boots with no GPU and no display. Respect an explicit "dma-noncoherent" property and apply the LoC rule only to devices without one. Devices with no annotation are still treated as coherent. The change only matters where the LoC rule applies, on CPUs that report LoC == 0. The other arm64 device trees that use dma-noncoherent are Allwinner, NXP and Rockchip SoCs, whose Cortex-A55/A76 CPUs report a non-zero LoC, so the rule never applies to them. The T6040 display subsystem drops its annotation in the previous patch, so nothing else changes. The once-per-boot notice for the LoC rule now names the exception. Tested on J713 (MacBook Air 13" M4, 8-core GPU). Signed-off-by: Erik Bourget <erik@ebourget.net>
The J713 G16 GPU, DCP, PIODMA and display scanout drivers only support non-coherent DMA and refuse coherent devices. Before 7.3 that was the arm64 default. Since commit 233b555 ("arm64: mm: Treat all devices as dma-coherent when CLIDR_EL1.LoC == 0"), T8132 devices become coherent unless their node says otherwise. Mark these nodes dma-noncoherent so they keep the DMA path they were qualified on. Signed-off-by: Erik Bourget <erik@ebourget.net>
The J713 GPU now declares dma-noncoherent to retain its qualified DMA path on CPUs with LoC zero. Permit that standard property in the GPU binding so the device tree validates against the same contract. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The J713 DCP controller and its piodma child declare dma-noncoherent to keep the non-coherent DMA path they were qualified on when the CPU reports LoC zero. Permit that standard property at both levels so the J713 device tree validates. Signed-off-by: Erik Bourget <erik@ebourget.net>
1399c49 to
6832149
Compare
|
Thanks. Done: the new first patch drops |
|
Merging as it is, no changes. This comment is from Claude Opus 5.5, working for Eryk, not from Eryk himself. It still merges cleanly, and integration/aurora still has the blanket Testing
🤖 Written by Claude Opus 5.5 (in Claude Code) for Eryk. |
139677f
into
aurora-silicon:integration/aurora
On integration/aurora (7.3), a J713 (MacBook Air 13" M4) boots, but has no GPU and no display. Both failures come from one upstream change.
What breaks
7.3 brought in 233b555 ("arm64: mm: Treat all devices as dma-coherent when CLIDR_EL1.LoC == 0"). T8132 reports LoC == 0, so
arch_setup_dma_ops()now makes every device coherent, including ones whose DT node saysdma-noncoherent.The J713 G16 and DCP paths were brought up and qualified on non-coherent DMA only. They refuse coherent devices on purpose:
asahi_g16_dma_unsupported()(drivers/gpu/drm/asahi/g16/glue.c) fails admission withG16: unsupported coherent, IOMMU or custom DMA path→-EINVAL, so there's no render node.apple_dart_dcp_shared_pair()(drivers/iommu/apple-dart-dcp-shared.h) returns-ENODEVfor the DCP D451 memory callback. The log showsDCP callback D451 … dispatch failed: -19→Retained DCP session quarantined→IOMFB startup failed: -19, so there's no apple-drm.The scanout allocator (
apple-dart-dcp-scanout.h) anddcpext_scanout.chave the same check.Older SoCs and the other Apple drivers don't check coherency, which is presumably why J700 and M4 Pro testing on 7.3 didn't hit this. #400 hadn't been booted on a J713 before this.
Fix
dma-noncoherentfrom the J616sdisplay-subsystem. The J616s display has only run coherent, so it stays that way under patch 1.dma-noncoherent. Devices without that property behave exactly as upstream 7.3 does.gpu,dcp,dcp/piodmaanddisplay-subsystemdma-noncoherent. These are the devices those checks look at.This brings back the DMA path the J713 code was qualified on, without touching Eryk's drivers. The alternative is relaxing the coherency checks in G16 and DCP. That would change the memory attributes the firmware sees (for example,
apple_dart_dcp_allocaddsIOMMU_CACHEfor coherent devices), and it needs someone who knows why those checks are there.Effect on T6040: none.
t6040.dtsidisplay-subsystemhaddma-noncoherent, but under the LoC override it never took effect, and the J616s display has only ever run coherent, as have itsdcpandpiodma. As @jgoyvaerts asked, patch 0 removes the property, so the series doesn't change J616s. A non-coherent J616s display can be qualified separately.I don't expect patch 1 to go to mainline as it stands. Will's commit message treats a non-coherent device on a LoC == 0 system as a firmware bug, and warns about it. It's meant as an Aurora carry until G16/DCP either support the coherent path or are confirmed to need non-coherent DMA.
Testing
J713, 8-core GPU, integration/aurora 420a1c8 + these two patches + the #389 8-core hash:
apple-dcp 30ae00000.dcp: IOMFB startup complete: 255 callbacks, 2560x1664asahi-g16 302600000.gpu: G16: firmware at READY, starting the backendOpenGL renderer string: Apple M4 (G16G B0)with Mesa 26.3.0-devel (91ac7e2), Hyprland running.I also tested a plain revert of 233b555 on the same base, and it gives the same result.
Rebased onto 23827fe (2026-10-30). The base now reports the LoC rule once per boot (49b22c6). Patch 1 keeps that and words the notice as "treating devices not marked dma-noncoherent as DMA coherent". The per-device line stays at debug level. The rest is unchanged from the tested head, apart from patch 0, which was added after review. On the current base:
--strictis clean;arch/arm64/mmbuilds with W=1 at every commit;CHECK_DTBSgives the same 11 diagnostics as the base on all six T8132 DTBs and both T6040 DTBs;dma-noncoherent.Questions
CLIDR_EL1.LoC == 0, treating as coherentonce per device, about 380 lines per boot. It's harmless, but worth knowing about.