In message: [linux-yocto][v5.15/standard/preempt-rt/sdkv5.15/xlnx-soc][PATCH] 
usb: dwc3: gadget: do cleanup for dwc3_stop_active_transfer
on 07/04/2023 [email protected] wrote:

> From: Quanyang Wang <[email protected]>
> 
> The cmd_endtransfer has been move to a new function
> __dwc3_stop_active_transfer in the commit 1536e51c30ada ("usb: dwc3:
> gadget: move cmd_endtransfer to extra function"), but it is brought back
> by merging. So delete it to fix compile error.
> 
> Signed-off-by: Quanyang Wang <[email protected]>
> ---
> Hi Bruce,
> Would you please help merge this patch to the branches:
>       v5.15/standard/preempt-rt/sdkv5.15/xlnx-soc
>       v5.15/standard/sdkv5.15/xlnx-soc

merged.

Bruce

> Thanks,
> Quanyang
> ---
>  drivers/usb/dwc3/gadget.c | 38 +++++++++++---------------------------
>  1 file changed, 11 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index 9e9133ac9ab9b..79ea40f69db70 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -3767,6 +3767,17 @@ void dwc3_stop_active_transfer(struct dwc3_ep *dep, 
> bool force, bool interrupt)
>           (dep->flags & DWC3_EP_END_TRANSFER_PENDING))
>               return;
>  
> +     if (!interrupt)
> +             dep->flags &= ~DWC3_EP_TRANSFER_STARTED;
> +     else
> +             dep->flags |= DWC3_EP_END_TRANSFER_PENDING;
> +     /*
> +      * when transfer is stopped with force rm bit false, it can be
> +      * restarted by passing resource_index in params; don't loose it
> +      */
> +     if (force)
> +             dep->resource_index = 0;
> +
>       /*
>        * NOTICE: We are violating what the Databook says about the
>        * EndTransfer command. Ideally we would _always_ wait for the
> @@ -3797,33 +3808,6 @@ void dwc3_stop_active_transfer(struct dwc3_ep *dep, 
> bool force, bool interrupt)
>        * controller to handle the command completely before DWC3
>        * remove requests attempts to unmap USB request buffers.
>        */
> -
> -     cmd = DWC3_DEPCMD_ENDTRANSFER;
> -     cmd |= force ? DWC3_DEPCMD_HIPRI_FORCERM : 0;
> -     cmd |= interrupt ? DWC3_DEPCMD_CMDIOC : 0;
> -     cmd |= DWC3_DEPCMD_PARAM(dep->resource_index);
> -     memset(&params, 0, sizeof(params));
> -     ret = dwc3_send_gadget_ep_cmd(dep, cmd, &params);
> -     WARN_ON_ONCE(ret);
> -
> -     /*
> -      * when transfer is stopped with force rm bit false, it can be
> -      * restarted by passing resource_index in params; don't loose it
> -      */
> -     if (force)
> -             dep->resource_index = 0;
> -
> -     if (!interrupt)
> -             dep->flags &= ~DWC3_EP_TRANSFER_STARTED;
> -     else
> -             dep->flags |= DWC3_EP_END_TRANSFER_PENDING;
> -     /*
> -      * when transfer is stopped with force rm bit false, it can be
> -      * restarted by passing resource_index in params; don't loose it
> -      */
> -     if (force)
> -             dep->resource_index = 0;
> -
>       __dwc3_stop_active_transfer(dep, force, interrupt);
>  }
>  
> -- 
> 2.36.1
> 
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#12362): 
https://lists.yoctoproject.org/g/linux-yocto/message/12362
Mute This Topic: https://lists.yoctoproject.org/mt/98119766/21656
Group Owner: [email protected]
Unsubscribe: 
https://lists.yoctoproject.org/g/linux-yocto/leave/6687884/21656/624485779/xyzzy
 [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to