All of lore.kernel.org
 help / color / mirror / Atom feed
From: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
To: linux-usb@vger.kernel.org
Cc: John.Youn@synopsys.com, balbi@kernel.org, yousaf.kaukab@intel.com
Subject: [PATCH v2] usb: dwc2: gadget: Fix sending zero length packet in DDMA mode.
Date: Thu, 24 Jun 2021 04:13:56 -0700	[thread overview]
Message-ID: <7de9dbf515b15464f8f6db3bab76123c950597d7.1624533048.git.Minas.Harutyunyan@synopsys.com> (raw)

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")
Signed-off-by: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
---
 Changes in v2:
 - Minor typo correction in comments

 drivers/usb/dwc2/gadget.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index c581ee41ac81..bf456b4e191f 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -2749,9 +2749,11 @@ 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);
+		if (!using_desc_dma(hsotg))
+			dwc2_hsotg_program_zlp(hsotg, hs_ep);
+
 		hs_ep->send_zlp = 0;
 		/* transfer will be completed on next complete interrupt */
 		return;

base-commit: 00a738b86ec0c88ad4745f658966f951cbe4c885
-- 
2.11.0


                 reply	other threads:[~2021-06-24 11:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7de9dbf515b15464f8f6db3bab76123c950597d7.1624533048.git.Minas.Harutyunyan@synopsys.com \
    --to=minas.harutyunyan@synopsys.com \
    --cc=John.Youn@synopsys.com \
    --cc=balbi@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=yousaf.kaukab@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.