[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6933f402-ee55-42a1-a307-cb1b81190e3e@samsung.com>
Date: Thu, 19 Dec 2024 09:36:50 +0530
From: Selvarasu Ganesan <selvarasu.g@...sung.com>
To: Alan Stern <stern@...land.harvard.edu>
Cc: Greg KH <gregkh@...uxfoundation.org>, quic_jjohnson@...cinc.com,
kees@...nel.org, abdul.rahim@...ahoo.com, m.grzeschik@...gutronix.de,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
jh0801.jung@...sung.com, dh10.jung@...sung.com, naushad@...sung.com,
akash.m5@...sung.com, rc93.raju@...sung.com, taehyun.cho@...sung.com,
hongpooh.kim@...sung.com, eomji.oh@...sung.com, shijie.cai@...sung.com,
alim.akhtar@...sung.com, stable@...r.kernel.org
Subject: Re: [PATCH] usb: gadget: f_midi: Fixing wMaxPacketSize exceeded
issue during MIDI bind retries
On 12/18/2024 9:21 PM, Alan Stern wrote:
> On Wed, Dec 18, 2024 at 03:51:50PM +0530, Selvarasu Ganesan wrote:
>> The issue arises during the second time the "f_midi_bind" function is
>> called. The problem lies in the fact that the size of
>> "bulk_in_desc.wMaxPacketSize" is set to 1024 during the first call,
>> which exceeds the hardware capability of the dwc3 TX/RX FIFO
>> (ep->maxpacket_limit = 512).
> Is this gadget supposed to be able to run at SuperSpeed? I thought the
> dwc3 controller supported SuperSpeed operation.
>
> The USB-3 spec requires that all SuperSpeed bulk endpoints must have a
> wMaxPacketSize of 1024 (see Table 9-24 on p.9-25 of the USB-3.1
> specification).
>
> Alan Stern
>
Hi Alan,
No, In our platform, the DWC3 controller supports up to HighSpeed. While
DWC3 is capable of SuperSpeed operation, it is not necessary to operate
at the same speed. Moreover, even in our SoC, the DWC3 IP is limited to
supporting only USB 2.0 mode (HighSpeed) at the hardware design level.
As previously mentioned, there is no need to set the wMaxPacketSize
based on the current speed support before claiming the endpoint (before
calling usb_ep_autoconfig), as usb_ep_autoconfig treats endpoint
descriptors as if they were full-speed by default.
For reference, let's see the usb_ep_autoconfig code where the
wMaxPacketSize is set to 64 bytes if the ep->maxpacket_limit is greater
than 64. As i mentioned earlier in our specific failure scenarios, the
code does not reach this point because the wMaxPacketSize is greater
than the ep->maxpacket_limit.
struct usb_ep *usb_ep_autoconfig()
{
…
…
…
/* report (variable) full speed bulk maxpacket */
if (type == USB_ENDPOINT_XFER_BULK) {
int size = ep->maxpacket_limit;
if (size > 64)
size = 64;
desc->wMaxPacketSize = cpu_to_le16(size);
}
return ep;
}
Thanks,
Selva
Powered by blists - more mailing lists