aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mmc/host/dw_mmc.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 58476c1bb056..299c1d61b6b3 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1031,13 +1031,10 @@ static void dw_mci_read_data_pio(struct dw_mci *host)
1031 struct mmc_data *data = host->data; 1031 struct mmc_data *data = host->data;
1032 int shift = host->data_shift; 1032 int shift = host->data_shift;
1033 u32 status; 1033 u32 status;
1034 unsigned int nbytes = 0, len, old_len, count = 0; 1034 unsigned int nbytes = 0, len;
1035 1035
1036 do { 1036 do {
1037 len = SDMMC_GET_FCNT(mci_readl(host, STATUS)) << shift; 1037 len = SDMMC_GET_FCNT(mci_readl(host, STATUS)) << shift;
1038 if (count == 0)
1039 old_len = len;
1040
1041 if (offset + len <= sg->length) { 1038 if (offset + len <= sg->length) {
1042 host->pull_data(host, (void *)(buf + offset), len); 1039 host->pull_data(host, (void *)(buf + offset), len);
1043 1040
@@ -1082,7 +1079,6 @@ static void dw_mci_read_data_pio(struct dw_mci *host)
1082 tasklet_schedule(&host->tasklet); 1079 tasklet_schedule(&host->tasklet);
1083 return; 1080 return;
1084 } 1081 }
1085 count++;
1086 } while (status & SDMMC_INT_RXDR); /*if the RXDR is ready read again*/ 1082 } while (status & SDMMC_INT_RXDR); /*if the RXDR is ready read again*/
1087 len = SDMMC_GET_FCNT(mci_readl(host, STATUS)); 1083 len = SDMMC_GET_FCNT(mci_readl(host, STATUS));
1088 host->pio_offset = offset; 1084 host->pio_offset = offset;