Skip to contentSkip to conversation

mmc: sdhci: add the udelay for completed post-request

PATCH Superseded Jaehoon Chung 2 participants 2 messages Jul 27, 2012 – Aug 30, 2012 MMC, SD and SDIO

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 4/4 mmc: sdhci: add the udelay for completed post-request

To ensure that complete the request, add udelay(100).
Also increased the timeout value to 10000.
(Because timeout value is short, there is the case that didn't transfer data)

---
 drivers/mmc/sdhci.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/mmc/sdhci.c +2 -1
index ac39e48..f71a14b 100644
@@ -83,7 +83,7 @@ static int sdhci_transfer_data(struct sdhci_host *host, struct mmc_data *data,
 {
 	unsigned int stat, rdy, mask, timeout, block = 0;
 
-	timeout = 10000;
+	timeout = 100000;
 	rdy = SDHCI_INT_SPACE_AVAIL | SDHCI_INT_DATA_AVAIL;
 	mask = SDHCI_DATA_AVAILABLE | SDHCI_SPACE_AVAILABLE;
 	do {
@@ -239,6 +239,7 @@ int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
 		if ((host->quirks & SDHCI_QUIRK_32BIT_DMA_ADDR) &&
 				!is_aligned && (data->flags == MMC_DATA_READ))
 			memcpy(data->dest, aligned_buffer, trans_bytes);
+		udelay(100);
 		return 0;
 	}
 
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH v2 4/4 mmc: sdhci: add the udelay for completed post-request

Quoted 23 lines · Jaehoon Chung

To ensure that complete the request, add udelay(100).
Also increased the timeout value to 10000.
(Because timeout value is short, there is the case that didn't transfer data)

---
 drivers/mmc/sdhci.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/mmc/sdhci.c +1 -1
index ac39e48..f71a14b 100644
@@ -83,7 +83,7 @@ static int sdhci_transfer_data(struct sdhci_host *host, struct mmc_data *data,
 {
        unsigned int stat, rdy, mask, timeout, block = 0;
 
-       timeout = 10000;
+       timeout = 100000;
        rdy = SDHCI_INT_SPACE_AVAIL | SDHCI_INT_DATA_AVAIL;
        mask = SDHCI_DATA_AVAILABLE | SDHCI_SPACE_AVAILABLE;
        do {

drivers/mmc/sdhci.c int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd, · line 242

Quoted 4 lines
drivers/mmc/sdhci.c +1 -0
@@ -239,6 +239,7 @@ int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
                if ((host->quirks & SDHCI_QUIRK_32BIT_DMA_ADDR) &&
                                !is_aligned && (data->flags == MMC_DATA_READ))
                        memcpy(data->dest, aligned_buffer, trans_bytes);
+               udelay(100);

These sorts of changes (both the increased timeout, and the udelay) look very much like attempting to use time to substitute for proper coherency assurances. What "request" is this udelay allowing to finish?

Andy