aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVenkat Gopalakrishnan <venkatg@codeaurora.org>2015-08-10 14:55:23 -0700
committerAjay Dudani <adudani@google.com>2016-04-06 17:27:30 -0700
commitfb6e0079528277018f6358736663c467bf85c6a2 (patch)
treeb8ea5b2455d5e1aaebd4a3439b96c828eb48157f
parent7ba95aa57ae06d4a387c12deb612d5717af72047 (diff)
mmc: cmdq_hci: Add a memory barrier before ringing doorbellandroid-lego-6.0.1_r0.2
Ensure the task descriptor list memory is flushed before ringing the doorbell by adding a memory barrier. Also commit the doorbell write immediately to help improve performance. Change-Id: I321d5bed95b802d4bcc00836ce9cdede316b29f5 Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
-rw-r--r--drivers/mmc/host/cmdq_hci.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mmc/host/cmdq_hci.c b/drivers/mmc/host/cmdq_hci.c
index ebc60011000a..6a0a6b0bbd2e 100644
--- a/drivers/mmc/host/cmdq_hci.c
+++ b/drivers/mmc/host/cmdq_hci.c
@@ -614,8 +614,9 @@ static int cmdq_request(struct mmc_host *mmc, struct mmc_request *mrq)
cq_host->mrq_slot[DCMD_SLOT] = mrq;
if (cq_host->ops->pm_qos_update)
cq_host->ops->pm_qos_update(mmc, NULL, true);
- cmdq_writel(cq_host, 1 << DCMD_SLOT, CQTDBR);
- return 0;
+ /* DCMD's are always issued on a fixed slot */
+ tag = DCMD_SLOT;
+ goto ring_doorbell;
}
if (cq_host->ops->crypto_cfg) {
@@ -649,7 +650,12 @@ static int cmdq_request(struct mmc_host *mmc, struct mmc_request *mrq)
if (cq_host->ops->set_tranfer_params)
cq_host->ops->set_tranfer_params(mmc);
+ring_doorbell:
+ /* Ensure the task descriptor list is flushed before ringing doorbell */
+ wmb();
cmdq_writel(cq_host, 1 << tag, CQTDBR);
+ /* Commit the doorbell write immediately */
+ wmb();
out:
return err;