From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) (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 26396155757 for ; Thu, 19 Dec 2024 04:06:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734581222; cv=none; b=jN5WF5wOr9PADMB2nctfEjGA9p+OlJBYNrXpGT3Hb+t1RvACEwB23ZTIbDV5YLd4Lmm/Wscrq6zk5tlgbFYGe/V39N1GVxL1BnbjNMS+09krdHmw/aHk+7uiIJDGK4GVAfl1pzF6P4oEENPht0KAl+r0LwenSkKgGGGRSAY1Bs4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734581222; c=relaxed/simple; bh=nZbCAbcuMx4JfVdnLbdc2spSIOkfSaL2leiWJMFju/4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:From:In-Reply-To: Content-Type:References; b=cHDiwQcn3Qq7SMIdJnPmMiqR9xlX9m2HWyo3RxDnvSA16xv3AbM0ZHG96F3nxeAFuuYnyJkmbf245g0n2jsLSjQ8JHLUyY2xzT0RPVxezOacQnYGcpd2yImufUQTRIuuq/rvygE35XuE9lHYr1VuFz9Ho6R4mEeE3/QsXEsJmYY= 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=feUX2YNu; arc=none smtp.client-ip=203.254.224.34 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="feUX2YNu" Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20241219040657epoutp047b82cbe4548babee5e6e6f2442c2781e~SeG1ABbjQ3155731557epoutp04f for ; Thu, 19 Dec 2024 04:06:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20241219040657epoutp047b82cbe4548babee5e6e6f2442c2781e~SeG1ABbjQ3155731557epoutp04f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1734581217; bh=SZaLiOz3iAghxld63UE8Ygw+URk9/P2BnDospR2Tb6Q=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=feUX2YNunyqSy9vprssyttZvmUWOZ6v3dQgthzNstLDQqPZHzHdRxoPKDfyqy7P1i zUuG1YxurcC2sZHITqz+isPBD0t7TwB0jAkHn/45HUgiLFO+qSGEFVyj/9vtPlBbcn e0jZ7xCVB1vAdHsjPiUHdZrKz8NW9Odk/7KQMx2Q= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20241219040656epcas5p412570b11588e4c0cc5aeb02b0df5a802~SeG0Ryaok0414804148epcas5p4N; Thu, 19 Dec 2024 04:06:56 +0000 (GMT) Received: from epsmges5p2new.samsung.com (unknown [182.195.38.179]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4YDH730Ggzz4x9Pq; Thu, 19 Dec 2024 04:06:55 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 9E.10.19933.EDB93676; Thu, 19 Dec 2024 13:06:54 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p2.samsung.com (KnoxPortal) with ESMTPA id 20241219040654epcas5p238d335586f3a418459bcd48292e6745f~SeGykn5HU0538305383epcas5p2i; Thu, 19 Dec 2024 04:06:54 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20241219040654epsmtrp19da4c14e792113ae360443cba5ffd452~SeGyjmTzJ3226232262epsmtrp16; Thu, 19 Dec 2024 04:06:54 +0000 (GMT) X-AuditID: b6c32a4a-c1fda70000004ddd-2e-67639bdee25e Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 55.FC.18729.EDB93676; Thu, 19 Dec 2024 13:06:54 +0900 (KST) Received: from [107.122.5.126] (unknown [107.122.5.126]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20241219040651epsmtip1c295690831c882f791b803ee3cbc6508~SeGv-0awv0578105781epsmtip1e; Thu, 19 Dec 2024 04:06:51 +0000 (GMT) Message-ID: <6933f402-ee55-42a1-a307-cb1b81190e3e@samsung.com> Date: Thu, 19 Dec 2024 09:36:50 +0530 Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] usb: gadget: f_midi: Fixing wMaxPacketSize exceeded issue during MIDI bind retries To: Alan Stern Cc: Greg KH , quic_jjohnson@quicinc.com, kees@kernel.org, abdul.rahim@myyahoo.com, m.grzeschik@pengutronix.de, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, 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, alim.akhtar@samsung.com, stable@vger.kernel.org Content-Language: en-US From: Selvarasu Ganesan In-Reply-To: Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrIJsWRmVeSWpSXmKPExsWy7bCml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i5HGlLMkOy+8XrmWm84ta 399bujfUk3kC1/PmXW2HJEoXr7SMPfqx3qin1HpmerrYg+drsrbxOHS8ucG+uu+Qisvdp10f VgY83LHxZVVF5R9B16/BF4+dzl8wT+ShAcuvVbeW2jp0Fldy5R0pUU+tDL2r/V/VuHOfpPnK cCO234svKT0+ya65ou2k0Z+okMLbEu/mr5v8RsZln9GRFTNf6hxdVVOmxFKckWioxVxUnAgA gjiRcXQEAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLIsWRmVeSWpSXmKPExsWy7bCSnO692cnpBq/fiFtMn7aR1eLN1VWs Fg/mbWOzuLNgGpPFqeULmSyaF69ns5i0ZyuLxd2HP1gs1r09z2pxedccNotFy1qZLba0XWGy +HT0P6tF45a7rBarOuewWFz+vpPZYsHGR4wWE35fAOo9KOog7LFpVSebx/65a9g9jr04zu7R /9fAY+KeOo/Zd38wevRtWcXo8XmTXABHFJdNSmpOZllqkb5dAlfGukd72QoOCVRsPHWKsYFx L28XIweHhICJxI8/el2MXBxCArsZJbo/n2LtYuQEiktLvJ7VxQhhC0us/PecHcQWEnjNKPHi lSGIzStgJ/Hz+w02EJtFQFXi6dF57BBxQYmTM5+wgNiiAvIS92/NAIsLC2RK3Ds1E6xeREBL YnPTS2aQxcwCl5gljv44zQyxYDWTxIYdniA2s4C4xK0n85lADmUTMJR4dsIGJMwp4C7xY1UT E0SJmUTXVog7mYF2NW+dzTyBUWgWkjNmIZk0C0nLLCQtCxhZVjFKphYU56bnFhsWGOallusV J+YWl+al6yXn525iBMewluYOxu2rPugdYmTiYDzEKMHBrCTC66aZmC7Em5JYWZValB9fVJqT WnyIUZqDRUmcV/xFb4qQQHpiSWp2ampBahFMlomDU6qBiYtxna/mhPK3P30Drn5x2Ffj6uNo vv/3wRsPYvNMino+HEwV/xNmbvDS3+z74vmnHmx76Xjccnnsv0PpTwIfygk731ZoTdjAcfZD 1boe58D4a8c26bXYnel54dM1ncVBftoJAYfUv1Y8B/VNuzKNT8w7c/BZP3/+z4lx72/+tJrG vX/9GtX7cd/uPthpZuLJ5WbBsaFk/pZnrQsnepkfdYh+XF5+5DUrxyO3//qFjcsL9nO11EcW F35ZuHqr73nNJ94+5emNz+72f7jS+kkyRKuwrCit1FE64nnTZcV7j998/vGsV9B0aZD3znsP g1XfXHlbebmjoq+W/ZbmP/dZXxI4NshvfhYWtDLo78a53UosxRmJhlrMRcWJAEwFR4RQAwAA X-CMS-MailID: 20241219040654epcas5p238d335586f3a418459bcd48292e6745f X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20241208152338epcas5p4fde427bb4467414417083221067ac7ab References: <20241208152322.1653-1-selvarasu.g@samsung.com> <2024121845-cactus-geology-8df3@gregkh> <9f16a8ac-1623-425e-a46e-41e4133218e5@samsung.com> 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