From: Jarkko Lavinen Date: Fri, 1 Jul 2005 12:18:44 +0000 (-0700) Subject: [PATCH] ARM: OMAP: Fix end of card MMC error X-Git-Tag: v2.6.13-omap1~80 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=3941895277759a2cf684902a567bb40da3657a71;p=linux-2.6-omap-h63xx.git [PATCH] ARM: OMAP: Fix end of card MMC error The MMC spev v4.1 has table 23 on page 65 listing the valid response bits from each command. The table specifies CMD12 response not containing bit 31 (address out of range) and only 23, 22, and 20 (command crc, illegal command and card error) error bits and some status bits are defined. --- diff --git a/drivers/mmc/omap.c b/drivers/mmc/omap.c index 9b5e4e8c2e8..af7e0aeac2b 100644 --- a/drivers/mmc/omap.c +++ b/drivers/mmc/omap.c @@ -418,6 +418,20 @@ 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) + | (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; + } + } + if (status & OMAP_MMC_STAT_CARD_ERR) { // Card status error printk(KERN_DEBUG "MMC%d: Card status error (CMD%d)\n",