Skip to content

Commit

Permalink
bcm2835-sdhost: Ignore CRC7 for MMC CMD1
Browse files Browse the repository at this point in the history
It seems that the sdhost interface returns CRC7 errors for CMD1,
which is the MMC-specific SEND_OP_COND. Returning these errors to
the MMC layer causes a downward spiral, but ignoring them seems
to be harmless.
  • Loading branch information
Phil Elwell committed Jul 21, 2015
1 parent a5b4fab commit 48d4fef
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions drivers/mmc/host/bcm2835-sdhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -959,25 +959,32 @@ static void bcm2835_sdhost_finish_command(struct bcm2835_host *host)
mmc_hostname(host->mmc), sdcmd, sdhsts,
bcm2835_sdhost_read(host, SDEDM));

if (sdhsts & SDHSTS_CMD_TIME_OUT) {
switch (host->cmd->opcode) {
case 5: case 52: case 53:
/* Don't warn about SDIO commands */
break;
default:
pr_err("%s: command timeout\n",
if ((sdhsts & SDHSTS_CRC7_ERROR) &&
(host->cmd->opcode == 1)) {
if (host->debug)
pr_info("%s: ignoring CRC7 error for CMD1\n",
mmc_hostname(host->mmc));
} else {
if (sdhsts & SDHSTS_CMD_TIME_OUT) {
switch (host->cmd->opcode) {
case 5: case 52: case 53:
/* Don't warn about SDIO commands */
break;
default:
pr_err("%s: command timeout\n",
mmc_hostname(host->mmc));
break;
}
host->cmd->error = -ETIMEDOUT;
} else {
pr_err("%s: unexpected command error\n",
mmc_hostname(host->mmc));
break;
bcm2835_sdhost_dumpregs(host);
host->cmd->error = -EIO;
}
host->cmd->error = -ETIMEDOUT;
} else {
pr_err("%s: unexpected command error\n",
mmc_hostname(host->mmc));
bcm2835_sdhost_dumpregs(host);
host->cmd->error = -EIO;
tasklet_schedule(&host->finish_tasklet);
return;
}
tasklet_schedule(&host->finish_tasklet);
return;
}

if (host->cmd->flags & MMC_RSP_PRESENT) {
Expand Down

0 comments on commit 48d4fef

Please sign in to comment.