summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorRussell King - ARM Linux <linux@arm.linux.org.uk>2011-01-11 16:35:56 +0000
committerChris Ball <cjb@laptop.org>2011-01-25 21:53:46 -0500
commit9047b435a0b43952f5d1f7eb15a9b63a36efc7f2 (patch)
tree065f85eb0a24659a3b79059c20e092afaaa3be08 /drivers/mmc
parent021cb59ae3869fb18ebc9fceb959f379c5ca835c (diff)
downloadlinux-stable-9047b435a0b43952f5d1f7eb15a9b63a36efc7f2.tar.gz
linux-stable-9047b435a0b43952f5d1f7eb15a9b63a36efc7f2.tar.bz2
linux-stable-9047b435a0b43952f5d1f7eb15a9b63a36efc7f2.zip
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')
-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,
host->cmd = NULL;
- cmd->resp[0] = readl(base + MMCIRESPONSE0);
- cmd->resp[1] = readl(base + MMCIRESPONSE1);
- cmd->resp[2] = readl(base + MMCIRESPONSE2);
- cmd->resp[3] = readl(base + MMCIRESPONSE3);
-
if (status & MCI_CMDTIMEOUT) {
cmd->error = -ETIMEDOUT;
} else if (status & MCI_CMDCRCFAIL && cmd->flags & MMC_RSP_CRC) {
cmd->error = -EILSEQ;
+ } else {
+ cmd->resp[0] = readl(base + MMCIRESPONSE0);
+ cmd->resp[1] = readl(base + MMCIRESPONSE1);
+ cmd->resp[2] = readl(base + MMCIRESPONSE2);
+ cmd->resp[3] = readl(base + MMCIRESPONSE3);
}
if (!cmd->data || cmd->error) {