mmc: dw_mmc: transfer proper bytes to FIFO
PATCH 1/2 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.
---
drivers/mmc/dw_mmc.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/mmc/dw_mmc.c +2 -0
@@ -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++);
Signature · 1 line
1.9.1
PATCH 2/2 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.
---
drivers/mmc/dw_mmc.c | 1 + 1 file changed, 1 insertion(+)
drivers/mmc/dw_mmc.c +1 -0
@@ -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 )) {
Signature · 1 line
1.9.1
PATCH 2/2 mmc: dw_mmc: fix data starvation by host timeout under FIFO mode
Hi Ziyuan,
Quoted 6 lines · Ziyuan Xu
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.
Best Regards,
Jaehoon Chung
Quoted 20 lines
Signed-off-by Ziyuan Xu <[email protected]>---
drivers/mmc/dw_mmc.c | 1 + 1 file changed, 1 insertion(+)drivers/mmc/dw_mmc.c +1
-0@@ -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 )) {
PATCH 2/2 mmc: dw_mmc: fix data starvation by host timeout under FIFO mode
In reply to Ziyuan XuQuoted 7 lines · Ziyuan Xu
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.
Quoted 5 lines
Signed-off-by Ziyuan Xu <[email protected]>---
drivers/mmc/dw_mmc.c | 1 + 1 file changed, 1 insertion(+)
PATCH 2/2 mmc: dw_mmc: fix data starvation by host timeout under FIFO mode
In reply to Ziyuan XuQuoted 10 lines · Xu Ziyuan
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 <[email protected]>Acked-by Jaehoon Chung <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied on u-boot-mmc. Thanks!
Best Regards,
Jaehoon Chung
Quoted 18 lines
---
drivers/mmc/dw_mmc.c | 1 + 1 file changed, 1 insertion(+)drivers/mmc/dw_mmc.c +1
-0@@ -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 )) {
PATCH 1/2 mmc: dw_mmc: transfer proper bytes to FIFO
In reply to Ziyuan XuHi Ziyuan,
Quoted 2 lines · Ziyuan Xu
The former implement,
dw_mmcwill push and pop the redundant data to FIFO, we should transfer it according to the real size.
Looks good to me.
Best Regards,
Jaehoon Chung
Quoted 28 lines
Signed-off-by Ziyuan Xu <[email protected]>---
drivers/mmc/dw_mmc.c | 2 ++ 1 file changed, 2 insertions(+)drivers/mmc/dw_mmc.c +2
-0@@ -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++);
PATCH 1/2 mmc: dw_mmc: transfer proper bytes to FIFO
In reply to Ziyuan XuQuoted 8 lines · Ziyuan Xu
The former implement,
dw_mmcwill push and pop the redundant data to FIFO, we should transfer it according to the real size.Signed-off-by Ziyuan Xu <[email protected]>---
drivers/mmc/dw_mmc.c | 2 ++ 1 file changed, 2 insertions(+)
PATCH 1/2 mmc: dw_mmc: transfer proper bytes to FIFO
In reply to Ziyuan Xu? 2016/7/28 10:25, Ziyuan Xu ??:
Quoted 3 lines
The former implement,
dw_mmcwill 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
Quoted 27 lines
Signed-off-by Ziyuan Xu <[email protected]>---
drivers/mmc/dw_mmc.c | 2 ++ 1 file changed, 2 insertions(+)drivers/mmc/dw_mmc.c +2
-0@@ -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++);
Signature · 2 lines
Best Regards Shawn Lin
PATCH 1/2 mmc: dw_mmc: transfer proper bytes to FIFO
In reply to Ziyuan XuQuoted 7 lines · Xu Ziyuan
The former implement,
dw_mmcwill push and pop the redundant data to FIFO, we should transfer it according to the real size.Signed-off-by Ziyuan Xu <[email protected]>Acked-by Jaehoon Chung <[email protected]>Reviewed-by Simon Glass <[email protected]>Reviewed-by Shawn Lin <[email protected]>
Applied on u-boot-mmc. Thanks!
Best Regards,
Jaehoon Chung
Quoted 26 lines
---
drivers/mmc/dw_mmc.c | 2 ++ 1 file changed, 2 insertions(+)drivers/mmc/dw_mmc.c +2
-0@@ -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++);