From patchwork Tue May 31 20:33:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Per Forlin X-Patchwork-Id: 833902 Received: from canuck.infradead.org (canuck.infradead.org [134.117.69.58]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4VKaFsi005087 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 31 May 2011 20:36:35 GMT Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QRVe0-0004go-44; Tue, 31 May 2011 20:34:28 +0000 Received: from mail-ey0-f177.google.com ([209.85.215.177]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QRVdf-0004bX-I3 for linux-arm-kernel@lists.infradead.org; Tue, 31 May 2011 20:34:14 +0000 Received: by eyh6 with SMTP id 6so2001141eyh.36 for ; Tue, 31 May 2011 13:34:05 -0700 (PDT) Received: by 10.213.27.10 with SMTP id g10mr2603743ebc.135.1306874045152; Tue, 31 May 2011 13:34:05 -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 z1sm264420eeb.6.2011.05.31.13.34.03 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 31 May 2011 13:34:04 -0700 (PDT) From: Per Forlin To: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Nicolas Pitre , linaro-dev@lists.linaro.org, Daniel Drake Subject: [PATCH 1/2] sdio: add function to enable and disable sdio_single_irq optimization Date: Tue, 31 May 2011 22:33:27 +0200 Message-Id: <1306874008-28867-2-git-send-email-per.forlin@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1306874008-28867-1-git-send-email-per.forlin@linaro.org> References: <1306874008-28867-1-git-send-email-per.forlin@linaro.org> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110531_163408_375945_13B03330 X-CRM114-Status: GOOD ( 17.37 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.215.177 listed in list.dnswl.org] Cc: Chris Ball , Per Forlin X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 31 May 2011 20:36:35 +0000 (UTC) Make sdio single irq run time configurable, default is disable. This is due to an issue in libertas where the SDIO device seems to raise interrupt even if there are none function bits in CCCR_INTx set. This behaviour is not defined by the SDIO spec. Signed-off-by: Per Forlin --- drivers/mmc/core/sdio_irq.c | 17 ++++++++++++++++- include/linux/mmc/card.h | 1 + 2 files changed, 17 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c index 03ead02..2f81ddc 100644 --- a/drivers/mmc/core/sdio_irq.c +++ b/drivers/mmc/core/sdio_irq.c @@ -204,7 +204,8 @@ static void sdio_single_irq_set(struct mmc_card *card) int i; card->sdio_single_irq = NULL; - if ((card->host->caps & MMC_CAP_SDIO_IRQ) && + if (card->sdio_single_irq_en && + (card->host->caps & MMC_CAP_SDIO_IRQ) && card->host->sdio_irqs == 1) for (i = 0; i < card->sdio_funcs; i++) { func = card->sdio_func[i]; @@ -302,3 +303,17 @@ int sdio_release_irq(struct sdio_func *func) } EXPORT_SYMBOL_GPL(sdio_release_irq); +/** + * sdio_single_irq_enable - enable or disable SDIO single IRQ function + * @card: card to enable SDIO single irq + * @value: true to enable SDIO single irq function, false to disable + * + * If there is only 1 function interrupt registered and SDIO single IRQ + * is enable, the irq handler is called directly without reading + * the CCCR registers + */ +void sdio_single_irq_enable(struct mmc_card *card, bool value) +{ + card->sdio_single_irq_en = value; +} +EXPORT_SYMBOL_GPL(sdio_single_irq_enable); diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 7b4fd7b..f8b0537 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h @@ -196,6 +196,7 @@ struct mmc_card { struct sdio_cis cis; /* common tuple info */ struct sdio_func *sdio_func[SDIO_MAX_FUNCS]; /* SDIO functions (devices) */ struct sdio_func *sdio_single_irq; /* SDIO function when only one IRQ active */ + bool sdio_single_irq_en; /* enable single irq */ unsigned num_info; /* number of info strings */ const char **info; /* info strings */ struct sdio_func_tuple *tuples; /* unknown common tuples */