From patchwork Fri Nov 15 14:22:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 3188511 Return-Path: X-Original-To: patchwork-linux-arm@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 C6156C045B for ; Fri, 15 Nov 2013 14:42:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0E30F208B8 for ; Fri, 15 Nov 2013 14:42:21 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4888E208B5 for ; Fri, 15 Nov 2013 14:42:16 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VhKJ9-0003VS-N3; Fri, 15 Nov 2013 14:23:40 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VhKIe-0000aX-Lz; Fri, 15 Nov 2013 14:23:08 +0000 Received: from mail-bk0-x22c.google.com ([2a00:1450:4008:c01::22c]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VhKIb-0000Xx-1C for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2013 14:23:06 +0000 Received: by mail-bk0-f44.google.com with SMTP id d7so1653737bkh.17 for ; Fri, 15 Nov 2013 06:22:43 -0800 (PST) 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=ZuB/rpDBHWGSu0pvTQQ9mb8HNqGABksROUqIjdvQym8=; b=x13lJxEaF8Qdg7PnBK4ZhErCXdv+j6JWICN1UFKPEKxDDc6R4b3q5ofkqiwItjjt1e e6/vRRiLMLl/SXKMiv+a002zEZIbxcbXo2Omhgd9x3Pt/y4xb+6Csnb5LTC5etVDa9jw Jit7hjTJILnyD8Djiw6MeQeDxmXaQIWktnMjWqz4pCsgWJpJfeWt8xdGvKDBS7rJztd0 9PB0dDQJkUnqQRfOtOANeQ4DzhqkoN8A1zpboRTy4cqWtwn0BM408aZ52Yod4U/KJyzm 6RwvliikMZ5EGNaKCMZoqRbSesknJajuOh337aDLI3K/VJ/Oy3Wqu1Hx6qGccyuqG1E/ +6fw== X-Received: by 10.204.71.133 with SMTP id h5mr8650bkj.76.1384525363621; Fri, 15 Nov 2013 06:22:43 -0800 (PST) Received: from topkick.lan (dslc-082-083-251-183.pools.arcor-ip.net. [82.83.251.183]) by mx.google.com with ESMTPSA id z6sm7182906bkn.8.2013.11.15.06.22.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Nov 2013 06:22:42 -0800 (PST) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Subject: [PATCH 2/3] mmc: mvsdio: workaround for spurious irqs Date: Fri, 15 Nov 2013 15:22:33 +0100 Message-Id: <1384525354-901-3-git-send-email-sebastian.hesselbarth@gmail.com> In-Reply-To: <1384525354-901-1-git-send-email-sebastian.hesselbarth@gmail.com> References: <1384525354-901-1-git-send-email-sebastian.hesselbarth@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131115_092305_228512_62EFD847 X-CRM114-Status: GOOD ( 12.41 ) X-Spam-Score: -2.0 (--) Cc: Thomas Petazzoni , Andrew Lunn , Jason Cooper , Nicolas Pitre , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Chris Ball , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth 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=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 --- Cc: Nicolas Pitre Cc: Chris Ball Cc: Thomas Petazzoni Cc: Jason Cooper Cc: Andrew Lunn Cc: linux-mmc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/mmc/host/mvsdio.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c index 06c5b0b..25f51be 100644 --- a/drivers/mmc/host/mvsdio.c +++ b/drivers/mmc/host/mvsdio.c @@ -354,6 +354,21 @@ 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... */