Repository navigation
PCI: apple: retire the J713 tunneled port when its stop and undo both fail - #3208
Conversation
… fail When the noirq suspend of the J713 tunneled port fails partway, it puts the port back before refusing the sleep. If the dock left during the stop, that undo fails too, and the kernel panicked. End it as the T6050 stop and the resume already do: mark the port as failed and its hierarchy disconnected before the functions below resume and read their config space, and refuse the sleep. Config space stays closed, the tunnel teardown that follows removes the hierarchy and stops the port, and the ACIO host still ends the DART transaction. Fixes: 37c6514 ("PCI: apple: stop and restart the J713 tunneled port for a deep sleep") Signed-off-by: Dj <[email protected]>
|
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. |
|
J773g (M4 Mac mini) second-generation smoke at How it was run: a guarded one-shot of main No dock attach or detach: no Thunderbolt or USB4 device is connected to this Mac ( What was checked:
As you said, the changed unwind runs only on J713, so on this Mac the row shows only that nothing else changes. |
|
Verdict at Blockers: none Checked
Board gate on this path: it is behind Evidence
|
There was a problem hiding this comment.
Verdict: MERGE at cb4b537baacfc179af09877d1533fb3f50e5df53 once hardware evidence is complete.
Blockers: No code blocker found. Keep this unarmed until the J713 stop/undo double-failure and dock reattach are demonstrated, with docked peer smoke or the documented stand-in. The current J773g row had no dock.
Checked: Read the full diff and traced the noirq unwind, DART finish, disconnected child walk, and later quiesce. Successful recovery and the original suspend return value are preserved. On a failed recovery, config remains closed, the existing resume_failed finish path still ends the DART transaction, and needs_stop is left for teardown. Reviewed the green head CI. The patch adds no board gating, bindings, private material, or attribution.
RyanTheTide
left a comment
There was a problem hiding this comment.
Merge-train approval (last-push review of the merge-up delta, under the merge bar). 4050251b merges current main on top of the reviewed code. Rows: App-approved, J773g-2nd-gen(cb4b537)+J713-target. Merging once hosted CI is green.
|
Merging at |
What: When the J713 tunneled port's noirq suspend fails partway and its undo fails too, which is what happens if the dock leaves during the stop, the kernel panicked. Now the port is retired as after a surprise removal and the sleep is refused, the same way the T6050 stop and the resume path already handle it.
Tested: The changed object builds with W=1 on an arm64 16K-page config at
cb4b537baacf. No hardware row yet.Risk: two-way · J713 (M4) with a Thunderbolt dock. Only the path where both the stop and its undo fail changes.
Not yet: A J713 row: dock removed while the suspend stops the port, then plugged back in. A J773g dock attach, detach and sleep smoke (this path runs only on J713).
Details
resume_failedand callsapple_pcie_tunnel_hierarchy_gone(), before the PM core resumes the functions below. They are marked disconnected, so their config reads fail fast. Config space also stays closed, becausecio_changedstays set.apple_pcie_tunnel_cio_finish()already treatsresume_failedas a retired port. It ends the DART transaction and returns 0.port->needs_stopstays set from the undo, so the tunnel teardown that follows (apple_pcie_tunnel_quiesce()) removes the hierarchy and stops the port.apple_pcie_cio_suspend_t6050()and theresume_noirqfailure path.Evidence
./linux-build/build kernel linux-pciewifi-fixes -- -j3 W=1 drivers/pci/controller/pcie-apple.o(pcie-apple-cio.cis included there) withCONFIG_ARM64_16K_PAGES=y: no warnings.scripts/checkpatch.pl --strict: clean.40e5e29cc915.