summaryrefslogtreecommitdiff
path: root/drivers/mmc/core/sdio_irq.c
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2007-10-03 15:32:57 -0400
committerPierre Ossman <drzeus@drzeus.cx>2007-10-06 17:51:45 +0200
commit599473cf15a3fae78cbc3192cfb38ca04d5abc72 (patch)
treecba3a1c236711d4fc267ef6272c93d9dcf6a08e8 /drivers/mmc/core/sdio_irq.c
parent3e01e4bcdd56209e70c39293e0c4c355d09364b8 (diff)
sdio: make the IRQ thread more resilient in the presence of bad states
Currently we print a message about some bad states wrt function IRQ handlers but return 0 from process_sdio_pending_irqs() nevertheless. This can lead to an infinite loop as nothing might have cleared the condition for the pending card interrupt from the host controller by the time host->ops->enable_sdio_irq(host, 1) is called. Signed-off-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc/core/sdio_irq.c')
-rw-r--r--drivers/mmc/core/sdio_irq.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
index e7865059e126..3bd3021f5e80 100644
--- a/drivers/mmc/core/sdio_irq.c
+++ b/drivers/mmc/core/sdio_irq.c
@@ -45,16 +45,22 @@ static int process_sdio_pending_irqs(struct mmc_card *card)
printk(KERN_WARNING "%s: pending IRQ for "
"non-existant function\n",
mmc_card_id(card));
+ ret = -EINVAL;
} else if (func->irq_handler) {
func->irq_handler(func);
count++;
- } else
+ } else {
printk(KERN_WARNING "%s: pending IRQ with no handler\n",
sdio_func_id(func));
+ ret = -EINVAL;
+ }
}
}
- return count;
+ if (count)
+ return count;
+
+ return ret;
}
static int sdio_irq_thread(void *_host)