[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <079801db770c$9610fc10$c232f430$@samsung.com>
Date: Tue, 4 Feb 2025 19:26:21 +0530
From: "Alim Akhtar" <alim.akhtar@...sung.com>
To: "'Selvarasu Ganesan'" <selvarasu.g@...sung.com>,
<gregkh@...uxfoundation.org>, <m.grzeschik@...gutronix.de>,
<kees@...nel.org>, <abdul.rahim@...ahoo.com>, <quic_jjohnson@...cinc.com>,
<quic_linyyuan@...cinc.com>, <linux-usb@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Cc: <thiagu.r@...sung.com>, <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>, <stable@...r.kernel.org>
Subject: RE: [PATCH v2] usb: gadget: f_midi: Fixing wMaxPacketSize exceeded
issue during MIDI bind retries
Hello Selvarasu,
> -----Original Message-----
> From: Selvarasu Ganesan <selvarasu.g@...sung.com>
> Sent: Saturday, January 18, 2025 11:32 AM
> To: gregkh@...uxfoundation.org; m.grzeschik@...gutronix.de;
> kees@...nel.org; abdul.rahim@...ahoo.com; quic_jjohnson@...cinc.com;
> quic_linyyuan@...cinc.com; linux-usb@...r.kernel.org; linux-
> kernel@...r.kernel.org
> Cc: alim.akhtar@...sung.com; thiagu.r@...sung.com;
> 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; Selvarasu Ganesan <selvarasu.g@...sung.com>;
> stable@...r.kernel.org
> Subject: [PATCH v2] usb: gadget: f_midi: Fixing wMaxPacketSize exceeded
> issue during MIDI bind retries
>
> The current implementation sets the wMaxPacketSize of bulk in/out
> endpoints to 1024 bytes at the end of the f_midi_bind function. However, in
> cases where there is a failure in the first midi bind attempt, consider
> rebinding. This scenario may encounter an f_midi_bind issue due to the
> previous bind setting the bulk endpoint's wMaxPacketSize to 1024 bytes,
> which exceeds the ep->maxpacket_limit where configured dwc3 TX/RX
> FIFO's maxpacket size of 512 bytes for IN/OUT endpoints in support HS
> speed only.
>
> Here the term "rebind" in this context refers to attempting to bind the MIDI
> function a second time in certain scenarios. The situations where rebinding is
> considered include:
>
> * When there is a failure in the first UDC write attempt, which may be
> caused by other functions bind along with MIDI.
> * Runtime composition change : Example : MIDI,ADB to MIDI. Or MIDI to
> MIDI,ADB.
>
> This commit addresses this issue by resetting the wMaxPacketSize before
> endpoint claim. And here there is no need to reset all values in the usb
> endpoint descriptor structure, as all members except wMaxPacketSize and
> bEndpointAddress have predefined values.
>
> This ensures that restores the endpoint to its expected configuration, and
> preventing conflicts with value of ep->maxpacket_limit. It also aligns with the
> approach used in other function drivers, which treat endpoint descriptors as
> if they were full speed before endpoint claim.
>
> Fixes: 46decc82ffd5 ("usb: gadget: unconditionally allocate hs/ss descriptor in
> bind operation")
> Cc: stable@...r.kernel.org
> Signed-off-by: Selvarasu Ganesan <selvarasu.g@...sung.com>
> ---
Reviewed-by: Alim Akhtar <alim.akhtar@...sung.com>
[Snip]
> 2.17.1
Powered by blists - more mailing lists