public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: balbi@kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: dwc3: gadget: Fix failure to detect end of transfer
Date: Mon, 30 Dec 2019 19:57:03 +0100	[thread overview]
Message-ID: <20191230185703.GA1763367@kroah.com> (raw)
In-Reply-To: <20191230161321.2738541-1-bryan.odonoghue@linaro.org>

On Mon, Dec 30, 2019 at 04:13:21PM +0000, Bryan O'Donoghue wrote:
> A recent bugfix 8c7d4b7b3d43 ("usb: dwc3: gadget: Fix logical condition")
> correctly fixes a logical error in the gadget driver but, exposes a further
> bug in determining when a transfer has completed.
> 
> Prior to 8c7d4b7b3d43 we were calling dwc3_gadget_giveback() when we
> shouldn't have been. Afer this change the below test fails to complete on
> my hardware.
> 
> Host:
> echo "host" > /dev/ttyACM0
> 
> Device:
> cat < /dev/ttyGS0
> 
> This is caused by the driver incorrectly detecting end of transfer, a
> problem that had previous been masked by the continuous calling of
> dwc3_gadget_giveback() prior to 8c7d4b7b3d43.
> 
> Remediate by making the test <= instead of ==
> 
> Fixes: e0c42ce590fe ("usb: dwc3: gadget: simplify IOC handling")
> 
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
>  drivers/usb/dwc3/gadget.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

I think this patch:
	https://lore.kernel.org/linux-usb/ac5a3593a94fdaa3d92e6352356b5f7a01ccdc7c.1576291140.git.thinhn@synopsys.com/

should fix this issue instead, right?

If not, do I need to include both of these?

thanks,

greg k-h

  reply	other threads:[~2019-12-30 18:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-30 16:13 [PATCH] usb: dwc3: gadget: Fix failure to detect end of transfer Bryan O'Donoghue
2019-12-30 18:57 ` Greg KH [this message]
2019-12-31  0:05   ` Bryan O'Donoghue
2019-12-31  0:21     ` Bryan O'Donoghue

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=20191230185703.GA1763367@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=balbi@kernel.org \
    --cc=bryan.odonoghue@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox