From patchwork Thu May 23 14:59:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 165030 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2307062ili; Thu, 23 May 2019 08:00:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/7e5W/K1bGkZoRjooWqeyj5LED/PUlHn0Xkm3OO8mV31hGN3vXsgKhxAdskeF8X3DYJwB X-Received: by 2002:a62:1692:: with SMTP id 140mr81856935pfw.166.1558623600342; Thu, 23 May 2019 08:00:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558623600; cv=none; d=google.com; s=arc-20160816; b=kKPim9d3+Ukd7kEbN+SXovch56Zs+UzoV+iDt5SramPKYkqMMsOQng53HADwSIBXpd ZfJJWH/rgyqtiirsdOkZtC38bljkQRVYHPg/mapctdSwxkqm/gguLUcNpQUC50RVYBfE f8ir/29G+7jryufVzvH3kN47uDMFS7MlJh8VRf+Gdotcd0yuBO/ftjJaSNZMI6fH+ANB X05tzFoek4mqcDG4KC6s+Yz3+Q74v7LEcz8Sezb8PM8N0u+YBH16kmgcuSohtiFfv3p4 05h4BTNSEgQV2x50EaebMwk9LC3iNk56oKxd0OpPnKkc2QYBij4bCmxjEPb8uWeVoixq Cr6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=CssnNRfqQDe95aEHLIDwNrxoMm4Qr1zdDx/8yvm4qr8=; b=z3M4PhannioMW/gSLyA/0MydmmA5cBATGqgOr5kxS2bg+ovFOIHqpp9abjy/wAnY6a Ic1H7vS0qDzY805XxXncSXjV1dyF6k9u58nheBUymMoGTTV/S4YlMZz1/8jAjQAP4RWn GlI01EyPHhh/hYt37s7XFahI1INlhh+Mk5aXELamWZplrA00xIWJnRZK2jALRh1laUod XWuSZAmhNICE8qVhJOhzxxqW9RRR08Qh89QOBRRJ3YPZCJ6kO+xKU+IENI9KMxgaTaeC yfcpAyv8Eyhr9zI5olvNfscPUu6o8ZHIKzXm7iVzn7UzEkfLtqBeOjEXQjqgPmg9/++A Il1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=REOaV5Ss; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16si29243201plp.185.2019.05.23.07.59.59; Thu, 23 May 2019 08:00:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=REOaV5Ss; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730853AbfEWO77 (ORCPT + 5 others); Thu, 23 May 2019 10:59:59 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:34242 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730719AbfEWO76 (ORCPT ); Thu, 23 May 2019 10:59:58 -0400 Received: by mail-wr1-f68.google.com with SMTP id f8so6674137wrt.1 for ; Thu, 23 May 2019 07:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CssnNRfqQDe95aEHLIDwNrxoMm4Qr1zdDx/8yvm4qr8=; b=REOaV5SsGZnknVjXNHI1+w/KigvMYFqry/bQQI5clubnG+/RkWUFG/ltDAyrO4zkDH c77lz+ZH9APatZ8RBKfqZIrQu6VUfGLvuNAfXebV7VcJq0pdvlNCsyc1vYPkRZn5Z45u 2RLB+M9VXCmNsKrfoShvy6RVSnqq5FoHPvGXyFNWVwSPoutqYs4IInrK2K5u60CYCeyx /OOz32VPGeF+hV8c9HwrzIXhievnXkU76cLyiI5nnx49ZFl3HkF9Qdx/uqVIY6MKNnFa p6yzQku7tHyyS/MUqo1UMfav8fcHGO1INv8DrGX9vjXdZRQkAqTzCcRFRfOP+0Q7ScDv 1CiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CssnNRfqQDe95aEHLIDwNrxoMm4Qr1zdDx/8yvm4qr8=; b=rvEWx7gYCmywTyxRdB6NhBikWL2heRw4bOpaBkwJ62y8BdxTrBl2W8ckHpTS3Z5UAc fGIxXp/mhVeDrPAp3R+ON6iaGzLumh0tpR6q4X+ObwGQmjB407HQy2ffeBfWES01/59i sK+S8yCwn0gLO15EO3mVKGmaxY7Nv71Qi77tYdm1Qlwn77GaIZioPdUGYBooQzQlp963 PFsUBYUl3PpQQqVkI6oNdW86qnTq1H+ThZKaWeKRL1PQjEl2fLIMOEiKj8Gn8HLRnDfp Id0Hs2qKAwka4Zd3mPWZpz4ZwnELvVrqpL4PPOmoNwYX9HknKaKqFl5y8raYVpJfuKpU 12vA== X-Gm-Message-State: APjAAAUQHbvswtlfHY8owknOrLJ/XcEDD69TmSAYU6Wc+Fucmvm6G/+R LOzb7Fa7ZUbUt0dJSEGmslJlnWNlmP4= X-Received: by 2002:a5d:65d1:: with SMTP id e17mr1327464wrw.65.1558623597101; Thu, 23 May 2019 07:59:57 -0700 (PDT) Received: from boomer.local (lmontsouris-657-1-212-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id o11sm14429930wrp.23.2019.05.23.07.59.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 07:59:56 -0700 (PDT) From: Jerome Brunet To: Ulf Hansson , Kevin Hilman Cc: Jerome Brunet , linux-amlogic@lists.infradead.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong Subject: [PATCH] mmc: meson-gx: fix irq ack Date: Thu, 23 May 2019 16:59:50 +0200 Message-Id: <20190523145950.7030-1-jbrunet@baylibre.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Patchwork-Bot: notify Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org While cleaning the ISR of the meson-gx and acking only raised irqs, the ack of the irq was moved at the very last stage of the function. This was stable during the initial tests but it triggered issues with hs200, under specific loads (like booting android). Acking the irqs after calling the mmc_request_done() causes the problem. Moving the ack back to the original place solves the issue. Since the irq is edge triggered, it does not hurt to ack irq even earlier, so let's do it early in the ISR. Fixes: 9c5fdb07a28d ("mmc: meson-gx: ack only raised irq") Tested-by: Neil Armstrong Tested-by: Kevin Hilman Signed-off-by: Jerome Brunet --- drivers/mmc/host/meson-gx-mmc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.20.1 Reviewed-by: Kevin Hilman Tested-by: Brad Harper diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index 6ef465304052..cb3f6811d69a 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -873,6 +873,9 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id) if (WARN_ON(!host) || WARN_ON(!host->cmd)) return IRQ_NONE; + /* ack all raised interrupts */ + writel(status, host->regs + SD_EMMC_STATUS); + cmd = host->cmd; data = cmd->data; cmd->error = 0; @@ -919,9 +922,6 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id) if (ret == IRQ_HANDLED) meson_mmc_request_done(host->mmc, cmd->mrq); - /* ack all raised interrupts */ - writel(status, host->regs + SD_EMMC_STATUS); - return ret; }