[U-Boot] [U-boot][SDP] Trigger watchdog before calling usb_gadget_handle_interrupts

Lukasz Majewski lukma at denx.de
Thu Oct 26 11:25:41 UTC 2017


Hi Vincent,

> This prevents board resets when calling sdp command on boards which
> have a watchdog.
> 
> Signed-off-by: Vincent Prince <vincent.prince.fr at gmail.com>
> ---
>  drivers/usb/gadget/f_sdp.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c
> index 0fae66b..c3eba6d 100644
> --- a/drivers/usb/gadget/f_sdp.c
> +++ b/drivers/usb/gadget/f_sdp.c
> @@ -32,6 +32,7 @@
>  #include <spl.h>
>  #include <image.h>
>  #include <imximage.h>
> +#include <watchdog.h>
>  
>  #define HID_REPORT_ID_MASK	0x000000ff
>  
> @@ -602,6 +603,8 @@ int sdp_init(int controller_index)
>  			puts("\rCTRL+C - Operation aborted.\n");
>  			return 1;
>  		}
> +
> +		WATCHDOG_RESET();
>  		usb_gadget_handle_interrupts(controller_index);
>  	}
>  
> @@ -712,6 +715,7 @@ void sdp_handle(int controller_index)
>  			return;
>  		}
>  
> +		WATCHDOG_RESET();
>  		usb_gadget_handle_interrupts(controller_index);
>  
>  		sdp_handle_in_ep();

Reviewed-by: Lukasz Majewski <lukma at denx.de>


Best regards,

Lukasz Majewski

--

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


More information about the U-Boot mailing list