Repository navigation
dmaengine: apple-piodma: stop binding tunneled PCIe-C PIODMA engines - #3845
Conversation
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>
|
Merge readiness at
Areas: none matched in CODEOWNERS Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
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.
|
Merging at |
What: Drop
"apple,pciec-piodma"fromapple_piodma_of_match[]indrivers/dma/apple-piodma.cso 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
f41cc5ef9c47docked on CalDigit TS5 (Aura1.0.0b18-gd8eb8ad4): clean boot (0failed units,eDP-1+DP-2,enP1p3s0up,522000000.dmaunbound even aftermodprobe apple-piodma), 2 consecutive dockedsystemctl reboots clean (~10–12 s each, no panic, clean journal); arm64 KUnitapple-piodma-stop4/4 passed;W=1compile andcheckpatch.pl --strictclean.Risk: two-way door · Macs with enabled USB4 PCIe-C PIODMA DT nodes (T8103, T8112, T8122, T8132, T600x, T603x, T604x); native
apple,pcie-piodmaunchanged.Not yet: native
apple,pcie-piodmasmoke test on a T6040/T8140 Mac (no hardware here).Details
apple-piodmamatched both native"apple,pcie-piodma"(3 register apertures) and tunneled"apple,pciec-piodma"(4 register apertures under&usb4_*_pcie_tunnel), while only implementing nativereg[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 beforeof_platform_depopulate()removes the children. The driver core (__device_release_driver()indrivers/base/dd.c) unconditionally callspm_runtime_get_sync()beforedriver->remove(), runningapple_piodma_runtime_resume()->apple_piodma_hw_init()and triggering an SError panic. On T8103 (J313), forcing runtime resume on522000000.dmaalso faults insideapple_piodma_hw_init()even while the PCIe-C tunnel is active.Dropping
"apple,pciec-piodma"fromapple_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 checkskunit.py run --arch arm64 --make_options LLVM=1 ... apple-piodma-stop: 4/4 passedmake ARCH=arm64 LLVM=1 W=1 drivers/dma/apple-piodma.o: 0 warnings1.0.0b18-gd8eb8ad4) atf41cc5ef9c47:522000000.dmaunbound at boot and aftermodprobe apple-piodmaeDP-1+DP-2connected,enP1p3s0up, 0 failed systemd unitssystemctl reboots: cleansystemd-journald: Journal stopped, ~10–12 s reboot turnaround, no panic, no unclean journal warning on next boot