[PATCH 1/2] usb: Pass through timeout to drivers

Marek Vasut marex at denx.de
Sun Oct 29 12:36:14 CET 2023


On 10/29/23 08:36, Hector Martin wrote:
> The old USB code was interrupt-driven and just polled at the top level.
> This has been obsolete since interrupts were removed, which means the
> timeout support has been completely broken.
> 
> Rip out the top-level polling and just pass through the timeout
> parameter to host controller drivers. Right now this is ignored in the
> individual drivers.
> 
> Signed-off-by: Hector Martin <marcan at marcan.st>
> ---
>   common/usb.c                    | 21 ++-------------------
>   drivers/usb/host/ehci-hcd.c     |  5 +++--
>   drivers/usb/host/ohci-hcd.c     |  5 +++--
>   drivers/usb/host/r8a66597-hcd.c |  5 +++--
>   drivers/usb/host/usb-sandbox.c  |  6 ++++--
>   drivers/usb/host/usb-uclass.c   |  9 +++++----
>   drivers/usb/host/xhci.c         |  5 +++--
>   include/usb.h                   | 10 ++++++----
>   8 files changed, 29 insertions(+), 37 deletions(-)
> 

[...]

>   	int (*bulk)(struct udevice *bus, struct usb_device *udev,
> -		    unsigned long pipe, void *buffer, int length);
> +		    unsigned long pipe, void *buffer, int length,
> +		    int timeout);
>   	/**
>   	 * interrupt() - Send an interrupt message
>   	 *

Can timeout ever be negative value ?


More information about the U-Boot mailing list