summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFaiz Abbas <faiz_abbas@ti.com>2019-10-15 00:08:49 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-29 09:22:30 +0100
commit9857a43849dbd0ff0586fdabce75ac71e22d0d49 (patch)
tree2fa55047b93c13486c3f42920c939f1f7a886c21
parent1e495b4e410e40945cbcf4ff5db6da0b7d602bbc (diff)
mmc: cqhci: Commit descriptors before setting the doorbell
commit c07d0073b9ec80a139d07ebf78e9c30d2a28279e upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/mmc/host/cqhci.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mmc/host/cqhci.c b/drivers/mmc/host/cqhci.c
index f7bdae5354c3..5047f7343ffc 100644
--- a/drivers/mmc/host/cqhci.c
+++ b/drivers/mmc/host/cqhci.c
@@ -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",