linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@kernel.org>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>Thinh Nguyen
	<Thinh.Nguyen@synopsys.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Cc: John Youn <John.Youn@synopsys.com>
Subject: [10/15] usb: dwc3: gadget: Set maxpacket size for ep0 IN
Date: Tue, 09 Jan 2018 10:42:59 +0200	[thread overview]
Message-ID: <87lgh7zalo.fsf@linux.intel.com> (raw)

Hi,

Thinh Nguyen <Thinh.Nguyen@synopsys.com> writes:
> Hi,
>
> On 1/8/2018 4:06 AM, Felipe Balbi wrote:
>> 
>> Hi,
>> 
>> Thinh Nguyen <Thinh.Nguyen@synopsys.com> writes:
>>> There are 2 control endpoint structures for DWC3. However, the driver
>>> only updates the OUT direction control endpoint structure during
>>> ConnectDone event. DWC3 driver needs to update the endpoint max packet
>>> size for control IN endpoint as well. If the max packet size is not
>>> properly set, then the driver will incorrectly calculate the data
>>> transfer size and fail to send ZLP for HS/FS 3-stage control read
>>> transfer.
>>>
>>> The fix is simply to update the max packet size for the ep0 IN direction
>>> during ConnectDone event.
>>>
>>> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
>>> ---
>>>   drivers/usb/dwc3/gadget.c | 2 ++
>>>   1 file changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
>>> index bdf2a2014ebd..6ae924d95cbc 100644
>>> --- a/drivers/usb/dwc3/gadget.c
>>> +++ b/drivers/usb/dwc3/gadget.c
>>> @@ -2751,6 +2751,8 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc)
>>>   		break;
>>>   	}
>>>   
>>> +	dwc->eps[1]->endpoint.maxpacket = dwc->gadget.ep0->maxpacket;
>> 
>> thanks :-) I've had that on my list for a while but never got to it
>> since it has no real effects other than reporting properly on
>> tracepoints :-)
>> 
>
> Just to clarify, this is a bug. We found this issue when we test for 
> HS/FS 3-stage control read transfer for ZLP.

interesting... I have never seen such bug before. Got some tracepoints
of the problem? Also, if it's a bug, why wasn't it sent as a separate
patch with a Cc stable and a Fixes tag?

             reply	other threads:[~2018-01-09  8:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-09  8:42 Felipe Balbi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-01-11  8:29 [10/15] usb: dwc3: gadget: Set maxpacket size for ep0 IN Felipe Balbi
2018-01-09 23:47 Thinh Nguyen
2018-01-08 23:14 Thinh Nguyen
2018-01-08 12:05 Felipe Balbi
2018-01-05 20:15 Thinh Nguyen

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=87lgh7zalo.fsf@linux.intel.com \
    --to=balbi@kernel.org \
    --cc=John.Youn@synopsys.com \
    --cc=Thinh.Nguyen@synopsys.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).