aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/mmci.c
diff options
context:
space:
mode:
authorRussell King - ARM Linux <linux@arm.linux.org.uk>2011-01-11 11:35:56 -0500
committerChris Ball <cjb@laptop.org>2011-01-25 21:53:46 -0500
commit9047b435a0b43952f5d1f7eb15a9b63a36efc7f2 (patch)
tree065f85eb0a24659a3b79059c20e092afaaa3be08 /drivers/mmc/host/mmci.c
parent021cb59ae3869fb18ebc9fceb959f379c5ca835c (diff)
mmc: mmci: don't read command response when invalid
Don't read the command response from the registers when either the command timed out (because there was no response from the card) or the checksum on the response was invalid. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/mmci.c')
-rw-r--r--drivers/mmc/host/mmci.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 2de12fe155da..4b8dcd5b2a01 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -342,15 +342,15 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd,
342 342
343 host->cmd = NULL; 343 host->cmd = NULL;
344 344
345 cmd->resp[0] = readl(base + MMCIRESPONSE0);
346 cmd->resp[1] = readl(base + MMCIRESPONSE1);
347 cmd->resp[2] = readl(base + MMCIRESPONSE2);
348 cmd->resp[3] = readl(base + MMCIRESPONSE3);
349
350 if (status & MCI_CMDTIMEOUT) { 345 if (status & MCI_CMDTIMEOUT) {
351 cmd->error = -ETIMEDOUT; 346 cmd->error = -ETIMEDOUT;
352 } else if (status & MCI_CMDCRCFAIL && cmd->flags & MMC_RSP_CRC) { 347 } else if (status & MCI_CMDCRCFAIL && cmd->flags & MMC_RSP_CRC) {
353 cmd->error = -EILSEQ; 348 cmd->error = -EILSEQ;
349 } else {
350 cmd->resp[0] = readl(base + MMCIRESPONSE0);
351 cmd->resp[1] = readl(base + MMCIRESPONSE1);
352 cmd->resp[2] = readl(base + MMCIRESPONSE2);
353 cmd->resp[3] = readl(base + MMCIRESPONSE3);
354 } 354 }
355 355
356 if (!cmd->data || cmd->error) { 356 if (!cmd->data || cmd->error) {