Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PCI: brcmstb: Enable CRS software visibility after linkup #5889

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

P33M
Copy link
Contributor

@P33M P33M commented Jan 24, 2024

This fell out of the discussions around "why does the bootloader nvme probe behave differently to Linux" - as part of aligning the behaviours of both, we should make maximal use of the features offered by the RC.

The RC supports neither Device Readiness nor Function Readiness notifications, therefore we should use a combination of the 100ms grace period after link-up with CRS.

EPs are permitted to issue Retry statuses for up to 1 second, which if CRSSVE=0 will
a) completely stall the CPU until the Ubus/completion timeout is reached (<1s, but some tens of milliseconds)
b) cause the RC to return 0xffffffff for reads of the vendor ID register instead of 0xffff0001 which will cause probe failure instead of retrying up to the 1 second limit.

For some reason the associated root complex register bit is reset by perst_n, so enable it after link-up.

@timg236
Copy link
Contributor

timg236 commented Jan 24, 2024

Is this something that we'd backport to 6.1?

@P33M
Copy link
Contributor Author

P33M commented Jan 24, 2024

As we're about to do one final 6.1 release, no - this needs more soak testing with various PCIe not-HAT setups.

It appears that bits in the Root Control Register are reset with
perst_n, which means the PCI layer's call to enable CRS prior to
adding/scanning the bus has no effect. Open-code the enable in
brcm_pcie_start_link as a workaround.

Without CRS visibility, configuration reads issued by the CPU don't
retire if the endpoint returns a CRS response - the RC will poll until a
(large) timeout is reached. This means the core can stall for a long
time during boot.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
@pelwell pelwell merged commit 5c67103 into raspberrypi:rpi-6.6.y Feb 12, 2024
12 checks passed
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Feb 13, 2024
See: raspberrypi/linux#5930

kernel: drm/vc4: Disable overrun interrupts
See: raspberrypi/linux#5935

kernel: drivers: thermal: step_wise: add support for hysteresis
See: raspberrypi/linux#5936

kernel: media: rp1: cfe: Actually use the number of lanes configured
See: raspberrypi/linux#5941

kernel: PCI: brcmstb: Enable CRS software visibility after linkup
See: raspberrypi/linux#5889

kernel: SDHCI vs EMMC on Pi 5
See: raspberrypi/linux#5937
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Feb 13, 2024
See: raspberrypi/linux#5930

kernel: drm/vc4: Disable overrun interrupts
See: raspberrypi/linux#5935

kernel: drivers: thermal: step_wise: add support for hysteresis
See: raspberrypi/linux#5936

kernel: media: rp1: cfe: Actually use the number of lanes configured
See: raspberrypi/linux#5941

kernel: PCI: brcmstb: Enable CRS software visibility after linkup
See: raspberrypi/linux#5889

kernel: SDHCI vs EMMC on Pi 5
See: raspberrypi/linux#5937
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants