From 0c98aa1250b3f7b99983ed8e4ca2cf1cb6bdea73 Mon Sep 17 00:00:00 2001 From: Jarkko Lavinen Date: Tue, 26 Jul 2005 00:51:46 -0700 Subject: [PATCH] [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. --- drivers/mmc/omap.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/mmc/omap.c b/drivers/mmc/omap.c index 862ab26cf94..a6b843369a6 100644 --- a/drivers/mmc/omap.c +++ b/drivers/mmc/omap.c @@ -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) - && host->cmd->opcode == MMC_STOP_TRANSMISSION) { - u32 response = OMAP_MMC_READ(host->base, RSP6) + if (status & OMAP_MMC_STAT_CARD_ERR) { + if (host->cmd && host->cmd->opcode == MMC_STOP_TRANSMISSION) { + u32 response = OMAP_MMC_READ(host->base, RSP6) | (OMAP_MMC_READ(host->base, RSP7) << 16); - - /* STOP sometimes sets must-ignore bits */ - if (!(response & (R1_CC_ERROR - | R1_ILLEGAL_COMMAND - | R1_COM_CRC_ERROR))) { - status &= ~OMAP_MMC_STAT_CARD_ERR; - end_command = 1; + /* STOP sometimes sets must-ignore bits */ + if (!(response & (R1_CC_ERROR + | R1_ILLEGAL_COMMAND + | R1_COM_CRC_ERROR))) { + end_command = 1; + continue; + } } - } - if (status & OMAP_MMC_STAT_CARD_ERR) { // Card status error printk(KERN_DEBUG "MMC%d: Card status error (CMD%d)\n", host->id, host->cmd->opcode); -- 2.41.1