From patchwork Mon Apr 15 15:08:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Fuzzey X-Patchwork-Id: 2446091 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 242DADF2E5 for ; Mon, 15 Apr 2013 15:53:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751361Ab3DOPxU (ORCPT ); Mon, 15 Apr 2013 11:53:20 -0400 Received: from mta1.parkeon.com ([91.121.43.66]:35813 "EHLO mta1.parkeon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750956Ab3DOPxT (ORCPT ); Mon, 15 Apr 2013 11:53:19 -0400 X-Greylist: delayed 2680 seconds by postgrey-1.27 at vger.kernel.org; Mon, 15 Apr 2013 11:53:19 EDT Received: from ip71.parkeon.com ([213.152.31.71] helo=mta2.parkeon.com) by mta1.parkeon.com with esmtp (Exim 4.76) (envelope-from ) id 1URl1H-0006wV-Ao; Mon, 15 Apr 2013 17:08:35 +0200 Received: from [10.32.16.23] (helo=mail.besancon.parkeon.com) by mta2.parkeon.com with esmtp (Exim 4.77) (envelope-from ) id 1URl1G-0002S5-Gj; Mon, 15 Apr 2013 17:08:34 +0200 Received: from [10.32.51.221] (port=47254 helo=[127.0.0.1]) by mail.besancon.parkeon.com with esmtp (Exim 4.71) (envelope-from ) id 1URl1H-0004cC-4X; Mon, 15 Apr 2013 17:08:35 +0200 Subject: [PATCH] mmc: sdhci-esdhc-imx: Fix SDIO interrupts To: Sascha Hauer , Chris Ball , linux-mmc@vger.kernel.org From: Martin Fuzzey Date: Mon, 15 Apr 2013 17:08:35 +0200 Message-ID: <20130415150835.7614.98080.stgit@localhost> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Virus-Scanned: by ClamAV at mta2.parkeon.com Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Currently SDIO interrupts do not work on i.MX53 and maybe others. This was observed with a Marvell 8787 based SDIO wifi adapter using the mwifiex driver and firmware from the Marvell git repository. The symptom was a timeout after firmware download. Observing the SDIO_DAT1 line showed that an interrupt was requested (level 0) but no interrupt was generated in software, the line stayed low until a timeout ocurred and the card was reset. There is a Freescale errata ENGcm11186 "eSDHC misses SDIO interrupt when CINT is disabled" The workaround suggested by this errata is already implemented and involves clearing and then setting the D3CD bit in the host control register [see esdhc_writel_le()] However, when esdhc_writeb_le() is later used to write to SDHCI_HOST_CONTROL it always resets the D3CD bit. To fix this simply add the D3CD bit to the set of bits not modified by esdhc_writeb_le(). Signed-off-by: Martin Fuzzey --- drivers/mmc/host/sdhci-esdhc-imx.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 78ac002..3c4c63d 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -324,8 +324,10 @@ static void esdhc_writeb_le(struct sdhci_host *host, u8 val, int reg) /* * Do not touch buswidth bits here. This is done in * esdhc_pltfm_bus_width. + * Do not touch the D3CD bit either which is used for the + * SDIO interrupt errata workaround. */ - mask = 0xffff & ~ESDHC_CTRL_BUSWIDTH_MASK; + mask = 0xffff & ~(ESDHC_CTRL_BUSWIDTH_MASK | ESDHC_CTRL_D3CD); esdhc_clrset_le(host, mask, new_val, reg); return;