Skip to contentSkip to conversation

MMCI: don't read command response when invalid

PATCH New Russell King - ARM Linux 2 participants 6 messages Jan 11, 2011 – Jan 27, 2011 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 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.

---
 drivers/mmc/host/mmci.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/mmc/host/mmci.c +5 -5
index 5630228..040de4f 100644
@@ -394,15 +394,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) {
#2 lore raw

PATCH 1/1 MMCI: don't read command response when invalid

Hi,

Quoted 24 lines · Russell King - ARM Linux

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.

---
 drivers/mmc/host/mmci.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/mmc/host/mmci.c +0 -5
index 5630228..040de4f 100644
@@ -394,15 +394,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;

drivers/mmc/host/mmci.c mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, · line 408

Quoted 10 lines
drivers/mmc/host/mmci.c +5 -0
 	} 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) {

Thanks, pushed to mmc-next and queued as a .38 fix.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child
#3 lore raw

PATCH 1/1 MMCI: don't read command response when invalid

Quoted 36 lines · Chris Ball

Hi,

Quoted 33 lines · Russell King - ARM Linux

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.

---
 drivers/mmc/host/mmci.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/mmc/host/mmci.c +5 -5
index 5630228..040de4f 100644
@@ -394,15 +394,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);
 	}
 
Quoted 3 lines

drivers/mmc/host/mmci.c mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, · line 408

Quoted 1 line
drivers/mmc/host/mmci.c +0 -0
 	if (!cmd->data || cmd->error) {

Thanks, pushed to mmc-next and queued as a .38 fix.

FYI, I've now merged this into the ARM devel tree for the time being so it doesn't get forgotten - which means it'll appear in linux-next at some point if it isn't already there. (Mainly so I don't have to keep on adding the patch.)

Once you push it into mainline, I'll drop my copy.

#4 lore raw

PATCH 1/1 MMCI: don't read command response when invalid

Hi Russell,

Quoted 6 lines · Russell King - ARM Linux

FYI, I've now merged this into the ARM devel tree for the time being so it doesn't get forgotten - which means it'll appear in linux-next at some point if it isn't already there. (Mainly so I don't have to keep on adding the patch.)

Once you push it into mainline, I'll drop my copy.

Okay. Sent this to Linus yesterday, just waiting for him to pull. (It's been in linux-next for the last two weeks.)

Thanks,

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child
#5 lore raw

PATCH 1/1 MMCI: don't read command response when invalid

Quoted 8 lines · Chris Ball

Hi Russell,

Quoted 5 lines · Russell King - ARM Linux

FYI, I've now merged this into the ARM devel tree for the time being so it doesn't get forgotten - which means it'll appear in linux-next at some point if it isn't already there. (Mainly so I don't have to keep on adding the patch.)

Quoted 4 lines
Quoted 1 line

Once you push it into mainline, I'll drop my copy.

Okay. Sent this to Linus yesterday, just waiting for him to pull. (It's been in linux-next for the last two weeks.)

It's present in mainline now.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child
#6 lore raw

PATCH 1/1 MMCI: don't read command response when invalid

Quoted 9 lines · Chris Ball
Quoted 8 lines · Chris Ball

Hi Russell,

Quoted 5 lines · Russell King - ARM Linux

FYI, I've now merged this into the ARM devel tree for the time being so it doesn't get forgotten - which means it'll appear in linux-next at some point if it isn't already there. (Mainly so I don't have to keep on adding the patch.)

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Once you push it into mainline, I'll drop my copy.

Okay. Sent this to Linus yesterday, just waiting for him to pull. (It's been in linux-next for the last two weeks.)

It's present in mainline now.

Thanks, dropped from my tree now.