mmc: cmdq_hci: Add a memory barrier before ringing doorbell

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>
This commit is contained in:
Venkat Gopalakrishnan 2015-08-10 14:55:23 -07:00 committed by Subhash Jadavani
parent 8f39568c53
commit 705de98157

View file

@ -593,8 +593,9 @@ static int cmdq_request(struct mmc_host *mmc, struct mmc_request *mrq)
if (mrq->cmdq_req->cmdq_req_flags & DCMD) {
cmdq_prep_dcmd_desc(mmc, mrq);
cq_host->mrq_slot[DCMD_SLOT] = mrq;
cmdq_writel(cq_host, 1 << DCMD_SLOT, CQTDBR);
goto out;
/* DCMD's are always issued on a fixed slot */
tag = DCMD_SLOT;
goto ring_doorbell;
}
if (cq_host->ops->crypto_cfg) {
@ -625,7 +626,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;