From 3941895277759a2cf684902a567bb40da3657a71 Mon Sep 17 00:00:00 2001 From: Jarkko Lavinen Date: Fri, 1 Jul 2005 05:18:44 -0700 Subject: [PATCH] [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. --- drivers/mmc/omap.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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", -- 2.41.1