Commit 0c98aa12 authored by Jarkko Lavinen's avatar Jarkko Lavinen Committed by Tony Lindgren

[PATCH] ARM: OMAP: Check for host->cmd being null when card status error occured

Check for host->cmd being null when card status error occured.

Also, I think it is a bit more cleaner to put the STOP cmd workaround
handling under the general OMAP_MMC_STAT_CARD_ERR handling.
parent ce1ae6db
...@@ -522,21 +522,19 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id, struct pt_regs *regs) ...@@ -522,21 +522,19 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id, struct pt_regs *regs)
} }
} }
if ((status & OMAP_MMC_STAT_CARD_ERR) if (status & OMAP_MMC_STAT_CARD_ERR) {
&& host->cmd->opcode == MMC_STOP_TRANSMISSION) { if (host->cmd && host->cmd->opcode == MMC_STOP_TRANSMISSION) {
u32 response = OMAP_MMC_READ(host->base, RSP6) u32 response = OMAP_MMC_READ(host->base, RSP6)
| (OMAP_MMC_READ(host->base, RSP7) << 16); | (OMAP_MMC_READ(host->base, RSP7) << 16);
/* STOP sometimes sets must-ignore bits */
/* STOP sometimes sets must-ignore bits */ if (!(response & (R1_CC_ERROR
if (!(response & (R1_CC_ERROR | R1_ILLEGAL_COMMAND
| R1_ILLEGAL_COMMAND | R1_COM_CRC_ERROR))) {
| R1_COM_CRC_ERROR))) { end_command = 1;
status &= ~OMAP_MMC_STAT_CARD_ERR; continue;
end_command = 1; }
} }
}
if (status & OMAP_MMC_STAT_CARD_ERR) {
// Card status error // Card status error
printk(KERN_DEBUG "MMC%d: Card status error (CMD%d)\n", printk(KERN_DEBUG "MMC%d: Card status error (CMD%d)\n",
host->id, host->cmd->opcode); host->id, host->cmd->opcode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment