mmc: dw_mmc: fix data starvation by host timeout under FIFO mode
authorXu Ziyuan <xzy.xu@rock-chips.com>
Thu, 28 Jul 2016 02:25:48 +0000 (10:25 +0800)
committerJaehoon Chung <jh80.chung@samsung.com>
Fri, 5 Aug 2016 05:04:36 +0000 (14:04 +0900)
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 <xzy.xu@rock-chips.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/mmc/dw_mmc.c

index a0a582b4421d632a17fe59159f742c571faa2788..afc674dd143dcd7f737cbbccd6ce5da85772d6df 100644 (file)
@@ -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)) {