From patchwork Mon Jun 16 08:09:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 4356701 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C015EBEEAA for ; Mon, 16 Jun 2014 08:09:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D6518201ED for ; Mon, 16 Jun 2014 08:09:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BF170201B9 for ; Mon, 16 Jun 2014 08:09:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754109AbaFPIJQ (ORCPT ); Mon, 16 Jun 2014 04:09:16 -0400 Received: from mail-la0-f45.google.com ([209.85.215.45]:58263 "EHLO mail-la0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754526AbaFPIJO (ORCPT ); Mon, 16 Jun 2014 04:09:14 -0400 Received: by mail-la0-f45.google.com with SMTP id hr17so387188lab.32 for ; Mon, 16 Jun 2014 01:09:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=1oSptoH2N/GuViTvoC2rhQPnh5y2itN5ap/8E7esYcI=; b=DKw+0kCJhJvi/DIfKJcIbpJeRX57dtU9WzwYw/plErywqgPSH5dM+K+naw9ARa7hIP H29cCDGpTHZBwQdEwl/bx+uh9ouQpBS3P1n1C2fFXvOez2/IWQ+BhPhAPRSCWAx/J6HR QjQnpagt5gqu0/TEnCy1jQpqB4wW6ZeQrjcJEy4rEg8zMVXiEt6794wyBjsViBkr8pMc xJXCtFpHridhWVHrnHQLEkXmvHiuGn6HJfyff4lREU0xRewvYNTrSfYA1pGMsKLdOnqy drnEjrH7aCp/J9BTppG7qfTsGTeyj1KYe0sYeacihCI0iK/6iIpwNYgirLNFZbnczDZi RLcg== X-Gm-Message-State: ALoCoQlb681srkLx1s2Jbn+hp+EExk3oMd/+4gApburPEIhPVJk/E73Shqau0pUTBBXwe8MdBqMf X-Received: by 10.112.143.98 with SMTP id sd2mr12501476lbb.15.1402906152898; Mon, 16 Jun 2014 01:09: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 d3sm8044276lbw.2.2014.06.16.01.09.10 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 01:09:11 -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 V2 3/3] mmc: mmci: Reverse IRQ handling for the arm_variant Date: Mon, 16 Jun 2014 10:09:07 +0200 Message-Id: <1402906147-26596-1-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 5d20bfba..e4d4707 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 = { @@ -105,6 +107,7 @@ static struct variant_data variant_arm = { .datalength_bits = 16, .pwrreg_powerup = MCI_PWR_UP, .f_max = 100000000, + .reversed_irq_handling = true, }; static struct variant_data variant_arm_extended_fifo = { @@ -1236,8 +1239,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)