Skip to content

dmaengine: apple-piodma: stop binding tunneled PCIe-C PIODMA engines - #3845

Merged
RyanTheTide merged 1 commit into
mainfrom
fix/piodma-pciec-teardown
Dec 2, 2026
Merged

RyanTheTide merged 1 commit into
mainfrom
fix/piodma-pciec-teardown

Conversation

@erikwb

@erikwb erikwb commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

What: Drop "apple,pciec-piodma" from apple_piodma_of_match[] in drivers/dma/apple-piodma.c so tunneled PCIe-C PIODMA nodes do not bind until tunneled initialization and teardown ordering are implemented; keeps native "apple,pcie-piodma" and the DT hardware descriptions intact.
Tested: J313 (M1 MBA) at f41cc5ef9c47 docked on CalDigit TS5 (Aura 1.0.0b18-gd8eb8ad4): clean boot (0 failed units, eDP-1 + DP-2, enP1p3s0 up, 522000000.dma unbound even after modprobe apple-piodma), 2 consecutive docked systemctl reboots clean (~10–12 s each, no panic, clean journal); arm64 KUnit apple-piodma-stop 4/4 passed; W=1 compile and checkpatch.pl --strict clean.
Risk: two-way door · Macs with enabled USB4 PCIe-C PIODMA DT nodes (T8103, T8112, T8122, T8132, T600x, T603x, T604x); native apple,pcie-piodma unchanged.
Not yet: native apple,pcie-piodma smoke test on a T6040/T8140 Mac (no hardware here).

Details

apple-piodma matched both native "apple,pcie-piodma" (3 register apertures) and tunneled "apple,pciec-piodma" (4 register apertures under &usb4_*_pcie_tunnel), while only implementing native reg[0]/reg[2] initialization.

Because apple_piodma_probe() leaves the device runtime-suspended, the engine is untouched until the first runtime resume. During ACIO teardown on docked reboot or unplug (cd321x_reboot_notify -> typec_thunderbolt_switch_set -> apple_cio_stop -> of_platform_depopulate), apple_cio_stop_pcie_tunnel() stops the PCIe-C port clock before of_platform_depopulate() removes the children. The driver core (__device_release_driver() in drivers/base/dd.c) unconditionally calls pm_runtime_get_sync() before driver->remove(), running apple_piodma_runtime_resume() -> apple_piodma_hw_init() and triggering an SError panic. On T8103 (J313), forcing runtime resume on 522000000.dma also faults inside apple_piodma_hw_init() even while the PCIe-C tunnel is active.

Dropping "apple,pciec-piodma" from apple_piodma_of_match[] keeps the DT nodes and binding intact as hardware descriptions while immediately fixing all affected SoCs and already-installed Stage 2 DTBs without requiring a reflash.

Evidence
  • scripts/checkpatch.pl --strict --git origin/main..HEAD: 0 errors, 0 warnings, 0 checks
  • kunit.py run --arch arm64 --make_options LLVM=1 ... apple-piodma-stop: 4/4 passed
  • make ARCH=arm64 LLVM=1 W=1 drivers/dma/apple-piodma.o: 0 warnings
  • J313 (M1 MBA, CalDigit TS5 dock, Aura 1.0.0b18-gd8eb8ad4) at f41cc5ef9c47:
    • 522000000.dma unbound at boot and after modprobe apple-piodma
    • eDP-1 + DP-2 connected, enP1p3s0 up, 0 failed systemd units
    • 2 consecutive docked systemctl reboots: clean systemd-journald: Journal stopped, ~10–12 s reboot turnaround, no panic, no unclean journal warning on next boot

apple-piodma matches both native "apple,pcie-piodma" and tunneled
"apple,pciec-piodma" nodes, but only implements native PIODMA
initialization (reg[0] engine and reg[2] fabric). It does not handle the
tunneled PCIe-C clock lifecycle or its fourth aperture.

Because probe leaves the device runtime-suspended, the engine is never
touched until the first runtime resume. During ACIO teardown on docked
reboot or unplug (cd321x_reboot_notify -> typec_thunderbolt_switch_set ->
apple_cio_stop -> of_platform_depopulate), apple_cio_stop_pcie_tunnel()
stops the PCIe-C port clock before of_platform_depopulate() removes the
children. The driver core's __device_release_driver() unconditionally
calls pm_runtime_get_sync() before driver->remove(), running
apple_piodma_runtime_resume() -> apple_piodma_hw_init() and triggering an
SError panic. On T8103 (J313), forcing runtime resume on 522000000.dma
also faults inside apple_piodma_hw_init() even while the PCIe-C tunnel is
active.

Drop "apple,pciec-piodma" from apple_piodma_of_match[] until tunneled
PCIe-C PIODMA initialization and teardown ordering are implemented and
verified on hardware. Native "apple,pcie-piodma" engines are unaffected,
and leaving the DT nodes intact allows already-installed Stage 2 DTBs to
recover without reflashing.

Fixes: a3e4296 ("dmaengine: apple: add PCIe PIODMA memcpy provider")
Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb
erikwb requested review from a team as code owners December 1, 2026 22:40
@erikwb
erikwb requested review from LiamRay11 and maralcbr December 1, 2026 22:40
@github-actions github-actions Bot added blast:m1 Macs affected, from Merge risk (bot) blast:m2 Macs affected, from Merge risk (bot) blast:m3 Macs affected, from Merge risk (bot) blast:m4 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) labels Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Merge readiness at f41cc5ef: ready to merge

Check Detail
CI at head ok 3 checks passed
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head ok in the PR body at f41cc5ef
Conflicts ok none
PR text ok Risk: two-way · Macs with enabled USB4 PCIe-C PIODMA DT nodes (T8103, T8112, T8122, T8132, T600x, T603x, T604x); native apple,pcie-piodma unchanged.

Areas: none matched in CODEOWNERS
Merge: gh pr merge 3845 --merge (Owners and Core through the bypass: add --admin).

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

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Dec 1, 2026

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the complete diff at f41cc5e. Removing the tunneled compatible also removes its module alias and prevents the driver-core unbind path from runtime-resuming that engine through apple_piodma_hw_init(). The native compatible, register mapping, and DT descriptions are unchanged. No blocking code finding. The J313 docked boots cover the failing route. Keep the native T8140 or T6040 smoke row and the host-tests retry as the remaining merge evidence.

@github-actions github-actions Bot removed ci-failing A check failed at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 1, 2026
@github-actions github-actions Bot added the ready-to-merge Meets the merge policy: merge it (bot) label Dec 2, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging at f41cc5ef9c47 (B2 merge train, 12-01 merge bar). Approval at this head: DjDeveloperr. Row: the hardware row at f41cc5e that the readiness check found (PR body or comment). CI: train L20 = main f53f2fe + #3857 #3845: Apple build + changed .c objects pass, KUnit dcp-fabric/dcp-topology/dcp-display pass, host tests apple-dcp/dcp 91 ok Revert: git revert -m 1 <merge commit>.

@RyanTheTide
RyanTheTide merged commit 65c41b7 into main Dec 2, 2026
5 of 6 checks passed
@RyanTheTide
RyanTheTide deleted the fix/piodma-pciec-teardown branch December 2, 2026 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blast:m1 Macs affected, from Merge risk (bot) blast:m2 Macs affected, from Merge risk (bot) blast:m3 Macs affected, from Merge risk (bot) blast:m4 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) ready-to-merge Meets the merge policy: merge it (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants