diff mbox series

[u-boot-marvell,10/14] tools: kwboot: Remove 2s delay before sending first xmodem packet

Message ID 20220125171313.14498-11-kabel@kernel.org
State Accepted
Commit 8d3b79c4a391892f270473cfc3117d45ffe05008
Delegated to: Stefan Roese
Headers show
Series Another set of kwboot improvements | expand

Commit Message

Marek Behún Jan. 25, 2022, 5:13 p.m. UTC
From: Pali Rohár <pali@kernel.org>

This delay is not needed anymore since kwboot already handles retrying
logic for incomplete xmodem packets and also forces BootROM to flush its
input queue. Removing it decreases total transfer time.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
---
 tools/kwboot.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Stefan Roese Jan. 26, 2022, 3:41 p.m. UTC | #1
On 1/25/22 18:13, Marek Behún wrote:
> From: Pali Rohár <pali@kernel.org>
> 
> This delay is not needed anymore since kwboot already handles retrying
> logic for incomplete xmodem packets and also forces BootROM to flush its
> input queue. Removing it decreases total transfer time.
> 
> Signed-off-by: Pali Rohár <pali@kernel.org>
> Signed-off-by: Marek Behún <marek.behun@nic.cz>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan


> ---
>   tools/kwboot.c | 4 ----
>   1 file changed, 4 deletions(-)
> 
> diff --git a/tools/kwboot.c b/tools/kwboot.c
> index 824ae005b2..de433c1b04 100644
> --- a/tools/kwboot.c
> +++ b/tools/kwboot.c
> @@ -1142,10 +1142,6 @@ kwboot_xmodem(int tty, const void *_img, size_t size, int baudrate)
>   	 */
>   	hdrsz += (KWBOOT_XM_BLKSZ - hdrsz % KWBOOT_XM_BLKSZ) % KWBOOT_XM_BLKSZ;
>   
> -	kwboot_printv("Waiting %d ms and flushing tty\n", blk_rsp_timeo);
> -	usleep(blk_rsp_timeo * 1000);
> -	tcflush(tty, TCIOFLUSH);
> -
>   	pnum = 1;
>   
>   	rc = kwboot_xmodem_one(tty, &pnum, 1, img, hdrsz, baudrate);

Viele Grüße,
Stefan Roese
diff mbox series

Patch

diff --git a/tools/kwboot.c b/tools/kwboot.c
index 824ae005b2..de433c1b04 100644
--- a/tools/kwboot.c
+++ b/tools/kwboot.c
@@ -1142,10 +1142,6 @@  kwboot_xmodem(int tty, const void *_img, size_t size, int baudrate)
 	 */
 	hdrsz += (KWBOOT_XM_BLKSZ - hdrsz % KWBOOT_XM_BLKSZ) % KWBOOT_XM_BLKSZ;
 
-	kwboot_printv("Waiting %d ms and flushing tty\n", blk_rsp_timeo);
-	usleep(blk_rsp_timeo * 1000);
-	tcflush(tty, TCIOFLUSH);
-
 	pnum = 1;
 
 	rc = kwboot_xmodem_one(tty, &pnum, 1, img, hdrsz, baudrate);