From patchwork Mon Jun 16 07:58:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 31920 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f72.google.com (mail-pb0-f72.google.com [209.85.160.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ACF5420E7A for ; Mon, 16 Jun 2014 07:58:17 +0000 (UTC) Received: by mail-pb0-f72.google.com with SMTP id ma3sf19657918pbc.7 for ; Mon, 16 Jun 2014 00:58:16 -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=Dn5mRzsRCi1wA1uX8LDmhEHemzFYdeiLrZUzha/F4Js=; b=DCsXdi6I0PLSMkkXpuDFvBDXWH/XKA+yLhUyUY/TKQ2woarr6LOkoYx9ukngN3REsJ 0w69av6tn19t/nNPemoXNDfoizMvkB9cq9hXEXGRW6Et9UIl3kkDj6uxK4ISOD3F1XMf m5v/PIyuZy/10MpmYBK0UCKEY+GMD5VaRcsqNGwMZD+tbNpif+j2fAoBhMoahw62htaa rNmOdKOD0ZapwZcG3VNfHL8PflyOKUoR5yp2vw4Va15P3BsrnXc5v7AhccDsK9ymZVRC maU43gf8BHFGmryY4u+aV+QJSNORZqPWpu4HrB/iDuU7A57hoXUJeTQOT87QB1JOQNEH OP4Q== X-Gm-Message-State: ALoCoQnSc/MBdHB2Rt0dZe2w/kLP90V4DQ56LEqZOH+xSPZaasO5NeR7jKvZR/05wK9RlEa6VExI X-Received: by 10.66.145.33 with SMTP id sr1mr841081pab.18.1402905496939; Mon, 16 Jun 2014 00:58:16 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.43.135 with SMTP id e7ls4484181qga.70.gmail; Mon, 16 Jun 2014 00:58:16 -0700 (PDT) X-Received: by 10.58.168.146 with SMTP id zw18mr334819veb.32.1402905496845; Mon, 16 Jun 2014 00:58:16 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id yf17si3805491vdb.9.2014.06.16.00.58.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 00:58:16 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.171 as permitted sender) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id jz11so5620943veb.2 for ; Mon, 16 Jun 2014 00:58:16 -0700 (PDT) X-Received: by 10.58.132.41 with SMTP id or9mr14883136veb.5.1402905496777; Mon, 16 Jun 2014 00:58:16 -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 vs6csp116930vcb; Mon, 16 Jun 2014 00:58:16 -0700 (PDT) X-Received: by 10.113.3.167 with SMTP id bx7mr544435lbd.64.1402905495329; Mon, 16 Jun 2014 00:58:15 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com [209.85.217.171]) by mx.google.com with ESMTPS id nv6si14093351lbb.29.2014.06.16.00.58.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 00:58:15 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by mail-lb0-f171.google.com with SMTP id s7so2590295lbd.2 for ; Mon, 16 Jun 2014 00:58:14 -0700 (PDT) X-Received: by 10.112.133.198 with SMTP id pe6mr338552lbb.76.1402905494840; Mon, 16 Jun 2014 00:58:14 -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.12 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 00:58:14 -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 Subject: [PATCH 3/3] mmc: mmci: Reverse IRQ handling for the arm_variant Date: Mon, 16 Jun 2014 09:58:03 +0200 Message-Id: <1402905483-22567-4-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.171 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: , Commit "mmc: mmci: Handle CMD irq before DATA irq", caused an issue when using the ARM model of the PL181 and running QEMU. The bug was reported for the following QEMU version: $ qemu-system-arm -version QEMU emulator version 2.0.0 (Debian 2.0.0+dfsg-2ubuntu1.1), Copyright (c) 2003-2008 Fabrice Bellard To resolve the problem, let's restore the old behavior were the DATA irq is handled prior the CMD irq, but only for the arm_variant, which the problem was reported for. Reported-by: John Stultz Cc: Peter Maydell Cc: Russell King Signed-off-by: Ulf Hansson --- drivers/mmc/host/mmci.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 5d20bfba..c7e1d42 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -74,6 +74,7 @@ static unsigned int fmax = 515633; * @pwrreg_nopower: bits in MMCIPOWER don't controls ext. power supply * @explicit_mclk_control: enable explicit mclk control in driver. * @qcom_fifo: enables qcom specific fifo pio read logic. + * @reversed_irq_handling: handle data irq before cmd irq. */ struct variant_data { unsigned int clkreg; @@ -97,6 +98,7 @@ struct variant_data { bool pwrreg_nopower; bool explicit_mclk_control; bool qcom_fifo; + bool reversed_irq_handling; }; static struct variant_data variant_arm = { @@ -1236,8 +1238,13 @@ static irqreturn_t mmci_irq(int irq, void *dev_id) dev_dbg(mmc_dev(host->mmc), "irq0 (data+cmd) %08x\n", status); - mmci_cmd_irq(host, host->cmd, status); - mmci_data_irq(host, host->data, status); + if (host->variant->reversed_irq_handling) { + mmci_data_irq(host, host->data, status); + mmci_cmd_irq(host, host->cmd, status); + } else { + mmci_cmd_irq(host, host->cmd, status); + mmci_data_irq(host, host->data, status); + } /* Don't poll for busy completion in irq context. */ if (host->busy_status)