From patchwork Mon Jun 16 07:58:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 31919 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4E3CB20E7A for ; Mon, 16 Jun 2014 07:58:15 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id uy5sf29417406obc.5 for ; Mon, 16 Jun 2014 00:58:14 -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=sLgxaMTrjj4IKbQvsxmbSKRdVV/gohhVS19wuTszV34=; b=JadbUud5YIfH8eTRXdIB4hzxlf1y16oFZKoXqSSFq7vlL/aHxPMPhKdvJTxWR5fqY+ uLKuCWGcBPxuc61D+ZVGG3R6HA7Lk3BxGGnJ9Dfb6qmT4PTJb9WqDvSAytirZBtIKRSd 1Q0Nb+fnwmghX5jD+sygAQf1epEzeuTE7bcIh1Y4FV81E8LLoZXamvXMaYMHex5SDc4a yAYzSp2HTs+XObgKyDsU1WEvxOKHJXdi6KOOnd5fgSyNdNf7xjvQ33FM1WiVCT8Ksi8b EaFRU7pUs0xAyXLUOJWseQw6eHtjSNW3GeFNLiCyTXru2DiE6kSyXsIxCRcXSnqC3uiJ 9VVg== X-Gm-Message-State: ALoCoQktnQRHbFJm3+ALqsdBI+lp5mJYqvs9VMsZEQ+kcCdJ/lNzc+Em14VT4IMQc0os/FLMQuPn X-Received: by 10.42.26.77 with SMTP id e13mr1211978icc.7.1402905494972; Mon, 16 Jun 2014 00:58:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.25.108 with SMTP id 99ls1844113qgs.16.gmail; Mon, 16 Jun 2014 00:58:14 -0700 (PDT) X-Received: by 10.58.236.170 with SMTP id uv10mr486893vec.31.1402905494870; Mon, 16 Jun 2014 00:58:14 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id k3si3807786vey.59.2014.06.16.00.58.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 00:58:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.177 as permitted sender) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id i13so2016173veh.22 for ; Mon, 16 Jun 2014 00:58:14 -0700 (PDT) X-Received: by 10.52.94.8 with SMTP id cy8mr199146vdb.39.1402905494803; Mon, 16 Jun 2014 00:58:14 -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 vs6csp116927vcb; Mon, 16 Jun 2014 00:58:14 -0700 (PDT) X-Received: by 10.152.43.135 with SMTP id w7mr13520634lal.32.1402905493748; Mon, 16 Jun 2014 00:58:13 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) by mx.google.com with ESMTPS id w4si250049law.81.2014.06.16.00.58.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 00:58:13 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by mail-lb0-f179.google.com with SMTP id z11so342143lbi.24 for ; Mon, 16 Jun 2014 00:58:12 -0700 (PDT) X-Received: by 10.152.87.228 with SMTP id bb4mr281786lab.74.1402905492888; Mon, 16 Jun 2014 00:58:12 -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.11 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 00:58:12 -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 2/3] mmc: mmci: Move all CMD irq handling to mmci_cmd_irq() Date: Mon, 16 Jun 2014 09:58:02 +0200 Message-Id: <1402905483-22567-3-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.128.177 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: , This patch won't change the behavior of how mmci deals with CMD irqs. By moving code from mmci_irq() to mmci_cmd_irq(), we getter a better overview of what going on. Cc: Peter Maydell Cc: John Stultz Cc: Russell King Signed-off-by: Ulf Hansson --- drivers/mmc/host/mmci.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index a723ed2..5d20bfba 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -960,9 +960,17 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, unsigned int status) { void __iomem *base = host->base; - bool sbc = (cmd == host->mrq->sbc); - bool busy_resp = host->variant->busy_detect && - (cmd->flags & MMC_RSP_BUSY); + bool sbc, busy_resp; + + if (!cmd) + return; + + sbc = (cmd == host->mrq->sbc); + busy_resp = host->variant->busy_detect && (cmd->flags & MMC_RSP_BUSY); + + if (!((status|host->busy_status) & (MCI_CMDCRCFAIL|MCI_CMDTIMEOUT| + MCI_CMDSENT|MCI_CMDRESPEND))) + return; /* Check if we need to wait for busy completion. */ if (host->busy_status && (status & MCI_ST_CARDBUSY)) @@ -1209,8 +1217,6 @@ static irqreturn_t mmci_irq(int irq, void *dev_id) spin_lock(&host->lock); do { - struct mmc_command *cmd; - status = readl(host->base + MMCISTATUS); if (host->singleirq) { @@ -1230,11 +1236,7 @@ static irqreturn_t mmci_irq(int irq, void *dev_id) dev_dbg(mmc_dev(host->mmc), "irq0 (data+cmd) %08x\n", status); - cmd = host->cmd; - if ((status|host->busy_status) & (MCI_CMDCRCFAIL|MCI_CMDTIMEOUT| - MCI_CMDSENT|MCI_CMDRESPEND) && cmd) - mmci_cmd_irq(host, cmd, status); - + mmci_cmd_irq(host, host->cmd, status); mmci_data_irq(host, host->data, status); /* Don't poll for busy completion in irq context. */