All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabian Vogt <fabian@ritter-vogt.de>
To: Felipe Balbi <balbi@kernel.org>
Cc: Fabian Vogt <fabian@ritter-vogt.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Yuan-Hsin Chen <yhchen@faraday-tech.com>,
	linux-usb@vger.kernel.org
Subject: [PATCH 2/7] fotg210-udc: Fix EP0 IN requests bigger than two packets
Date: Wed, 24 Mar 2021 15:11:10 +0100	[thread overview]
Message-ID: <20210324141115.9384-3-fabian@ritter-vogt.de> (raw)
In-Reply-To: <20210324141115.9384-1-fabian@ritter-vogt.de>

For a 134 Byte packet, it sends the first two 64 Byte packets just fine,
but then notice that less than a packet is remaining and call fotg210_done
without actually sending the rest.

Fixes: b84a8dee23fd ("usb: gadget: add Faraday fotg210_udc driver")
Signed-off-by: Fabian Vogt <fabian@ritter-vogt.de>
---
 drivers/usb/gadget/udc/fotg210-udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/fotg210-udc.c b/drivers/usb/gadget/udc/fotg210-udc.c
index 482d867ac96f..539808f62e2e 100644
--- a/drivers/usb/gadget/udc/fotg210-udc.c
+++ b/drivers/usb/gadget/udc/fotg210-udc.c
@@ -834,7 +834,7 @@ static void fotg210_ep0in(struct fotg210_udc *fotg210)
 		if (req->req.length)
 			fotg210_start_dma(ep, req);
 
-		if ((req->req.length - req->req.actual) < ep->ep.maxpacket)
+		if (req->req.actual == req->req.length)
 			fotg210_done(ep, req, 0);
 	} else {
 		fotg210_set_cxdone(fotg210);
-- 
2.25.1


  parent reply	other threads:[~2021-03-24 14:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24 14:11 [PATCH 0/7] Fix the fotg210-udc driver Fabian Vogt
2021-03-24 14:11 ` [PATCH 1/7] fotg210-udc: Fix DMA on EP0 for length > max packet size Fabian Vogt
2021-03-24 14:11 ` Fabian Vogt [this message]
2021-03-24 14:11 ` [PATCH 3/7] fotg210-udc: Remove a dubious condition leading to fotg210_done Fabian Vogt
2021-03-24 14:11 ` [PATCH 4/7] fotg210-udc: Mask GRP2 interrupts we don't handle Fabian Vogt
2021-03-24 14:11 ` [PATCH 5/7] fotg210-udc: Call usb_gadget_udc_reset Fabian Vogt
2021-03-24 14:11 ` [PATCH 6/7] fotg210-udc: Don't DMA more than the buffer can take Fabian Vogt
2021-03-24 14:11 ` [PATCH 7/7] fotg210-udc: Complete OUT requests on short packets Fabian Vogt

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=20210324141115.9384-3-fabian@ritter-vogt.de \
    --to=fabian@ritter-vogt.de \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=yhchen@faraday-tech.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.