[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1304453087-7365-1-git-send-email-per.forlin@linaro.org>
Date: Tue, 3 May 2011 22:04:47 +0200
From: Per Forlin <per.forlin@...aro.org>
To: linux-mmc@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, linaro-dev@...ts.linaro.org
Cc: Chris Ball <cjb@...top.org>,
Stefan Nilsson XK <stefan.xk.nilsson@...ricsson.com>,
Per Forlin <per.forlin@...aro.org>
Subject: [PATCH] sdio: optimized SDIO IRQ handling for single function
From: Stefan Nilsson XK <stefan.xk.nilsson@...ricsson.com>
If there is only 1 function registered, and IRQ:s are supported and
currently enabled, call the callback handler directly
without checking the CCCR registers.
Signed-off-by: Stefan Nilsson XK <stefan.xk.nilsson@...ricsson.com>
Signed-off-by: Per Forlin <per.forlin@...aro.org>
---
drivers/mmc/core/sdio_irq.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
index b300161..25291bf 100644
--- a/drivers/mmc/core/sdio_irq.c
+++ b/drivers/mmc/core/sdio_irq.c
@@ -32,6 +32,20 @@ static int process_sdio_pending_irqs(struct mmc_card *card)
int i, ret, count;
unsigned char pending;
+ /*
+ * If there is only 1 function registered
+ * call irq directly without checking the CCCR registers.
+ */
+ if ((card->host->caps & MMC_CAP_SDIO_IRQ) &&
+ card->host->sdio_irqs && (card->sdio_funcs == 1))
+ for (i = 0; i < SDIO_MAX_FUNCS; i++) {
+ struct sdio_func *func = card->sdio_func[i];
+ if (func && func->irq_handler) {
+ func->irq_handler(func);
+ return 1;
+ }
+ }
+
ret = mmc_io_rw_direct(card, 0, 0, SDIO_CCCR_INTx, 0, &pending);
if (ret) {
printk(KERN_DEBUG "%s: error %d reading SDIO_CCCR_INTx\n",
--
1.7.4.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists