All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] mmc: dw_mmc: transfer proper bytes to FIFO
@ 2016-07-28  2:25 ` Ziyuan Xu
  2016-07-28  2:25   ` [U-Boot] [PATCH 2/2] mmc: dw_mmc: fix data starvation by host timeout under FIFO mode Ziyuan Xu
                     ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Ziyuan Xu @ 2016-07-28  2:25 UTC (permalink / raw)
  To: u-boot

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>
---

 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++);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH 2/2] mmc: dw_mmc: fix data starvation by host timeout under FIFO mode
  2016-07-28  2:25 ` [U-Boot] [PATCH 1/2] mmc: dw_mmc: transfer proper bytes to FIFO Ziyuan Xu
@ 2016-07-28  2:25   ` Ziyuan Xu
  2016-07-28  8:09     ` Jaehoon Chung
                       ` (2 more replies)
  2016-07-28  8:09   ` [U-Boot] [PATCH 1/2] mmc: dw_mmc: transfer proper bytes to FIFO Jaehoon Chung
                     ` (3 subsequent siblings)
  4 siblings, 3 replies; 9+ messages in thread
From: Ziyuan Xu @ 2016-07-28  2:25 UTC (permalink / raw)
  To: u-boot

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>
---

 drivers/mmc/dw_mmc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
index 38d4a64..41b7035 100644
--- a/drivers/mmc/dw_mmc.c
+++ b/drivers/mmc/dw_mmc.c
@@ -120,6 +120,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)) {
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH 1/2] mmc: dw_mmc: transfer proper bytes to FIFO
  2016-07-28  2:25 ` [U-Boot] [PATCH 1/2] mmc: dw_mmc: transfer proper bytes to FIFO Ziyuan Xu
  2016-07-28  2:25   ` [U-Boot] [PATCH 2/2] mmc: dw_mmc: fix data starvation by host timeout under FIFO mode Ziyuan Xu
@ 2016-07-28  8:09   ` Jaehoon Chung
  2016-08-01  2:21   ` Simon Glass
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Jaehoon Chung @ 2016-07-28  8:09 UTC (permalink / raw)
  To: u-boot

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@samsung.com>

Best Regards,
Jaehoon Chung

> 
> Signed-off-by: Ziyuan Xu <xzy.xu@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++);
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH 2/2] mmc: dw_mmc: fix data starvation by host timeout under FIFO mode
  2016-07-28  2:25   ` [U-Boot] [PATCH 2/2] mmc: dw_mmc: fix data starvation by host timeout under FIFO mode Ziyuan Xu
@ 2016-07-28  8:09     ` Jaehoon Chung
  2016-08-01  2:21     ` Simon Glass
  2016-08-05  2:27     ` [U-Boot] [U-Boot, " Jaehoon Chung
  2 siblings, 0 replies; 9+ messages in thread
From: Jaehoon Chung @ 2016-07-28  8:09 UTC (permalink / raw)
  To: u-boot

Hi Ziyuan,

On 07/28/2016 11:25 AM, Ziyuan Xu wrote:
> 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.

Looks good to me.

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

Best Regards,
Jaehoon Chung

> 
> Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
> ---
> 
>  drivers/mmc/dw_mmc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
> index 38d4a64..41b7035 100644
> --- a/drivers/mmc/dw_mmc.c
> +++ b/drivers/mmc/dw_mmc.c
> @@ -120,6 +120,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)) {
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH 1/2] mmc: dw_mmc: transfer proper bytes to FIFO
  2016-07-28  2:25 ` [U-Boot] [PATCH 1/2] mmc: dw_mmc: transfer proper bytes to FIFO Ziyuan Xu
  2016-07-28  2:25   ` [U-Boot] [PATCH 2/2] mmc: dw_mmc: fix data starvation by host timeout under FIFO mode Ziyuan Xu
  2016-07-28  8:09   ` [U-Boot] [PATCH 1/2] mmc: dw_mmc: transfer proper bytes to FIFO Jaehoon Chung
@ 2016-08-01  2:21   ` Simon Glass
  2016-08-02  2:37   ` Shawn Lin
  2016-08-05  2:27   ` [U-Boot] [U-Boot, " Jaehoon Chung
  4 siblings, 0 replies; 9+ messages in thread
From: Simon Glass @ 2016-08-01  2:21 UTC (permalink / raw)
  To: u-boot

On 27 July 2016 at 20:25, Ziyuan Xu <xzy.xu@rock-chips.com> wrote:
> 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>
> ---
>
>  drivers/mmc/dw_mmc.c | 2 ++
>  1 file changed, 2 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH 2/2] mmc: dw_mmc: fix data starvation by host timeout under FIFO mode
  2016-07-28  2:25   ` [U-Boot] [PATCH 2/2] mmc: dw_mmc: fix data starvation by host timeout under FIFO mode Ziyuan Xu
  2016-07-28  8:09     ` Jaehoon Chung
@ 2016-08-01  2:21     ` Simon Glass
  2016-08-05  2:27     ` [U-Boot] [U-Boot, " Jaehoon Chung
  2 siblings, 0 replies; 9+ messages in thread
From: Simon Glass @ 2016-08-01  2:21 UTC (permalink / raw)
  To: u-boot

On 27 July 2016 at 20:25, Ziyuan Xu <xzy.xu@rock-chips.com> wrote:
> 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>
> ---
>
>  drivers/mmc/dw_mmc.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH 1/2] mmc: dw_mmc: transfer proper bytes to FIFO
  2016-07-28  2:25 ` [U-Boot] [PATCH 1/2] mmc: dw_mmc: transfer proper bytes to FIFO Ziyuan Xu
                     ` (2 preceding siblings ...)
  2016-08-01  2:21   ` Simon Glass
@ 2016-08-02  2:37   ` Shawn Lin
  2016-08-05  2:27   ` [U-Boot] [U-Boot, " Jaehoon Chung
  4 siblings, 0 replies; 9+ messages in thread
From: Shawn Lin @ 2016-08-02  2:37 UTC (permalink / raw)
  To: u-boot

? 2016/7/28 10:25, Ziyuan Xu ??:
> The former implement, dw_mmc will push and pop the redundant data to
> FIFO, we should transfer it according to the real size.
>

Bascially I never checked any bootloader code, but I get dw_mmc
of uboot to check your patch. Obviously it should be the case you
mentioned.

Feel free to add

Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

> Signed-off-by: Ziyuan Xu <xzy.xu@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++);
>


-- 
Best Regards
Shawn Lin

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [U-Boot, 1/2] mmc: dw_mmc: transfer proper bytes to FIFO
  2016-07-28  2:25 ` [U-Boot] [PATCH 1/2] mmc: dw_mmc: transfer proper bytes to FIFO Ziyuan Xu
                     ` (3 preceding siblings ...)
  2016-08-02  2:37   ` Shawn Lin
@ 2016-08-05  2:27   ` Jaehoon Chung
  4 siblings, 0 replies; 9+ messages in thread
From: Jaehoon Chung @ 2016-08-05  2:27 UTC (permalink / raw)
  To: u-boot

On 07/28/2016 11:25 AM, Xu Ziyuan wrote:
> 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>


Applied on u-boot-mmc. Thanks!

Best Regards,
Jaehoon Chung


> ---
> 
>  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++);
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [U-Boot, 2/2] mmc: dw_mmc: fix data starvation by host timeout under FIFO mode
  2016-07-28  2:25   ` [U-Boot] [PATCH 2/2] mmc: dw_mmc: fix data starvation by host timeout under FIFO mode Ziyuan Xu
  2016-07-28  8:09     ` Jaehoon Chung
  2016-08-01  2:21     ` Simon Glass
@ 2016-08-05  2:27     ` Jaehoon Chung
  2 siblings, 0 replies; 9+ messages in thread
From: Jaehoon Chung @ 2016-08-05  2:27 UTC (permalink / raw)
  To: u-boot

On 07/28/2016 11:25 AM, Xu Ziyuan wrote:
> 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>


Applied on u-boot-mmc. Thanks!

Best Regards,
Jaehoon Chung


> ---
> 
>  drivers/mmc/dw_mmc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
> index 38d4a64..41b7035 100644
> --- a/drivers/mmc/dw_mmc.c
> +++ b/drivers/mmc/dw_mmc.c
> @@ -120,6 +120,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)) {
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-08-05  2:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20160728022619epcas1p3fea43436d829548e76a6483a24103b18@epcas1p3.samsung.com>
2016-07-28  2:25 ` [U-Boot] [PATCH 1/2] mmc: dw_mmc: transfer proper bytes to FIFO Ziyuan Xu
2016-07-28  2:25   ` [U-Boot] [PATCH 2/2] mmc: dw_mmc: fix data starvation by host timeout under FIFO mode Ziyuan Xu
2016-07-28  8:09     ` Jaehoon Chung
2016-08-01  2:21     ` Simon Glass
2016-08-05  2:27     ` [U-Boot] [U-Boot, " Jaehoon Chung
2016-07-28  8:09   ` [U-Boot] [PATCH 1/2] mmc: dw_mmc: transfer proper bytes to FIFO Jaehoon Chung
2016-08-01  2:21   ` Simon Glass
2016-08-02  2:37   ` Shawn Lin
2016-08-05  2:27   ` [U-Boot] [U-Boot, " Jaehoon Chung

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.