]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: OMAP: Fix end of card MMC error
authorJarkko Lavinen <jarkko.lavinen@nokia.com>
Fri, 1 Jul 2005 12:18:44 +0000 (05:18 -0700)
committerTony Lindgren <tony@atomide.com>
Fri, 1 Jul 2005 12:18:44 +0000 (05:18 -0700)
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

index 9b5e4e8c2e8792db88a1ce570b2342a3ae25f2f5..af7e0aeac2bc8d5abb39e9e202ad2c238025332d 100644 (file)
@@ -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",