1 From 0bb775b407dab3bab972663ef47dde38b0d34c24 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Mon, 20 Jul 2015 17:32:18 +0100
4 Subject: [PATCH 130/171] bcm2835-sdhost: Ignore CRC7 for MMC CMD1
6 It seems that the sdhost interface returns CRC7 errors for CMD1,
7 which is the MMC-specific SEND_OP_COND. Returning these errors to
8 the MMC layer causes a downward spiral, but ignoring them seems
11 drivers/mmc/host/bcm2835-sdhost.c | 39 +++++++++++++++++++++++----------------
12 1 file changed, 23 insertions(+), 16 deletions(-)
14 --- a/drivers/mmc/host/bcm2835-sdhost.c
15 +++ b/drivers/mmc/host/bcm2835-sdhost.c
16 @@ -959,25 +959,32 @@ static void bcm2835_sdhost_finish_comman
17 mmc_hostname(host->mmc), sdcmd, sdhsts,
18 bcm2835_sdhost_read(host, SDEDM));
20 - if (sdhsts & SDHSTS_CMD_TIME_OUT) {
21 - switch (host->cmd->opcode) {
22 - case 5: case 52: case 53:
23 - /* Don't warn about SDIO commands */
26 - pr_err("%s: command timeout\n",
27 + if ((sdhsts & SDHSTS_CRC7_ERROR) &&
28 + (host->cmd->opcode == 1)) {
30 + pr_info("%s: ignoring CRC7 error for CMD1\n",
31 + mmc_hostname(host->mmc));
33 + if (sdhsts & SDHSTS_CMD_TIME_OUT) {
34 + switch (host->cmd->opcode) {
35 + case 5: case 52: case 53:
36 + /* Don't warn about SDIO commands */
39 + pr_err("%s: command timeout\n",
40 + mmc_hostname(host->mmc));
43 + host->cmd->error = -ETIMEDOUT;
45 + pr_err("%s: unexpected command error\n",
46 mmc_hostname(host->mmc));
48 + bcm2835_sdhost_dumpregs(host);
49 + host->cmd->error = -EIO;
51 - host->cmd->error = -ETIMEDOUT;
53 - pr_err("%s: unexpected command error\n",
54 - mmc_hostname(host->mmc));
55 - bcm2835_sdhost_dumpregs(host);
56 - host->cmd->error = -EIO;
57 + tasklet_schedule(&host->finish_tasklet);
60 - tasklet_schedule(&host->finish_tasklet);
64 if (host->cmd->flags & MMC_RSP_PRESENT) {