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 3/7] fotg210-udc: Remove a dubious condition leading to fotg210_done
Date: Wed, 24 Mar 2021 15:11:11 +0100	[thread overview]
Message-ID: <20210324141115.9384-4-fabian@ritter-vogt.de> (raw)
In-Reply-To: <20210324141115.9384-1-fabian@ritter-vogt.de>

When the EP0 IN request was not completed but less than a packet sent,
it would complete the request successfully. That doesn't make sense
and can't really happen as fotg210_start_dma always sends
min(length, maxpkt) bytes.

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 | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/udc/fotg210-udc.c b/drivers/usb/gadget/udc/fotg210-udc.c
index 539808f62e2e..911f1a5cd1f4 100644
--- a/drivers/usb/gadget/udc/fotg210-udc.c
+++ b/drivers/usb/gadget/udc/fotg210-udc.c
@@ -379,8 +379,7 @@ static void fotg210_ep0_queue(struct fotg210_ep *ep,
 	}
 	if (ep->dir_in) { /* if IN */
 		fotg210_start_dma(ep, req);
-		if ((req->req.length == req->req.actual) ||
-		    (req->req.actual < ep->ep.maxpacket))
+		if (req->req.length == req->req.actual)
 			fotg210_done(ep, req, 0);
 	} else { /* OUT */
 		u32 value = ioread32(ep->fotg210->reg + FOTG210_DMISGR0);
-- 
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 ` [PATCH 2/7] fotg210-udc: Fix EP0 IN requests bigger than two packets Fabian Vogt
2021-03-24 14:11 ` Fabian Vogt [this message]
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-4-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.