Skip to content

Commit

Permalink
sdio: make the IRQ thread more resilient in the presence of bad states
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicolas Pitre authored and Pierre Ossman committed Oct 6, 2007
1 parent 3e01e4b commit 599473c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/mmc/core/sdio_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 599473c

Please sign in to comment.