From patchwork Wed Mar 15 19:33:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9626507 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5A0B2604A9 for ; Wed, 15 Mar 2017 19:35:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CA0E25F31 for ; Wed, 15 Mar 2017 19:35:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41A7A28648; Wed, 15 Mar 2017 19:35:01 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham 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 EB3CD25F31 for ; Wed, 15 Mar 2017 19:35:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751416AbdCOTfA (ORCPT ); Wed, 15 Mar 2017 15:35:00 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:33208 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750774AbdCOTe7 (ORCPT ); Wed, 15 Mar 2017 15:34:59 -0400 Received: by mail-wr0-f194.google.com with SMTP id g10so3276723wrg.0 for ; Wed, 15 Mar 2017 12:34:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=TjxiZiuXljwqxcbZVejew5IT40Rp5jnwow3I9QmZ3SM=; b=XJL14KyyJlwnhxrfghlnCs4lCFZVtd7I/eAfkXsXVmXYMJzktPBSxXKx139ZuuSCOD dQFVPT4pRiociK6WIDb0gqC85swwOoDflKzMgPTBy48GpkPkmgAASQxOP9ZPImixWKlq U321SnSn2QGSL1hdqKDmYil0VFG39atXvvi4lNSwGXbh6a4jgBi/FpTuA6IrMs7ce1yk LgHRnT9bnDD1xSegfjjnJ/tnIdMS81a1a0OSgqMZSdSLm4CMgrBCY1Hkbtf6AVQC2L44 bT/NtvgIa0N0DfhKPykD4TQ+HxwW9IV8UegdnzN6EFpk6MRRB8JFvP+zvpJB//X6Xq0J kYFw== 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:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=TjxiZiuXljwqxcbZVejew5IT40Rp5jnwow3I9QmZ3SM=; b=ezlbj/gKEowluVY3hJfxuOwtb+NnRNfInwkrA2sBYtTVemqy4sjQ7uhq4GZeeGtnxG DviD8IObbxEr6b/wIijo/bG13S/9+00FPwPleMLok7Zr6mOfw0stgATWtAH1TzaRT1DI o11lRM8QW1F/GFccS2UdUsCwuf/lGyYfzFbDVJqUyvt64gh77yFMVg+ggmGWiH8FYnQm A0nRhbphtac3u8GrYYy5cLFCYMlqKbEkTn0f067p2CfCt4wGsfyXNO0dRnfwsAtvZpI5 W5wD+ywv2r2czVGe7w4b9Fl+l17vJKa1uZBi26iht6MYv76qUtAHA5gBZ8uzT5cKewQk 5O1A== X-Gm-Message-State: AFeK/H0aDtNS25kHZFkdjwW8w3oC8sJNdlsiDSpM6EcfHRYzsxAbOlXDy4a0GdWsfowcYQ== X-Received: by 10.223.153.225 with SMTP id y88mr4419192wrb.81.1489606497756; Wed, 15 Mar 2017 12:34:57 -0700 (PDT) Received: from ?IPv6:2003:c6:ebdc:4000:c5e4:fad9:4bd9:799d? (p200300C6EBDC4000C5E4FAD94BD9799D.dip0.t-ipconnect.de. [2003:c6:ebdc:4000:c5e4:fad9:4bd9:799d]) by smtp.googlemail.com with ESMTPSA id x133sm1577994wme.22.2017.03.15.12.34.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Mar 2017 12:34:57 -0700 (PDT) From: Heiner Kallweit Subject: [PATCH 2/5] mmc: meson-gx: improve response reading To: Ulf Hansson , Kevin Hilman References: Cc: "linux-mmc@vger.kernel.org" , linux-amlogic@lists.infradead.org Message-ID: Date: Wed, 15 Mar 2017 20:33:57 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: 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 Response is read in the main irq handler and in the threaded irq handler as well. We can slightly improve this by reading the response unconditionally at the beginning of the main irq handler only. Signed-off-by: Heiner Kallweit --- drivers/mmc/host/meson-gx-mmc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index f2d4486a..e675601e 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -573,6 +573,8 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id) goto out; } + meson_mmc_read_resp(host->mmc, cmd); + cmd->error = 0; if (status & IRQ_RXD_ERR_MASK) { dev_dbg(host->dev, "Unhandled IRQ: RXD error\n"); @@ -619,10 +621,8 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id) /* ack all (enabled) interrupts */ writel(status, host->regs + SD_EMMC_STATUS); - if (ret == IRQ_HANDLED) { - meson_mmc_read_resp(host->mmc, cmd); + if (ret == IRQ_HANDLED) meson_mmc_request_done(host->mmc, cmd->mrq); - } spin_unlock(&host->lock); return ret; @@ -647,7 +647,6 @@ static irqreturn_t meson_mmc_irq_thread(int irq, void *dev_id) data->bytes_xfered = xfer_bytes; } - meson_mmc_read_resp(host->mmc, cmd); if (!data || !data->stop || cmd->mrq->sbc) meson_mmc_request_done(host->mmc, cmd->mrq); else