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

Commit 3ccb8361 authored by Ram Prakash Gupta's avatar Ram Prakash Gupta
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: I4f26f6da871858e42bf74ecb4a8cdd9e3375ee80
Signed-off-by: default avatarVenkat Gopalakrishnan <venkatg@codeaurora.org>
Signed-off-by: default avatarRam Prakash Gupta <rampraka@codeaurora.org>
parent 47b1d6ff
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -710,8 +710,12 @@ static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq)

	cq_host->qcnt += 1;

	/* Ensure the task descriptor list is flushed before ringing doorbell */
	wmb();
	mmc_log_string(mmc, "tag: %d\n", tag);
	cqhci_writel(cq_host, 1 << tag, CQHCI_TDBR);
	/* Commit the doorbell write immediately */
	wmb();
	if (!(cqhci_readl(cq_host, CQHCI_TDBR) & (1 << tag)))
		pr_debug("%s: cqhci: doorbell not set for tag %d\n",
			 mmc_hostname(mmc), tag);