[U-Boot] [PATCH 1/2] mmc: dw_mmc: transfer proper bytes to FIFO

Jaehoon Chung jh80.chung at samsung.com
Thu Jul 28 10:09:25 CEST 2016


Hi Ziyuan,

On 07/28/2016 11:25 AM, Ziyuan Xu wrote:
> The former implement, dw_mmc will push and pop the redundant data to
> FIFO, we should transfer it according to the real size.

Looks good to me.

Acked-by: Jaehoon Chung <jh80.chung at samsung.com>

Best Regards,
Jaehoon Chung

> 
> Signed-off-by: Ziyuan Xu <xzy.xu at rock-chips.com>
> ---
> 
>  drivers/mmc/dw_mmc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
> index 2cf7bae..38d4a64 100644
> --- a/drivers/mmc/dw_mmc.c
> +++ b/drivers/mmc/dw_mmc.c
> @@ -126,6 +126,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);
> @@ -139,6 +140,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++);
> 



More information about the U-Boot mailing list