mmc: cqhci: Commit descriptors before setting the doorbell
authorFaiz Abbas <faiz_abbas@ti.com>
Mon, 14 Oct 2019 18:38:49 +0000 (00:08 +0530)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 21 Oct 2019 11:38:23 +0000 (13:38 +0200)
Add a write memory barrier to make sure that descriptors are actually
written to memory, before ringing the doorbell.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/cqhci.c

index f7bdae5354c3c48af7bb26d828b83227b057d8bf..5047f7343ffcf41ce3a861ffbb104ac2f6586806 100644 (file)
@@ -611,7 +611,8 @@ static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
        cq_host->slot[tag].flags = 0;
 
        cq_host->qcnt += 1;
-
+       /* Make sure descriptors are ready before ringing the doorbell */
+       wmb();
        cqhci_writel(cq_host, 1 << tag, CQHCI_TDBR);
        if (!(cqhci_readl(cq_host, CQHCI_TDBR) & (1 << tag)))
                pr_debug("%s: cqhci: doorbell not set for tag %d\n",