From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BAFCB212FBC for ; Tue, 4 Feb 2025 13:56:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.24 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738677403; cv=none; b=neouBMqJvMNzihv0sk89yg4ASi0S4br/MmnwwYlRHE7xpNzZY55eWimaL/CN15OPA98vHpSzm4/G3tBaR8xhgQs9FLnRPBnff372j/riKePS/ljM0gqEOaDGjfgz6LySMHGgZ2+KlBtSQgwc0fSnYI3D0IV50B9E1tHsoMhrCXs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738677403; c=relaxed/simple; bh=MA05jaFSLZfUedsFN65m6VbXQIjYAu102gxjryuOpUY=; h=From:To:Cc:In-Reply-To:Subject:Date:Message-ID:MIME-Version: Content-Type:References; b=b7clJT84QHam+xtsc00SCMpof9kMkj1ZPBoOatZUCNC66o/nXK6vqXEaNJboY5CM+1UfMF+Ktv9S70EQe8UhwVRkALqwanqGensasXhDJZd42Krf/AEC162SkfcQULWWivzVSNRACssEf4niCNV0/UAK7nWNBahpbmXRiwBAstQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=nq+o1xBN; arc=none smtp.client-ip=203.254.224.24 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="nq+o1xBN" Received: from epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20250204135631epoutp01ccce8b19b02f1a5a97d3768748077247~hBeAvC7Eh0126201262epoutp01X for ; Tue, 4 Feb 2025 13:56:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20250204135631epoutp01ccce8b19b02f1a5a97d3768748077247~hBeAvC7Eh0126201262epoutp01X DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1738677391; bh=vzeBvSxuLukopUf6enF/gSvN1gMI6DZKQm8HjnQpzrc=; h=From:To:Cc:In-Reply-To:Subject:Date:References:From; b=nq+o1xBNalg8aGvQbuJRB1CK7QdJQOQqaiu0rUoj2VyRqPCZrAlFP9K6g3yKPUGYE awY0BD+2t30zK8wContXHaLKOgyjT8r3r4BQ4mB7/OUks0h4tVBo9b6PijZFasSagD lBsscWBVm54fy8cHyV62YerCnrfIedB+rkndW23Q= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20250204135630epcas5p1e25e570b0224871f7b08586f3d356d8f~hBeABjTLG2007020070epcas5p1n; Tue, 4 Feb 2025 13:56:30 +0000 (GMT) Received: from epsmges5p1new.samsung.com (unknown [182.195.38.182]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4YnPzc6cKdz4x9Pp; Tue, 4 Feb 2025 13:56:28 +0000 (GMT) Received: from epcas5p2.samsung.com ( [182.195.41.40]) by epsmges5p1new.samsung.com (Symantec Messaging Gateway) with SMTP id D4.DE.20052.C8C12A76; Tue, 4 Feb 2025 22:56:28 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20250204135628epcas5p1d9a702b1f790f493b229d796de0be232~hBd9sKJus2007020070epcas5p1k; Tue, 4 Feb 2025 13:56:28 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20250204135628epsmtrp2915142de6ed6ccd079105e5b0ec24a48~hBd9rOd0B1868618686epsmtrp2Y; Tue, 4 Feb 2025 13:56:28 +0000 (GMT) X-AuditID: b6c32a49-3fffd70000004e54-f1-67a21c8c05e6 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id EF.E0.18949.C8C12A76; Tue, 4 Feb 2025 22:56:28 +0900 (KST) Received: from INBRO002756 (unknown [107.122.3.168]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20250204135625epsmtip1901feabdd5d886cfab64aee2b4f762d1~hBd65p09d1515215152epsmtip1R; Tue, 4 Feb 2025 13:56:25 +0000 (GMT) From: "Alim Akhtar" To: "'Selvarasu Ganesan'" , , , , , , , , Cc: , , , , , , , , , , In-Reply-To: <20250118060134.927-1-selvarasu.g@samsung.com> 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 Message-ID: <079801db770c$9610fc10$c232f430$@samsung.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQKAq9PyrC3Jr3SNnCEbU5tom0LBzwIRS5/Xsdw2SkA= Content-Language: en-us X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKJsWRmVeSWpSXmKPExsWy7bCmhm6PzKJ0g7939C2mT9vIavHm6ipW izsLpjFZnFq+kMmiefF6NotJe7ayWNx9+IPFYt3b86wWl3fNYbNYtKyV2WJL2xUmi09H/7Na NG65y2qx7vomRotVnXNYLI4s/8hkcfn7TmaLBRsfMVpMOihqsaK5ldlBxGPTqk42j/1z17B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tm9/n5XP1PL6GMGe7bHjGZTSvRNN3z6JyGRuVpRYX//H/PikhrJnG O6F96cTLC1fWeq/4zlaYs+nLzAnyW4s+nZ71uDAvaPvrtYbKLkosxRmJhlrMRcWJACadUN5g AwAA X-CMS-MailID: 20250204135628epcas5p1d9a702b1f790f493b229d796de0be232 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20250118060207epcas5p3913957a1c5ec9b029f1d4953f6b29751 References: <20250118060134.927-1-selvarasu.g@samsung.com> Hello Selvarasu, > -----Original Message----- > From: Selvarasu Ganesan > Sent: Saturday, January 18, 2025 11:32 AM > To: gregkh=40linuxfoundation.org; m.grzeschik=40pengutronix.de; > kees=40kernel.org; abdul.rahim=40myyahoo.com; quic_jjohnson=40quicinc.com= ; > quic_linyyuan=40quicinc.com; linux-usb=40vger.kernel.org; linux- > kernel=40vger.kernel.org > Cc: alim.akhtar=40samsung.com; thiagu.r=40samsung.com; > jh0801.jung=40samsung.com; dh10.jung=40samsung.com; > naushad=40samsung.com; akash.m5=40samsung.com; > rc93.raju=40samsung.com; taehyun.cho=40samsung.com; > hongpooh.kim=40samsung.com; eomji.oh=40samsung.com; > shijie.cai=40samsung.com; Selvarasu Ganesan ; > stable=40vger.kernel.org > Subject: =5BPATCH v2=5D usb: gadget: f_midi: Fixing wMaxPacketSize exceed= ed > issue during MIDI bind retries >=20 > 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. >=20 > Here the term =22rebind=22 in this context refers to attempting to bind t= he MIDI > function a second time in certain scenarios. The situations where rebindi= ng is > considered include: >=20 > * 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. >=20 > 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. >=20 > This ensures that restores the endpoint to its expected configuration, an= d > preventing conflicts with value of ep->maxpacket_limit. It also aligns wi= th the > approach used in other function drivers, which treat endpoint descriptors= as > if they were full speed before endpoint claim. >=20 > Fixes: 46decc82ffd5 (=22usb: gadget: unconditionally allocate hs/ss descr= iptor in > bind operation=22) > Cc: stable=40vger.kernel.org > Signed-off-by: Selvarasu Ganesan > --- Reviewed-by: Alim Akhtar =5BSnip=5D > 2.17.1