Felipe Balbi <[email protected]> writes:

> So far, dwc3 has always missed request->zero
> handling for every endpoint. Let's implement
> that so we can handle cases where transfer must
> be finished with a ZLP.
>
> Note that dwc3 is a little special. Even though
> we're dealing with a ZLP, we still need a buffer
> of wMaxPacketSize bytes; to hide that detail from
> every gadget driver, we have a preallocated buffer
> of 1024 bytes (biggest bulk size) to use (and
> share) among all endpoints.
>
> Reported-by: Ravi B <[email protected]>
> Signed-off-by: Felipe Balbi <[email protected]>
> ---
>  drivers/usb/dwc3/core.h   |  4 ++++
>  drivers/usb/dwc3/gadget.c | 51 
> +++++++++++++++++++++++++++++++++++++++++++++--
>  2 files changed, 53 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
> index 36f1cb74588c..c198e52ac9f7 100644
> --- a/drivers/usb/dwc3/core.h
> +++ b/drivers/usb/dwc3/core.h
> @@ -37,6 +37,7 @@
>  #define DWC3_MSG_MAX 500
>  
>  /* Global constants */
> +#define DWC3_ZLP_BUF_SIZE    1024    /* size of a superspeed bulk */
>  #define DWC3_EP0_BOUNCE_SIZE 512
>  #define DWC3_ENDPOINTS_NUM   32
>  #define DWC3_XHCI_RESOURCES_NUM      2
> @@ -632,6 +633,7 @@ struct dwc3_request {
>       unsigned                direction:1;
>       unsigned                mapped:1;
>       unsigned                queued:1;
> +     unsigned                free_on_complete:1;

unnecessary flag. Forgot to remove it when cleaning up the patch. I'll
send v2.

-- 
balbi

Attachment: signature.asc
Description: PGP signature

Reply via email to