]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: sdhci: disable interrupt before free_irq
authorKevin Liu <kliu5@marvell.com>
Sat, 5 Jan 2013 09:18:28 +0000 (17:18 +0800)
committerChris Ball <cjb@laptop.org>
Mon, 11 Feb 2013 18:28:50 +0000 (13:28 -0500)
commit61546db2266e1376b90886bb19e9590480b466d1
tree6fb2a8d9836c133e6d286e835ada1a822f44541b
parent397ddeb66b1f7e404e2b43e87043f2ec51e00f13
mmc: sdhci: disable interrupt before free_irq

Current code missed disabling interrupts before free irq which is shared.

Notice below comments for function free_irq (kernel/irq/manage.c):
On a shared IRQ the caller must ensure the interrupt is disabled
on the card it drives before calling this function.

Original code has below issue during suspend/resume when multiple SD
hosts share the same IRQ:
1. Assume there are two hosts (host1 for emmc while host2 for sd) share
the same mmc irq.
2. When system suspend, host2 will be suspended before host1.
So the sequence is below:
step1: irq handler for host2 removed ->
step2: irq handler for host1 removed and irq disabled ->
... system suspended ...
... system resumed ...
step3: irq enabled and the irq handler for host1 restored ->
step4: irq handler for host2 restored
3. So there is the buggy time slot that the irq is enabled but the irq
handler for host2 is removed. Then host2 interrupt can be triggered
but can't be handled at that moment.

Signed-off-by: Jialing Fu <jlfu@marvell.com>
Signed-off-by: Kevin Liu <kliu5@marvell.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/sdhci.c