Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 831a8bb3 authored by Venkat Gopalakrishnan's avatar Venkat Gopalakrishnan
Browse files

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: default avatarVenkat Gopalakrishnan <venkatg@codeaurora.org>
parent 0597b5d5
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -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;