Repository navigation
PCI: apple: reset an endpoint that does not train (J616s SD reader flake) - #1069
Merged
Merged
Conversation
On the M4 Pro MacBook Pro (J616s) the SD reader behind root port 1 is missing after about one boot in seven: "pci@1,0 link didn't come up". The endpoint is detected but sends no training sets after the first PERST# release, and the LTSSM parks in Polling.Compliance (DesignWare PORT_DEBUG0 state 0x3). Starting the LTSSM or a Retrain Link from the root port does not bring it out; the reader stays absent until the next boot. When a conventional port with a single PERST# line does not report link-up within link_up_timeout, stop the LTSSM, assert PERST# again and release it with the timings of the first bring-up (Tperst of at least 100 us, 100 ms before configuration), then start the LTSSM once more. Do this at most twice. The intermediate failure is logged at info level with the LTSSM state; only a port that still does not train warns, as before. Tunneled ports keep their existing retry. On the J616s, the reader was absent in 9 of 60 boots before. With this change it was present in 25 of 25 boots; the first training attempt failed in 4 of them, and each time the link came up 15 ms after the first reset retry. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
RyanTheTide
added a commit
that referenced
this pull request
Nov 7, 2026
Brings aurora-wip up to integration/aurora 068dfce: pcie-apple endpoint reset retry (#1069) and the tools/aurora-sep PKGBUILD checksum fix (#1068). Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On the M4 Pro MacBook Pro (J616s) the SD reader (GL9755 behind
pcie0root port 1) is missing in about one boot in seven. The boot log showspci@1,0 link didn't come upand the reader stays absent until the next reboot. In the J616s journal, 9 of the last 60 boots (fleet17, all warm reboots) had the error, and the reader was missing in exactly those boots. The M1 Pro, with the same reader, had 0 of 60.Cause
On a good boot the link is already up about 100 ms after the first PERST# release. On a bad boot the endpoint is detected but sends no training sets, and the root port's LTSSM parks in Polling.Compliance (DesignWare
PORT_DEBUG0state 0x3). Neither the LTSSM start the driver already issues nor a Retrain Link from the root port (tried withsetpcion a failed boot) brings it out.Fix
When a conventional port with a single PERST# line does not report link-up within
link_up_timeout, the driver now:t-refclk-to-perst/perst-to-configvalues agree);It does this at most twice. The intermediate failure is logged at info level, with the LTSSM state. Only a port that still doesn't train warns, as before. The completion is re-armed before the reset, so a link-up that arrives during the reset isn't lost. Tunneled ports keep their existing retry.
Testing (J616s, 11-07)
7.3.0-aurora-sdlink1(fleet17 + this change), 25 one-shot reboots, reader present in 25/25. The first attempt failed in 4 of them (boots 10, 20, 21, 25). Each time the log showslink down after 500ms (LTSSM 0x3), resetting the endpoint, thenlink up after 15ms.sdhci-pcibound andmmc0present, SELinux enforcing, 0 AVC, 0 failed units. The boot-log err/warn lines are the same 4 as on fleet17.pcie-apple.oon integration68db611b(fleet17 config) and on the fleet17 tree; checkpatch--strictis clean.🤖 Generated with Claude Code