aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/sdio_irq.c
diff options
context:
space:
mode:
authorNicolas Pitre <nicolas.pitre@linaro.org>2012-04-16 19:16:54 -0400
committerChris Ball <cjb@laptop.org>2012-04-22 11:17:28 -0400
commitbbbc4c4d8c5face097d695f9bf3a39647ba6b7e7 (patch)
treea55ffe74b967001e3f52cc331a65974415470a45 /drivers/mmc/core/sdio_irq.c
parent6187fee46f4bc7f18f2caefdc75a073c6a25adab (diff)
mmc: sdio: avoid spurious calls to interrupt handlers
Commit 06e8935feb ("optimized SDIO IRQ handling for single irq") introduced some spurious calls to SDIO function interrupt handlers, such as when the SDIO IRQ thread is started, or the safety check performed upon a system resume. Let's add a flag to perform the optimization only when a real interrupt is signaled by the host driver and we know there is no point confirming it. Reported-by: Sujit Reddy Thumma <sthumma@codeaurora.org> Signed-off-by: Nicolas Pitre <nico@linaro.org> Cc: stable <stable@vger.kernel.org> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/core/sdio_irq.c')
-rw-r--r--drivers/mmc/core/sdio_irq.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
index f573e7f9f740..3d8ceb4084de 100644
--- a/drivers/mmc/core/sdio_irq.c
+++ b/drivers/mmc/core/sdio_irq.c
@@ -28,18 +28,20 @@
28 28
29#include "sdio_ops.h" 29#include "sdio_ops.h"
30 30
31static int process_sdio_pending_irqs(struct mmc_card *card) 31static int process_sdio_pending_irqs(struct mmc_host *host)
32{ 32{
33 struct mmc_card *card = host->card;
33 int i, ret, count; 34 int i, ret, count;
34 unsigned char pending; 35 unsigned char pending;
35 struct sdio_func *func; 36 struct sdio_func *func;
36 37
37 /* 38 /*
38 * Optimization, if there is only 1 function interrupt registered 39 * Optimization, if there is only 1 function interrupt registered
39 * call irq handler directly 40 * and we know an IRQ was signaled then call irq handler directly.
41 * Otherwise do the full probe.
40 */ 42 */
41 func = card->sdio_single_irq; 43 func = card->sdio_single_irq;
42 if (func) { 44 if (func && host->sdio_irq_pending) {
43 func->irq_handler(func); 45 func->irq_handler(func);
44 return 1; 46 return 1;
45 } 47 }
@@ -116,7 +118,8 @@ static int sdio_irq_thread(void *_host)
116 ret = __mmc_claim_host(host, &host->sdio_irq_thread_abort); 118 ret = __mmc_claim_host(host, &host->sdio_irq_thread_abort);
117 if (ret) 119 if (ret)
118 break; 120 break;
119 ret = process_sdio_pending_irqs(host->card); 121 ret = process_sdio_pending_irqs(host);
122 host->sdio_irq_pending = false;
120 mmc_release_host(host); 123 mmc_release_host(host);
121 124
122 /* 125 /*