[PATCH u-boot-marvell 1/5] tools: kwboot: Fix sending retry of last header packet

Stefan Roese sr at denx.de
Wed Nov 3 06:37:54 CET 2021


On 27.10.21 20:56, Marek Behún wrote:
> From: Pali Rohár <pali at kernel.org>
> 
> After the trasfer of last header packet, it is possible that baudrate
> change pattern is received, and also that NAK byte is received so that
> the packet should be sent again.
> 
> Thus we should not clear the baudrate change state when sending retry
> of that packet.
> 
> Move code for initializing state variables from kwboot_xm_recv_reply()
> to kwboot_xm_sendblock().
> 
> Signed-off-by: Pali Rohár <pali at kernel.org>
> Reviewed-by: Marek Behún <marek.behun at nic.cz>

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

Thanks,
Stefan

> ---
>   tools/kwboot.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/kwboot.c b/tools/kwboot.c
> index bb7cae9f05..b2c48812c3 100644
> --- a/tools/kwboot.c
> +++ b/tools/kwboot.c
> @@ -859,11 +859,6 @@ kwboot_xm_recv_reply(int fd, char *c, int nak_on_non_xm,
>   	uint64_t recv_until = _now() + timeout;
>   	int rc;
>   
> -	if (non_xm_print)
> -		*non_xm_print = 0;
> -	if (baud_changed)
> -		*baud_changed = 0;
> -
>   	while (1) {
>   		rc = kwboot_tty_recv(fd, c, 1, timeout);
>   		if (rc) {
> @@ -929,6 +924,8 @@ kwboot_xm_sendblock(int fd, struct kwboot_block *block, int allow_non_xm,
>   	char c;
>   
>   	*done_print = 0;
> +	non_xm_print = 0;
> +	baud_changed = 0;
>   
>   	retries = 0;
>   	do {
> 


Viele Grüße,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list