mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
drivers: mmc: core: handle card-removal when running CQE recovery
Recovery claims the MMC card so the card-detect work gets significantly delayed - leading to lots of error recovery loops that can never do anything but fail. Explicitly detect the card after CQE has halted and bail if it's not there. Also ratelimit a not-very-descriptive warning - one occurrence in dmesg is enough to signal that something is amiss. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
This commit is contained in:
committed by
Dom Cobley
parent
3addc60d27
commit
456eebd7d3
@@ -551,10 +551,18 @@ int mmc_cqe_recovery(struct mmc_host *host)
|
||||
* Recovery is expected seldom, if at all, but it reduces performance,
|
||||
* so make sure it is not completely silent.
|
||||
*/
|
||||
pr_warn("%s: running CQE recovery\n", mmc_hostname(host));
|
||||
pr_warn_ratelimited("%s: running CQE recovery\n", mmc_hostname(host));
|
||||
|
||||
host->cqe_ops->cqe_recovery_start(host);
|
||||
|
||||
err = mmc_detect_card_removed(host);
|
||||
if (err) {
|
||||
host->cqe_ops->cqe_recovery_finish(host);
|
||||
host->cqe_ops->cqe_off(host);
|
||||
mmc_retune_release(host);
|
||||
return err;
|
||||
}
|
||||
|
||||
memset(&cmd, 0, sizeof(cmd));
|
||||
cmd.opcode = MMC_STOP_TRANSMISSION;
|
||||
cmd.flags = MMC_RSP_R1B_NO_CRC | MMC_CMD_AC; /* Ignore CRC */
|
||||
|
||||
Reference in New Issue
Block a user