From: Jarkko Lavinen Date: Tue, 26 Jul 2005 07:51:46 +0000 (-0700) Subject: [PATCH] ARM: OMAP: Check for host->cmd being null when card status error occured X-Git-Tag: v2.6.13-omap1~65 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=0c98aa1250b3f7b99983ed8e4ca2cf1cb6bdea73;p=linux-2.6-omap-h63xx.git [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. --- 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);