From patchwork Tue Feb 14 20:07:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9572755 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 DD11E601E7 for ; Tue, 14 Feb 2017 20:08:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA346271BC for ; Tue, 14 Feb 2017 20:08:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF1AD28415; Tue, 14 Feb 2017 20:08:40 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 91C43271BC for ; Tue, 14 Feb 2017 20:08:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:Subject:From:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CHvt2kSyBA1F/tjVXkKp1MBiqIRZ7KrufmfswheHwnI=; b=LljyIAYi3WkkmI UvqdLtH7yGcsNInPp+Lxhx1rts/SOM5dKZbrgEJscZOxgPiWEiDXdQuU6v30RyF0vffLiO3Aw7eLN YQnfxPKEPoNgtaYW+k8aYwaDimpUbqY+fn6AncYkwFvsMiza7UENMaggTPEehLTBu1BAejEZFpx8R kO3FGnD/Psy9G2kttBPsGpe6yeW3acaAI4LZQjmFZkJWXDVdyLGWbGUXeuDzhrWIRuUjBKeD466Rs 5KRLYhnA/QDgIqwJWQ5KtDytQZ+SU1u9N5beG8tFTZgW0C5nPeZaP+1+7zW/J20BjtoEuvewo+ado X7yrJXLxXpUHobLcDwFg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cdjOq-0002Ol-O5; Tue, 14 Feb 2017 20:08:32 +0000 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cdjOW-0001pl-7l for linux-amlogic@lists.infradead.org; Tue, 14 Feb 2017 20:08:20 +0000 Received: by mail-wr0-x244.google.com with SMTP id k90so28775898wrc.3 for ; Tue, 14 Feb 2017 12:07:55 -0800 (PST) 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=w8bEW1pI1tjiQoKMGaSKKm8TVd4aNUDDhLBPBQVca+c=; b=nYE+oq3XyB26bnRaJnqO9rMXm0zI4JZFYVrddn2xtEntTNnrF6MMNBVZvG+gsI5Sqb L6vcb7BfQS1bNdKYBcdBYpnvrb1sxbBeWJ0qJhpv61OhkaK21MZH85G2Uu7IE/cd0qaD f4F1M51fVEssd+7kh+BDbdrYuZn+v+YUcK+zwNeKTmfcvWzLjWO5PoEknVP2RjxlKIvT Z5dufNjtvlfZe9uuIzsHGTNFDozRtBGo43YRkkiPD821s86aU9gT+KrXEqVK4e//111H 1ly4dF3dBvkOgH72hZFKJtYC8Cn7yhTjLgk4NYwbjhZqcHC3I0XqTQgKkIC4CssrwP4c MnYw== 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=w8bEW1pI1tjiQoKMGaSKKm8TVd4aNUDDhLBPBQVca+c=; b=GQ6x+HnPoT76IYF/u0vY1Ji5ScG8ZdHOrsOnr8houXEzBYFRSK6sVwkCxoo5ncQP4d OYUXJg5nKydFszDogKDwR1hsydcjmTiaCYO75wYbkSsLKaxm7uGnCX+6nl7vZE2NYIrU LP9CWJ0oK5XGTrtNw2yEh1LeArGmECuOfqBG3nRs/sY+Ub6IE8wkh6nz4vH00Ub+iaiS x5K92RR3G8NquY4CrN3ZLqIvYBY9aCMjNfjlCWHr8GlmHUNBPcLkW51mnmoY2MaC0EF6 9kg1c2mcDfpQaMft5V+PUcmfPsAccKsyOpiYw87f8S+/Wx7i2lkOn0K+BB42Ii1vqc8d qnDw== X-Gm-Message-State: AMke39kKKH0hZLDY/JLiJ/kITF4bPhSI9fq54RL0/j/hHB4UtVeHzUIodZgRlinqaUN6sQ== X-Received: by 10.223.165.138 with SMTP id g10mr28060365wrc.105.1487102874353; Tue, 14 Feb 2017 12:07:54 -0800 (PST) Received: from ?IPv6:2003:c6:ebdc:4000:9533:a20:55f1:fb4b? (p200300C6EBDC400095330A2055F1FB4B.dip0.t-ipconnect.de. [2003:c6:ebdc:4000:9533:a20:55f1:fb4b]) by smtp.googlemail.com with ESMTPSA id o2sm2511876wmb.28.2017.02.14.12.07.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Feb 2017 12:07:53 -0800 (PST) From: Heiner Kallweit Subject: [PATCH 18/18] mmc: meson-gx: move handling of one case from threaded handler to main irq To: Ulf Hansson , Kevin Hilman References: <420b75a9-b8c2-b3d7-ae60-3ed8a5a18ead@gmail.com> Message-ID: <625bbd38-6815-9d81-a480-e7ce0f4bc7eb@gmail.com> Date: Tue, 14 Feb 2017 21:07:17 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <420b75a9-b8c2-b3d7-ae60-3ed8a5a18ead@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170214_120813_069379_70590DF5 X-CRM114-Status: UNSURE ( 8.87 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Carlo Caione , linux-amlogic@lists.infradead.org, "linux-mmc@vger.kernel.org" Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP If cmd->data is NULL there's nothing to do in the threaded handler. So we can handle this case in the main irq handler already. Signed-off-by: Heiner Kallweit --- drivers/mmc/host/meson-gx-mmc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index 08ff29be..58b0add2 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -578,9 +578,10 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id) if (status & IRQ_SDIO) dev_dbg(host->dev, "Unhandled IRQ: SDIO.\n"); - if (status & (IRQ_END_OF_CHAIN | IRQ_RESP_STATUS)) - ret = IRQ_WAKE_THREAD; - else { + if (status & (IRQ_END_OF_CHAIN | IRQ_RESP_STATUS)) { + if (cmd->data) + ret = IRQ_WAKE_THREAD; + } else { dev_warn(host->dev, "Unknown IRQ! status=0x%04x: MMC CMD%u arg=0x%08x flags=0x%08x stop=%d\n", status, cmd->opcode, cmd->arg, cmd->flags, cmd->mrq->stop ? 1 : 0); @@ -612,11 +613,11 @@ static irqreturn_t meson_mmc_irq_thread(int irq, void *dev_id) struct mmc_data *data; unsigned int xfer_bytes; - if (WARN_ON(!cmd)) + if (WARN_ON(!cmd || !cmd->data)) return IRQ_NONE; data = cmd->data; - if (data && data->flags & MMC_DATA_READ) { + if (data->flags & MMC_DATA_READ) { size_t len = sg_copy_from_buffer(data->sg, data->sg_len, host->bounce_buf, host->bounce_buf_size);