usb: dwc2: gadget: fix packet drop issue in dwc2_gadget_handle_nak

Message ID 1528814947-27098-1-git-send-email-prime.zeng@hisilicon.com
State Accepted
Commit 6e967d7e2c4822eba4847ec09037119a0418aaef
Headers show
Series
  • usb: dwc2: gadget: fix packet drop issue in dwc2_gadget_handle_nak
Related show

Commit Message

Zeng Tao June 12, 2018, 2:49 p.m.
In ISOC transfer, when the NAK interrupt happens, we shouldn't complete
a usb request, the current flow will complete one usb request with no
hardware transfer, this will lead to a packet drop on the usb bus.

Signed-off-by: Zeng Tao <prime.zeng@hisilicon.com>

---
 drivers/usb/dwc2/gadget.c | 3 ---
 1 file changed, 3 deletions(-)

-- 
2.7.4

Comments

Minas Harutyunyan June 12, 2018, 7:48 a.m. | #1
Acked-by: Minas Harutyunyan <hminas@synopsys.com>

On 6/12/2018 10:51 AM, Zeng Tao wrote:
> In ISOC transfer, when the NAK interrupt happens, we shouldn't complete
> a usb request, the current flow will complete one usb request with no
> hardware transfer, this will lead to a packet drop on the usb bus.
> 
> Signed-off-by: Zeng Tao <prime.zeng@hisilicon.com>
> ---
>   drivers/usb/dwc2/gadget.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> index f0d9ccf..fbe65f6 100644
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
> @@ -2817,9 +2817,6 @@ static void dwc2_gadget_handle_nak(struct dwc2_hsotg_ep *hs_ep)
>   
>   		tmp = dwc2_hsotg_read_frameno(hsotg);
>   		if (using_desc_dma(hsotg)) {
> -			dwc2_hsotg_complete_request(hsotg, hs_ep,
> -						    get_ep_head(hs_ep), 0);
> -
>   			hs_ep->target_frame = tmp;
>   			dwc2_gadget_incr_frame_num(hs_ep);
>   			dwc2_gadget_start_isoc_ddma(hs_ep);
>

Patch

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index f0d9ccf..fbe65f6 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -2817,9 +2817,6 @@  static void dwc2_gadget_handle_nak(struct dwc2_hsotg_ep *hs_ep)
 
 		tmp = dwc2_hsotg_read_frameno(hsotg);
 		if (using_desc_dma(hsotg)) {
-			dwc2_hsotg_complete_request(hsotg, hs_ep,
-						    get_ep_head(hs_ep), 0);
-
 			hs_ep->target_frame = tmp;
 			dwc2_gadget_incr_frame_num(hs_ep);
 			dwc2_gadget_start_isoc_ddma(hs_ep);