From patchwork Sun Mar 24 17:32:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10867595 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2EB4417EF for ; Sun, 24 Mar 2019 17:32:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14E4C292D3 for ; Sun, 24 Mar 2019 17:32:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08F52292F3; Sun, 24 Mar 2019 17:32:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC77E292D3 for ; Sun, 24 Mar 2019 17:32:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726788AbfCXRcQ (ORCPT ); Sun, 24 Mar 2019 13:32:16 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:43362 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726317AbfCXRcP (ORCPT ); Sun, 24 Mar 2019 13:32:15 -0400 Received: by mail-lf1-f66.google.com with SMTP id g7so4411117lfh.10 for ; Sun, 24 Mar 2019 10:32:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:organization:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=6llkRkZMWE7xZwOC8T5tXU00lPG8rUYE1xLxT1+LccI=; b=Rf/RSDu34tm4p3Sofrmuo/8B6yQPD6VUKuI8GY+WkasRabNaK2eCSiDohKeVcy+B5k WugeFkCHmdC7hwWXHwVM3UJ+uGz3aWXk9NOQN7xx7w+7qGHFH8xdjE1/yHR8LzcsMufA BZQKr42VLBvwgRBUhpKaxSIzSdY0WZEQLZ6u7LnsukovRyD3790hsTDcIEJlJ8Pfww2j ablR0vRKpb022nhhc9DAPiReUbQZnDHrgBtEJKhDYx+IYw4dQr2NiGtu5L7pwWE0hboW skGrkl3BH8a/76i76bpxm0p8AQ6sA/NX1aNUTgU5xVpLLK80gvALcdwv3fRQvEclH8Lb xJDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:organization:message-id:date :user-agent:mime-version:content-language:content-transfer-encoding; bh=6llkRkZMWE7xZwOC8T5tXU00lPG8rUYE1xLxT1+LccI=; b=Uv5vw7ZLJbQExIgSiepwfKtTLumRIGhB1bkVSWLUVKEmITKJ0RGksxSPWIA/sdZlYZ uuHTrl01LDHd5FL2wWRwDRW+WbDAap9cVmmiBm7OnrpA2Xu/WXZrFKLKsu8g9cvILISr a9HlXZ/O6M0wDyjdy8tupgeFtE+S3/hcnm8lNb0uvoaStXZwg6TdIPlDBmAX1dX1uOSM hS6/iRLQKHhcaI3Sa9nTg+nYfb1MxGRiedzp6JZQosh5hChvGXY9V6bDmp+8MTGd2pVv KEYq0BvvFXOTvirrCslYW6ACFC+DnXZudaZf6r0LmqWK7pkO2VAxGJk9pwO+A4U0a7JV ggSQ== X-Gm-Message-State: APjAAAVU3f2Yx30emkGNBQ4jbK98v1i8Ah7Yk+baGxhde6JpLX3HSeP6 6/Xe1rA71dvNo7sHKDzsZX4UBg== X-Google-Smtp-Source: APXvYqw6+S/+XfpgVDdlL50scqcV+dCMVpWYj0FR9ersuj9TX9+Q5mDQgHaJgbjd9d/TwN7csLllwQ== X-Received: by 2002:ac2:447a:: with SMTP id y26mr11018042lfl.169.1553448734061; Sun, 24 Mar 2019 10:32:14 -0700 (PDT) Received: from wasted.cogentembedded.com ([31.173.80.147]) by smtp.gmail.com with ESMTPSA id w26sm2996051lfe.5.2019.03.24.10.32.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Mar 2019 10:32:13 -0700 (PDT) From: Sergei Shtylyov Subject: [PATCH v4.4.y] mmc: tmio_mmc_core: don't claim spurious interrupts To: linux-mmc@vger.kernel.org, Ulf Hansson , Wolfram Sang , GregKH Cc: linux-renesas-soc@vger.kernel.org, stable@vger.kernel.org Organization: Cogent Embedded Message-ID: <948c139f-aef2-efb9-6b73-c293883ab368@cogentembedded.com> Date: Sun, 24 Mar 2019 20:32:12 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Content-Language: en-MW Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 5c27ff5db1491a947264d6d4e4cbe43ae6535bae upstream. I have encountered an interrupt storm during the eMMC chip probing (and the chip finally didn't get detected). It turned out that U-Boot left the DMAC interrupts enabled while the Linux driver didn't use those. The SDHI driver's interrupt handler somehow assumes that, even if an SDIO interrupt didn't happen, it should return IRQ_HANDLED. I think that if none of the enabled interrupts happened and got handled, we should return IRQ_NONE -- that way the kernel IRQ code recoginizes a spurious interrupt and masks it off pretty quickly... Fixes: 7729c7a232a9 ("mmc: tmio: Provide separate interrupt handlers") Signed-off-by: Sergei Shtylyov --- The patch is against the 'linux-4.4.y' branch of the -stable repo. drivers/mmc/host/tmio_mmc_pio.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) Index: linux-stable/drivers/mmc/host/tmio_mmc_pio.c =================================================================== --- linux-stable.orig/drivers/mmc/host/tmio_mmc_pio.c +++ linux-stable/drivers/mmc/host/tmio_mmc_pio.c @@ -716,7 +716,7 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, v unsigned int sdio_status; if (!(pdata->flags & TMIO_MMC_SDIO_IRQ)) - return IRQ_HANDLED; + return IRQ_NONE; status = sd_ctrl_read16(host, CTL_SDIO_STATUS); ireg = status & TMIO_SDIO_MASK_ALL & ~host->sdcard_irq_mask; @@ -730,7 +730,7 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, v if (mmc->caps & MMC_CAP_SDIO_IRQ && ireg & TMIO_SDIO_STAT_IOIRQ) mmc_signal_sdio_irq(mmc); - return IRQ_HANDLED; + return IRQ_RETVAL(ireg); } EXPORT_SYMBOL(tmio_mmc_sdio_irq); @@ -747,9 +747,7 @@ irqreturn_t tmio_mmc_irq(int irq, void * if (__tmio_mmc_sdcard_irq(host, ireg, status)) return IRQ_HANDLED; - tmio_mmc_sdio_irq(irq, devid); - - return IRQ_HANDLED; + return tmio_mmc_sdio_irq(irq, devid); } EXPORT_SYMBOL(tmio_mmc_irq);