From: "Alim Akhtar" <alim.akhtar@samsung.com>
To: "'Selvarasu Ganesan'" <selvarasu.g@samsung.com>,
<gregkh@linuxfoundation.org>, <m.grzeschik@pengutronix.de>,
<kees@kernel.org>, <abdul.rahim@myyahoo.com>,
<quic_jjohnson@quicinc.com>, <quic_linyyuan@quicinc.com>,
<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <thiagu.r@samsung.com>, <jh0801.jung@samsung.com>,
<dh10.jung@samsung.com>, <naushad@samsung.com>,
<akash.m5@samsung.com>, <rc93.raju@samsung.com>,
<taehyun.cho@samsung.com>, <hongpooh.kim@samsung.com>,
<eomji.oh@samsung.com>, <shijie.cai@samsung.com>,
<stable@vger.kernel.org>
Subject: RE: [PATCH v2] usb: gadget: f_midi: Fixing wMaxPacketSize exceeded issue during MIDI bind retries
Date: Tue, 4 Feb 2025 19:26:21 +0530 [thread overview]
Message-ID: <079801db770c$9610fc10$c232f430$@samsung.com> (raw)
In-Reply-To: <20250118060134.927-1-selvarasu.g@samsung.com>
Hello Selvarasu,
> -----Original Message-----
> From: Selvarasu Ganesan <selvarasu.g@samsung.com>
> Sent: Saturday, January 18, 2025 11:32 AM
> To: gregkh@linuxfoundation.org; m.grzeschik@pengutronix.de;
> kees@kernel.org; abdul.rahim@myyahoo.com; quic_jjohnson@quicinc.com;
> quic_linyyuan@quicinc.com; linux-usb@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Cc: alim.akhtar@samsung.com; thiagu.r@samsung.com;
> jh0801.jung@samsung.com; dh10.jung@samsung.com;
> naushad@samsung.com; akash.m5@samsung.com;
> rc93.raju@samsung.com; taehyun.cho@samsung.com;
> hongpooh.kim@samsung.com; eomji.oh@samsung.com;
> shijie.cai@samsung.com; Selvarasu Ganesan <selvarasu.g@samsung.com>;
> stable@vger.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@vger.kernel.org
> Signed-off-by: Selvarasu Ganesan <selvarasu.g@samsung.com>
> ---
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
[Snip]
> 2.17.1
prev parent reply other threads:[~2025-02-04 13:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20250118060207epcas5p3913957a1c5ec9b029f1d4953f6b29751@epcas5p3.samsung.com>
2025-01-18 6:01 ` [PATCH v2] usb: gadget: f_midi: Fixing wMaxPacketSize exceeded issue during MIDI bind retries Selvarasu Ganesan
2025-02-04 13:56 ` Alim Akhtar [this message]
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='079801db770c$9610fc10$c232f430$@samsung.com' \
--to=alim.akhtar@samsung.com \
--cc=abdul.rahim@myyahoo.com \
--cc=akash.m5@samsung.com \
--cc=dh10.jung@samsung.com \
--cc=eomji.oh@samsung.com \
--cc=gregkh@linuxfoundation.org \
--cc=hongpooh.kim@samsung.com \
--cc=jh0801.jung@samsung.com \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=m.grzeschik@pengutronix.de \
--cc=naushad@samsung.com \
--cc=quic_jjohnson@quicinc.com \
--cc=quic_linyyuan@quicinc.com \
--cc=rc93.raju@samsung.com \
--cc=selvarasu.g@samsung.com \
--cc=shijie.cai@samsung.com \
--cc=stable@vger.kernel.org \
--cc=taehyun.cho@samsung.com \
--cc=thiagu.r@samsung.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).