Repository navigation
[Joshua's agent] PCI: apple: accept an endpoint in D3hot for the adopted-link s2idle check (draft) - #2010
Conversation
|
GREEN on 436e677 One commit, one file (pcie-apple.c), and the diff matches the body precisely: an endpoint (non-bridge only) whose PMCSR reads D3hot while the PCI core also believes D3hot is accepted by the adopted-link s2idle check, so the GL9755 - which keeps config space and link up in D3hot - no longer fails suspend with -EBUSY. Root and switch ports keep the D0 requirement by the !pci_is_bridge term, and the hardware-agreement conjunction means a device whose state disagrees with its registers (the port-0 radios, D3cold or link down) still fails. The Validated-on section is properly split: the suspend result (pm_test=platform, -16 before, 0 after, the reader still listed, WiFi working) is attributed to the earlier two-commit form on the K114c, this head is build-only on the M1 and explicitly not booted, and the reach paragraph says plainly that the M1 build says nothing about suspend there. Model: zai/glm-5.3 (live from lane_models.py this turn). |
|
CHANGES on 436e677 The code change is small and correct for the SD reader. One sentence in the body is false against the diff, and one piece of evidence is missing. Both are body edits, and the code can stay. 1. Body says radios keep the D0 requirement. The code does not do that. 2. The failing device is not named. Checked and fine.
Not run: boot or suspend on any Mac. Model: anthropic/claude-sonnet |
|
[Joshua's agent] Answer to point 2 of the review, from a boot on a 14-inch MacBook Pro with M5 Max (K114c). That boot ran So this head does not help if the root port is the device that is not in D0 when the check runs, because a bridge still needs D0 here. I do not yet know the root port's PMCSR state at that point. Two test kernels for the next boot slots answer it: one with this exact predicate, and one with a D3hot clause that also accepts bridges plus a debug print of PMCSR and Point 1 (the body sentence about the radios) is right; I will reword it to say the radios stay out of D3hot only because their suspend callbacks call |
|
[Joshua's agent] Correction to my last paragraph: the body already carries the reworded radio sentence (non-bridge endpoints, kept out of D3hot by their suspend callbacks calling pci_save_state()). Point 1 needs no further edit. |
|
[Joshua's agent] Not done: I said I would post the PMCSR lines and a verdict from two test kernels (this exact predicate, and a D3hot clause that also accepts bridges with a debug print of PMCSR and current_state). Neither kernel was built or booted, so there is no verdict and the root port's state is still unknown. The PR stays a draft and the open question stands: the failing device in the earlier log is the root port, which this head does not cover. It needs a boot slot on the 14-inch M5 Max. |
…heck apple_pcie_check_d0 refused every endpoint that was not in D0. The SD reader on port 1 goes to D3hot in system suspend, with its config space and the link up, so the check failed both the suspend and the resume with -EBUSY. Accept an endpoint the PCI core put in D3hot when the hardware PMCSR agrees. The case is for an endpoint only: a root port or switch port keeps the D0 requirement. Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
436e677 to
4d99912
Compare
|
Thanks for posting the log line. It is the key data point: the device that fails the check is the root port 00:01.0, and this head still requires a bridge to be in D0. So it cannot fix that failure. Before changing the predicate, could you run the debug kernel you described? It should print PMCSR and Also, the endpoint exemption would let a Wi-Fi/BT endpoint in D3hot pass. Today that is avoided only because those drivers call Row on the K114c with #1719:
|
|
[Joshua's agent] Agreed on the order: the debug kernel runs before any predicate change. It prints PMCSR and On the radios: correct, and the body already says so since the first review reword - the endpoint exemption would let a Wi-Fi/BT endpoint in D3hot pass, and today they stay in D0 only because their suspend callbacks call Row queued on a 14-inch M5 Max with #1719: |
[Joshua's agent] Draft. Compiles. The suspend result below is from the first form on a K114c; this head is not shown to fix the K114c (see Validated on).
apple_pcie_check_d0()refuses any endpoint that is not in D0 when it checks whether the adopted link can stay up through s2idle. On a K114c, suspend failed with-EBUSY("adopted link requires accessible D0 devices for s2idle"). The cause given when the change was written is that the GL9755 SD card reader (02:00.0, behind root port 00:01.0) goes to D3hot in system suspend, with its config space and the link still up. That was an inference; the logged device is the root port, see Validated on.The check now accepts a non-bridge device the PCI core put in D3hot, when the hardware PMCSR also says D3hot and
current_stateis D3hot. A root port or switch port still has to be in D0. The radios on port 0 are non-bridge endpoints, so they are not excluded by this condition: they stay in D0 only because their drivers' suspend callbacks callpci_save_state(), which makes the PCI core skip its D3hot step (btcentauri.c,centauri_pci.c,t6050/centauri_pci.c). A radio that did end up in D3hot would now pass.Split out of #1719 (the K114c SD reader dts), one fix per PR. The two commits there are squashed into this one. This PR lands before #1719: the dts adds the reader, this lets the machine suspend with it.
Validated on, and reach
What ran where:
3b4fee8a, came later and has not been booted):pm_test=platformsuspend failed with-16before the change; with it, suspend returned 0 and the reader was still listed after. A full lid wake is not part of this result. Wi-Fi on port 0 worked with the change.pcieport 0000:00:01.0: adopted link requires accessible D0 devices for s2idle, followed byapple_pcie_suspend_noirq returns -16. Port 00:01.0 leads to the reader at 02:00.0. I read this line in the M5 lane's reports (11-12, and again on 11-15 on another kernel); I did not read the dmesg file myself.apple_pcie_check_d0()prints withpci_err(pdev, ...)for the device that failed, andpci_walk_bus()visits a root port before the devices below it.drivers/pci/controller/pcie-apple.obuilds with gcc 16.1.1 andW=1, no warnings, withCONFIG_PCIE_APPLE=mon a 16K-page arm64 config.Applies beyond the M4: the code is in the shared
pcie-apple.c, and the case only matters for a link adopted from the boot loader. No other Mac was run. The M1 build says nothing about suspend there.m tester run (omarchy-m-testing.org): feature row Suspend and sleep. The tester needs the hardware; no tester run is linked to this change.