From patchwork Tue May 3 20:51:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Per Forlin X-Patchwork-Id: 1349 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:51:12 -0000 Delivered-To: patches@linaro.org Received: by 10.224.2.73 with SMTP id 9cs28837qai; Tue, 3 May 2011 13:51:46 -0700 (PDT) Received: by 10.14.15.156 with SMTP id f28mr173993eef.105.1304455906118; Tue, 03 May 2011 13:51:46 -0700 (PDT) Received: from mail-ey0-f178.google.com (mail-ey0-f178.google.com [209.85.215.178]) by mx.google.com with ESMTPS id a15si1413066eei.62.2011.05.03.13.51.45 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 May 2011 13:51:46 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.178 is neither permitted nor denied by best guess record for domain of per.forlin@linaro.org) client-ip=209.85.215.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.215.178 is neither permitted nor denied by best guess record for domain of per.forlin@linaro.org) smtp.mail=per.forlin@linaro.org Received: by eya25 with SMTP id 25so173021eya.37 for ; Tue, 03 May 2011 13:51:45 -0700 (PDT) Received: by 10.213.108.195 with SMTP id g3mr1631798ebp.132.1304455904873; Tue, 03 May 2011 13:51:44 -0700 (PDT) Received: from localhost.localdomain (c-3c7b71d5.029-82-6c756e10.cust.bredbandsbolaget.se [213.113.123.60]) by mx.google.com with ESMTPS id y18sm328131eeh.1.2011.05.03.13.51.43 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 May 2011 13:51:44 -0700 (PDT) From: Per Forlin To: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linaro-dev@lists.linaro.org Cc: Chris Ball , Stefan Nilsson XK , Per Forlin Subject: [PATCH resend] sdio: optimized SDIO IRQ handling for single function Date: Tue, 3 May 2011 22:51:21 +0200 Message-Id: <1304455881-10010-1-git-send-email-per.forlin@linaro.org> X-Mailer: git-send-email 1.7.4.1 From: Stefan Nilsson XK If there is only 1 function registered it is possible to improve performance by avoiding the overhead of reading the CCCR registers and directly call the function handler. Signed-off-by: Stefan Nilsson XK Signed-off-by: Per Forlin --- 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",