aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMinas Harutyunyan <Minas.Harutyunyan@synopsys.com>2021-07-20 05:41:24 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-28 11:13:50 +0200
commitba176c1bd7ca3e9f3bec70f2637c17d2b86469d1 (patch)
tree44407d7efbea66b98f07ba35bfe69b5541ede619
parent7b9ff81c60602d16663d0b2aa830fdc999f80fd6 (diff)
downloadlinux-yocto-ba176c1bd7ca3e9f3bec70f2637c17d2b86469d1.tar.gz
linux-yocto-ba176c1bd7ca3e9f3bec70f2637c17d2b86469d1.tar.bz2
linux-yocto-ba176c1bd7ca3e9f3bec70f2637c17d2b86469d1.zip
usb: dwc2: gadget: Fix sending zero length packet in DDMA mode.
commit d53dc38857f6dbefabd9eecfcbf67b6eac9a1ef4 upstream. Sending zero length packet in DDMA mode perform by DMA descriptor by setting SP (short packet) flag. For DDMA in function dwc2_hsotg_complete_in() does not need to send zlp. Tested by USBCV MSC tests. Fixes: f71b5e2533de ("usb: dwc2: gadget: fix zero length packet transfers") Cc: stable <stable@vger.kernel.org> Signed-off-by: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com> Link: https://lore.kernel.org/r/967bad78c55dd2db1c19714eee3d0a17cf99d74a.1626777738.git.Minas.Harutyunyan@synopsys.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/dwc2/gadget.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index d0edb7e453c0..7fff96dff0a0 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -2645,12 +2645,14 @@ static void dwc2_hsotg_complete_in(struct dwc2_hsotg *hsotg,
return;
}
- /* Zlp for all endpoints, for ep0 only in DATA IN stage */
+ /* Zlp for all endpoints in non DDMA, for ep0 only in DATA IN stage */
if (hs_ep->send_zlp) {
- dwc2_hsotg_program_zlp(hsotg, hs_ep);
hs_ep->send_zlp = 0;
- /* transfer will be completed on next complete interrupt */
- return;
+ if (!using_desc_dma(hsotg)) {
+ dwc2_hsotg_program_zlp(hsotg, hs_ep);
+ /* transfer will be completed on next complete interrupt */
+ return;
+ }
}
if (hs_ep->index == 0 && hsotg->ep0_state == DWC2_EP0_DATA_IN) {