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: 4069451 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6BB95BFF02 for ; Sat, 26 Apr 2014 19:36:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 80F0120251 for ; Sat, 26 Apr 2014 19:36:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7E1B620218 for ; Sat, 26 Apr 2014 19:36:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751741AbaDZTec (ORCPT ); Sat, 26 Apr 2014 15:34:32 -0400 Received: from mail-ee0-f50.google.com ([74.125.83.50]:51875 "EHLO mail-ee0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751180AbaDZTeb (ORCPT ); Sat, 26 Apr 2014 15:34:31 -0400 Received: by mail-ee0-f50.google.com with SMTP id c13so3703943eek.9 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 Cc: Nicolas Pitre , Chris Ball , Ulf Hansson , Jason Cooper , Andrew Lunn , Gregory Clement , linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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... */