From patchwork Wed Jun 1 08:48:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Per Forlin X-Patchwork-Id: 837282 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p518o8iw019596 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 1 Jun 2011 08:50:29 GMT Received: from canuck.infradead.org ([134.117.69.58]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QRh7m-0005AV-16; Wed, 01 Jun 2011 08:49:58 +0000 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 1QRh7l-0003ug-Qj; Wed, 01 Jun 2011 08:49:57 +0000 Received: from eu1sys200aog115.obsmtp.com ([207.126.144.139]) by canuck.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1QRh7h-0003uM-Ms for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2011 08:49:54 +0000 Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob115.postini.com ([207.126.147.11]) with SMTP ID DSNKTeX9IsC0rk9d+OUwz8/F72WcQfuvwpmH@postini.com; Wed, 01 Jun 2011 08:49:53 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 32F8BF7; Wed, 1 Jun 2011 08:49:36 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 0998CB59; Wed, 1 Jun 2011 08:49:35 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 3DBC824C07C; Wed, 1 Jun 2011 10:49:29 +0200 (CEST) Received: from localhost.localdomain (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 1 Jun 2011 10:49:34 +0200 From: Per Forlin To: , , Nicolas Pitre , , Daniel Drake , Linus Walleij Subject: [PATCH v2 1/2] sdio: add quirk to handle pending IRQ in case of none CCCR_INTx bits Date: Wed, 1 Jun 2011 10:48:32 +0200 Message-ID: <1306918113-23872-2-git-send-email-per.forlin@stericsson.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1306918113-23872-1-git-send-email-per.forlin@stericsson.com> References: <1306918113-23872-1-git-send-email-per.forlin@stericsson.com> MIME-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110601_044953_991400_0581784A X-CRM114-Status: GOOD ( 24.44 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [207.126.144.139 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: , 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 (demeter1.kernel.org [140.211.167.41]); Wed, 01 Jun 2011 08:50:29 +0000 (UTC) From: Per Forlin Add quirk MMC_QUIRK_SDIO_IRQ_CCCR_INTX_0 to handle SDIO device that may have pending IRQ when none bits are set in CCCR_INTx. This IRQ issue was identified in the libertas sdio driver where the SDIO device seems to raise an interrupt even if there were none function bits in CCCR_INTx set. SDIO single irq feature will call irq handler directly in case of only one interrupt registered. It will not check the CCCR_INTx register and miss if the register is 0 and call the irq handler anyway. This IRQ issue is not defined by the SDIO spec. Use this quirk to work around this SDIO IRQ issue for a specific device. Signed-off-by: Per Forlin --- drivers/mmc/core/sdio_irq.c | 4 ++-- include/linux/mmc/card.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c index 03ead02..df1e946 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->quirks & MMC_QUIRK_SDIO_IRQ_CCCR_INTX_0) && + (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]; @@ -301,4 +302,3 @@ int sdio_release_irq(struct sdio_func *func) return 0; } EXPORT_SYMBOL_GPL(sdio_release_irq); - diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 7b4fd7b..852021c 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h @@ -175,6 +175,7 @@ struct mmc_card { #define MMC_QUIRK_DISABLE_CD (1<<5) /* disconnect CD/DAT[3] resistor */ #define MMC_QUIRK_INAND_CMD38 (1<<6) /* iNAND devices have broken CMD38 */ #define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */ +#define MMC_QUIRK_SDIO_IRQ_CCCR_INTX_0 (1<<7) /* SDIO card has IRQ even if CCCR_INTx is 0 */ unsigned int erase_size; /* erase size in sectors */ unsigned int erase_shift; /* if erase unit is power 2 */