mmc: tmio_mmc: fix CMD irq handling
authorArnd Hannemann <arnd@arndnet.de>
Wed, 29 Dec 2010 13:21:14 +0000 (14:21 +0100)
committerChris Ball <cjb@laptop.org>
Sun, 9 Jan 2011 04:52:32 +0000 (23:52 -0500)
With current code card insert/eject interrupts will acknowledge outstanding
commands. Normally this seems to be no problem, however if the hardware gets
stuck and no interrupts for CMD_TIMEOUT or CMD_RESPEND are generated, then
inserting and ejecting cards will falsely acknowledge outstanding commands
from the core.

This patch changes the behavior so that CMDs are only acked, if
CMD_TIMEOUT or CMD_RESPEND is received.

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/tmio_mmc.c

index 689a369..e3c6ef2 100644 (file)
@@ -727,8 +727,10 @@ static irqreturn_t tmio_mmc_irq(int irq, void *devid)
  */
 
                /* Command completion */
-               if (ireg & TMIO_MASK_CMD) {
-                       ack_mmc_irqs(host, TMIO_MASK_CMD);
+               if (ireg & (TMIO_STAT_CMDRESPEND | TMIO_STAT_CMDTIMEOUT)) {
+                       ack_mmc_irqs(host,
+                                    TMIO_STAT_CMDRESPEND |
+                                    TMIO_STAT_CMDTIMEOUT);
                        tmio_mmc_cmd_irq(host, status);
                }