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

mmc: block: Don't do single-sector reads during recovery #5036

Merged
merged 1 commit into from
May 16, 2022

Conversation

P33M
Copy link
Contributor

@P33M P33M commented May 16, 2022

See #5019

If an SD card has degraded performance such that IO operations time out
then the MMC block layer will leak SG DMA mappings during recovery. It
retries the same SG and this causes the leak, as it is mapped twice -
once in sdhci_pre_req() and again during single-block reads in
sdhci_prepare_data().

Resetting the card (including power-cycling if a regulator for vmmc is
present) ought to be enough to recover a stuck state, so for now remove
the call to mmc_blk_read_single().

Signed-off-by: Jonathan Bell [email protected]

@pelwell
Copy link
Contributor

pelwell commented May 16, 2022

Using if (0 && !mmc_large_sector(card) ... instead avoids a compiler warning and makes it clear that something non-standard is happening.

@ghost
Copy link

ghost commented May 16, 2022

makes it clear that something non-standard is happening.

You probably want a comment as well, particularly if this is something that is intended to be fixed/improved in the future.

See raspberrypi#5019

If an SD card has degraded performance such that IO operations time out
then the MMC block layer will leak SG DMA mappings in the swiotlb during
recovery. It retries the same SG and this causes the leak, as it is
mapped twice - once in sdhci_pre_req() and again during single-block
reads in sdhci_prepare_data().

Resetting the card (including power-cycling if a regulator for vmmc is
present) ought to be enough to recover a stuck state, so for now don't
try single-block reads in the recovery path.

Signed-off-by: Jonathan Bell <[email protected]>
@pelwell pelwell merged commit dff79e3 into raspberrypi:rpi-5.15.y May 16, 2022
popcornmix added a commit to raspberrypi/firmware that referenced this pull request May 16, 2022
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request May 16, 2022
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