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

CQE improvements for 6.6 #6591

Merged
merged 5 commits into from
Jan 10, 2025
Merged

Conversation

P33M
Copy link
Contributor

@P33M P33M commented Jan 8, 2025

The decision has been taken to soft-disable CQ on SD cards. Don't enable CQ unless there's a matching CID with a proven implementation.

To aid testing, and additionally let CM5 users control CQ, override the upstream boolean supports-cqe to a one-cell property which tristates probe behaviour, and add/modify the sd_cqe dtparam to suit.

The slight wart is the wonky way in which sdhci-brcmstb parts out the platform support from MMC/SD layer probe, which means it needs to comprehend the downstream DT modification.

P33M added 2 commits January 8, 2025 15:02
We want to be able to control the interop surface exposed by Command
Queueing across bcm2712 products to a more restrictive default, with
selectable disable and permissive behaviour.

Changing the bool to a cell lets it relay a tristate value.

Also add the override parameter to CM5 as CM5-lite may interface with
arbitrary eMMC or SD cards.

Signed-off-by: Jonathan Bell <[email protected]>
We have found that many SD cards in the field, even of the same make and
model, have latent bugs in their CQ implementation. Some product lines
have fewer bugs with newer manufacture dates, but this is not a
guarantee that a particular card is at a particular firmware revision
level.

Many of these bugs lead to card hangs or data corruption. Add a quirk to
mark a card as having a tested, working CQ implementation and ignore the
capability if absent.

Signed-off-by: Jonathan Bell <[email protected]>
@P33M
Copy link
Contributor Author

P33M commented Jan 8, 2025

I will need to test on CM5 hardware, that means finding lite and eMMC samples...

P33M added 2 commits January 9, 2025 15:57
These cards have a known-good CQ implementation and are based on a
Longsys product. Add the MANFID for Longsys SD, and the particular CID
details for the Pi card.

Signed-off-by: Jonathan Bell <[email protected]>
Implement a tristate-style option for "supports-cqe". If the property is
absent or zero, disable CQ completely. For 1, enable CQ unconditionally
for eMMC cards, and known-good SD cards. For 2, enable for eMMC cards,
and all SD cards that are not known-bad.

The sdhci-brcmstb driver needs to know about the tristate as its probe
sequence would otherwise override a disable in mmc_of_parse().

Signed-off-by: Jonathan Bell <[email protected]>
@P33M P33M force-pushed the sd_cqe_allowlist_6.6 branch from 823042c to b99aad1 Compare January 9, 2025 15:58
@P33M
Copy link
Contributor Author

P33M commented Jan 9, 2025

Testing did reveal that the 32GB cards have a lower CID hwrev/fwrev than the 64GB cards. Which is quite annoying, as this CID is shared by the Amazon Basics cards that don't implement CQ - however, allowing these is benign as they get filtered by the mandatory features list.

@pelwell pelwell merged commit e72f42e into raspberrypi:rpi-6.6.y Jan 10, 2025
11 of 12 checks passed
@P33M P33M mentioned this pull request Jan 10, 2025
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Jan 10, 2025
kernel: CQE improvements for 6.6
See: raspberrypi/linux#6591

kernel: Handle PIO probe failures (i.e. old EEPROMs)
See: raspberrypi/linux#6599
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Jan 10, 2025
kernel: CQE improvements for 6.6
See: raspberrypi/linux#6591

kernel: Handle PIO probe failures (i.e. old EEPROMs)
See: raspberrypi/linux#6599
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.

2 participants