From patchwork Mon Jun 16 07:58:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 31918 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5827320E7A for ; Mon, 16 Jun 2014 07:58:13 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id j17sf31096119oag.0 for ; Mon, 16 Jun 2014 00:58:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=4zjJgiq4PyMKOLJr9ysTJOFvAvn7a+M+Kz37KWYDNjw=; b=bkuQ5w1+wO6Hyq4UuSNJdDQdL0EOe8QJnlmUvw4nfK+soFas0ZC+8cFb+Y1ERMTjlA AnKbIYgH0dJL269Z6ssD8iti7fgKs5mJRDNDwsO6HD6jT7aVUU18cAsrI5/Y2FosdAKm +kDvGlfCYXBywk7valra2gbPdteSxzTWdspgzMM6cIvH0mltBFajQWBBB6VXVz3voQrB h9/BGlBQJlCEwM26YfTJNb7Rjpz/yLppaFqubJp4Ud1LGLD9ZwN882pgCegKNrPr+10Z RH/54oVDAomknOG83Uhznaj80fr9N4Opf7ErKp4QFHkiwJxubeWmIj/i2GhqnJrVrrCi wZyw== X-Gm-Message-State: ALoCoQlzl/Ln2IzXT6GuCYBx82zJfcTGbERPVhFk8G52WSVSkPUAxBJuR3QA1Ttd41xdN5iLR2Mj X-Received: by 10.42.123.148 with SMTP id s20mr3176025icr.8.1402905492967; Mon, 16 Jun 2014 00:58:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.38.133 with SMTP id t5ls4222657qgt.43.gmail; Mon, 16 Jun 2014 00:58:12 -0700 (PDT) X-Received: by 10.220.92.193 with SMTP id s1mr187346vcm.34.1402905492893; Mon, 16 Jun 2014 00:58:12 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id x14si3378767vdi.87.2014.06.16.00.58.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 00:58:12 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id lf12so4526385vcb.18 for ; Mon, 16 Jun 2014 00:58:12 -0700 (PDT) X-Received: by 10.52.184.164 with SMTP id ev4mr12531171vdc.15.1402905492805; Mon, 16 Jun 2014 00:58:12 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp116923vcb; Mon, 16 Jun 2014 00:58:12 -0700 (PDT) X-Received: by 10.112.154.200 with SMTP id vq8mr604424lbb.60.1402905491660; Mon, 16 Jun 2014 00:58:11 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com [209.85.215.42]) by mx.google.com with ESMTPS id kl8si7232410lac.120.2014.06.16.00.58.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 00:58:11 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by mail-la0-f42.google.com with SMTP id el20so2780616lab.29 for ; Mon, 16 Jun 2014 00:58:11 -0700 (PDT) X-Received: by 10.152.20.71 with SMTP id l7mr13303969lae.4.1402905491141; Mon, 16 Jun 2014 00:58:11 -0700 (PDT) Received: from linaro-ulf.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id yr11sm8023589lbb.5.2014.06.16.00.58.09 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 00:58:10 -0700 (PDT) From: Ulf Hansson To: linux-arm-kernel@lists.infradead.org, Russell King Cc: linux-mmc@vger.kernel.org, Chris Ball , Ulf Hansson , Peter Maydell , John Stultz Subject: [PATCH 1/3] mmc: mmci: Remove redundant check of status for DATA irq Date: Mon, 16 Jun 2014 09:58:01 +0200 Message-Id: <1402905483-22567-2-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1402905483-22567-1-git-send-email-ulf.hansson@linaro.org> References: <1402905483-22567-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , We don't need to verify the content of the status register twice, while we are about to handle a DATA irq. Instead let's leave all verification to be handled by mmci_data_irq(). Cc: Peter Maydell Cc: John Stultz Cc: Russell King Signed-off-by: Ulf Hansson --- drivers/mmc/host/mmci.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 6483c5c..a723ed2 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -888,6 +888,10 @@ static void mmci_data_irq(struct mmci_host *host, struct mmc_data *data, unsigned int status) { + /* Make sure we have data to handle */ + if (!data) + return; + /* First check for errors */ if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_STARTBITERR| MCI_TXUNDERRUN|MCI_RXOVERRUN)) { @@ -1206,7 +1210,6 @@ static irqreturn_t mmci_irq(int irq, void *dev_id) do { struct mmc_command *cmd; - struct mmc_data *data; status = readl(host->base + MMCISTATUS); @@ -1232,11 +1235,7 @@ static irqreturn_t mmci_irq(int irq, void *dev_id) MCI_CMDSENT|MCI_CMDRESPEND) && cmd) mmci_cmd_irq(host, cmd, status); - data = host->data; - if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_STARTBITERR| - MCI_TXUNDERRUN|MCI_RXOVERRUN|MCI_DATAEND| - MCI_DATABLOCKEND) && data) - mmci_data_irq(host, data, status); + mmci_data_irq(host, host->data, status); /* Don't poll for busy completion in irq context. */ if (host->busy_status)