diff options
author | Xu Ziyuan <xzy.xu@rock-chips.com> | 2016-07-28 02:25:47 (GMT) |
---|---|---|
committer | Jaehoon Chung <jh80.chung@samsung.com> | 2016-08-05 05:04:31 (GMT) |
commit | 2990e07a33159b1c23325c2c789cdb3f9ab4d89c (patch) | |
tree | be87b57526b8da5d08e9ebae7e0212440b134f59 /drivers/mmc | |
parent | 14bed52d276afd36b9674ee7aa2c2ad9d2f4e59e (diff) | |
download | u-boot-fsl-qoriq-2990e07a33159b1c23325c2c789cdb3f9ab4d89c.tar.xz |
mmc: dw_mmc: transfer proper bytes to FIFO
The former implement, dw_mmc will push and pop the redundant data to
FIFO, we should transfer it according to the real size.
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/dw_mmc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index a6a5fc6..a0a582b 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -125,6 +125,7 @@ static int dwmci_data_transfer(struct dwmci_host *host, struct mmc_data *data) len = dwmci_readl(host, DWMCI_STATUS); len = (len >> DWMCI_FIFO_SHIFT) & DWMCI_FIFO_MASK; + len = min(size, len); for (i = 0; i < len; i++) *buf++ = dwmci_readl(host, DWMCI_DATA); @@ -138,6 +139,7 @@ static int dwmci_data_transfer(struct dwmci_host *host, struct mmc_data *data) len = fifo_depth - ((len >> DWMCI_FIFO_SHIFT) & DWMCI_FIFO_MASK); + len = min(size, len); for (i = 0; i < len; i++) dwmci_writel(host, DWMCI_DATA, *buf++); |