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: 3188421 Return-Path: X-Original-To: patchwork-linux-mmc@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 BA6C49F3AE for ; Fri, 15 Nov 2013 14:23:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0EBA920925 for ; Fri, 15 Nov 2013 14:22:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CEE732086D for ; Fri, 15 Nov 2013 14:22:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753282Ab3KOOWt (ORCPT ); Fri, 15 Nov 2013 09:22:49 -0500 Received: from mail-bk0-f48.google.com ([209.85.214.48]:61148 "EHLO mail-bk0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752023Ab3KOOWp (ORCPT ); Fri, 15 Nov 2013 09:22:45 -0500 Received: by mail-bk0-f48.google.com with SMTP id v10so1131785bkz.35 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 Cc: Sebastian Hesselbarth , Nicolas Pitre , Chris Ball , Thomas Petazzoni , Jason Cooper , Andrew Lunn , linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.8 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=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... */