From: Xu Ziyuan Date: Thu, 28 Jul 2016 02:25:48 +0000 (+0800) Subject: mmc: dw_mmc: fix data starvation by host timeout under FIFO mode X-Git-Tag: v2016.09-rc2~98^2~2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=720724d09852858a3938f7bfcbbb3d1a0fdd6b4c;p=oweals%2Fu-boot.git mmc: dw_mmc: fix data starvation by host timeout under FIFO mode This patch fixes data starvation by host timeout(HTO) error interrupt which occurred under FIFO mode transfer on rk3036 board. The former implement, the actual bytes were transmitted may be less than should be. The size will still subtract value of len in case of there is no receive/transmit FIFO data request interrupt. Signed-off-by: Ziyuan Xu Acked-by: Jaehoon Chung Reviewed-by: Simon Glass Signed-off-by: Jaehoon Chung --- diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index a0a582b442..afc674dd14 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -119,6 +119,7 @@ static int dwmci_data_transfer(struct dwmci_host *host, struct mmc_data *data) } if (host->fifo_mode && size) { + len = 0; if (data->flags == MMC_DATA_READ) { if ((dwmci_readl(host, DWMCI_RINTSTS) & DWMCI_INTMSK_RXDR)) {