diff options
author | Tom Rini <trini@konsulko.com> | 2015-08-31 12:12:27 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-08-31 12:12:27 -0400 |
commit | b7e84c93c450480ca4ff51ad2eb56bd83c1dc368 (patch) | |
tree | 1523b49f2bd4d1880bfa12f22e11cb6ef66d2e3b /drivers/mmc/sunxi_mmc.c | |
parent | 80cd58b99e8690b05e8537dbf76276e24fcfa652 (diff) | |
parent | fa5e102019e28a5936e52d6aa9f5624cf1744a35 (diff) |
Diffstat (limited to 'drivers/mmc/sunxi_mmc.c')
-rw-r--r-- | drivers/mmc/sunxi_mmc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c index f9b9493c89..25f18adb67 100644 --- a/drivers/mmc/sunxi_mmc.c +++ b/drivers/mmc/sunxi_mmc.c @@ -257,9 +257,11 @@ static int mmc_trans_data_by_cpu(struct mmc *mmc, struct mmc_data *data) const uint32_t status_bit = reading ? SUNXI_MMC_STATUS_FIFO_EMPTY : SUNXI_MMC_STATUS_FIFO_FULL; unsigned i; - unsigned byte_cnt = data->blocksize * data->blocks; - unsigned timeout_msecs = 2000; unsigned *buff = (unsigned int *)(reading ? data->dest : data->src); + unsigned byte_cnt = data->blocksize * data->blocks; + unsigned timeout_msecs = byte_cnt >> 8; + if (timeout_msecs < 2000) + timeout_msecs = 2000; /* Always read / write data through the CPU */ setbits_le32(&mmchost->reg->gctrl, SUNXI_MMC_GCTRL_ACCESS_BY_AHB); |