From patchwork Sat Apr 26 19:34:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 4069461 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 657929F271 for ; Sat, 26 Apr 2014 19:38:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6402320256 for ; Sat, 26 Apr 2014 19:38:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 62C9720218 for ; Sat, 26 Apr 2014 19:38:08 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1We8NE-0005dm-1j; Sat, 26 Apr 2014 19:34:56 +0000 Received: from mail-ee0-x22d.google.com ([2a00:1450:4013:c00::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1We8NA-0005cU-7w for linux-arm-kernel@lists.infradead.org; Sat, 26 Apr 2014 19:34:53 +0000 Received: by mail-ee0-f45.google.com with SMTP id d17so3680447eek.4 for ; Sat, 26 Apr 2014 12:34:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=G/WeXTqB3sBwlXuaAPzi5uPVEPQhuznQCZzWBgdAG6c=; b=yoF/DGYJdrm2rj8UDx7WQ5vinu7QF1iAlUwVZ7ddCQw29hPd/Asz953Z6+lraeC/rv 54aJq0O6H5bXN1QOhyOjagjB8+4m/ssFCk2Ouj86+W6nxEpB4s0qx+nv+ahskLMwk3GL 308MNx+LlxklZAl7b1xt7wmmBtRTEKZ4SIZ0I5HqLjik3/H3TsOs0/B9IHieGflEhGOX oG+/ooF1lEqvj9VFTj9OOMlKyY2rTakcsnCnGh7IOme4cQzLP1+t2zv2UMeipDiFR+xX Cb8f8N23XlgQt0/Ag/vs1M5LwPoDo1mfnNFOepnKXrA5IsFLclxstl/T6m6NDzfQLmCM YRlA== X-Received: by 10.14.246.1 with SMTP id p1mr19965478eer.20.1398540869293; Sat, 26 Apr 2014 12:34:29 -0700 (PDT) Received: from topkick.lan (dslc-082-083-251-183.pools.arcor-ip.net. [82.83.251.183]) by mx.google.com with ESMTPSA id w12sm35642063eez.36.2014.04.26.12.34.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 26 Apr 2014 12:34:28 -0700 (PDT) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Subject: [PATCH RESEND 2/3] mmc: mvsdio: workaround for spurious irqs Date: Sat, 26 Apr 2014 21:34:14 +0200 Message-Id: <1398540855-27367-3-git-send-email-sebastian.hesselbarth@gmail.com> In-Reply-To: <1398540855-27367-1-git-send-email-sebastian.hesselbarth@gmail.com> References: <1398540855-27367-1-git-send-email-sebastian.hesselbarth@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140426_123452_461926_F7C10B3C X-CRM114-Status: GOOD ( 10.92 ) X-Spam-Score: -0.1 (/) Cc: Andrew Lunn , Ulf Hansson , Jason Cooper , Nicolas Pitre , linux-mmc@vger.kernel.org, Chris Ball , linux-kernel@vger.kernel.org, Gregory Clement , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP SDIO controllers found on Marvell Kirkwood SoCs seem to cause a late, spurious irq although all interrupts have been disabled. This irq doesn't do any harm, neither to HW nor driver. To avoid some "unexpected irq" warning later, we workaround above issue by bailing out of irq handler early, if we didn't expect any. Signed-off-by: Sebastian Hesselbarth Acked-by: Jason Cooper Acked-by: Ulf Hansson --- Cc: Nicolas Pitre Cc: Chris Ball Cc: Ulf Hansson Cc: Jason Cooper Cc: Andrew Lunn Cc: Gregory Clement Cc: linux-mmc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/mmc/host/mvsdio.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c index 41aca7f28c23..9377284f8544 100644 --- a/drivers/mmc/host/mvsdio.c +++ b/drivers/mmc/host/mvsdio.c @@ -354,6 +354,20 @@ static irqreturn_t mvsd_irq(int irq, void *dev) intr_status, mvsd_read(MVSD_NOR_INTR_EN), mvsd_read(MVSD_HW_STATE)); + /* + * It looks like, SDIO IP can issue one late, spurious irq + * although all irqs should be disabled. To work around this, + * bail out early, if we didn't expect any irqs to occur. + */ + if (!mvsd_read(MVSD_NOR_INTR_EN) && !mvsd_read(MVSD_ERR_INTR_EN)) { + dev_dbg(host->dev, "spurious irq detected intr 0x%04x intr_en 0x%04x erri 0x%04x erri_en 0x%04x\n", + mvsd_read(MVSD_NOR_INTR_STATUS), + mvsd_read(MVSD_NOR_INTR_EN), + mvsd_read(MVSD_ERR_INTR_STATUS), + mvsd_read(MVSD_ERR_INTR_EN)); + return IRQ_HANDLED; + } + spin_lock(&host->lock); /* PIO handling, if needed. Messy business... */