* [PATCH v2 0/3] Add support for Superspeed plus EndPoint for Bulk and Isochronous transfers
@ 2025-08-28 11:29 Srikanth Chary Chennoju
2025-08-28 11:29 ` [PATCH v2 1/3] usb:gadget:zero: support for super speed plus Srikanth Chary Chennoju
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Srikanth Chary Chennoju @ 2025-08-28 11:29 UTC (permalink / raw)
To: gregkh, Thinh.Nguyen, m.grzeschik, Chris.Wulff, tiwai
Cc: linux-usb, linux-kernel, punnaiah.choudary.kalluri,
Srikanth Chary Chennoju
---
Changes since v1:
- PATCH 1 - No change.
- PTACH 2 - Removed the comment.
- PATCH 3 - 1. Removed odd spacing.
2. Added defines USB_DT_SSP_ISOC_COMP for 0x80 and
USB_LANE_SPEED_MANTISSA_GEN2_BY_GEN1 for 2.
---
Srikanth Chary Chennoju (3):
usb:gadget:zero: support for super speed plus
usb: gadget: f_sourcesink support for maxburst for bulk
usb: gadget: f_sourcesink: Addition of SSP endpoint for ISOC transfers
drivers/usb/gadget/function/f_sourcesink.c | 32 ++++++++++++++++++++--
drivers/usb/gadget/function/g_zero.h | 2 ++
drivers/usb/gadget/legacy/zero.c | 2 +-
include/uapi/linux/usb/ch9.h | 2 ++
4 files changed, 35 insertions(+), 3 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 1/3] usb:gadget:zero: support for super speed plus
2025-08-28 11:29 [PATCH v2 0/3] Add support for Superspeed plus EndPoint for Bulk and Isochronous transfers Srikanth Chary Chennoju
@ 2025-08-28 11:29 ` Srikanth Chary Chennoju
2025-08-28 11:29 ` [PATCH v2 2/3] usb: gadget: f_sourcesink support for maxburst for bulk Srikanth Chary Chennoju
2025-08-28 11:29 ` [PATCH v2 3/3] usb: gadget: f_sourcesink: Addition of SSP endpoint for ISOC transfers Srikanth Chary Chennoju
2 siblings, 0 replies; 5+ messages in thread
From: Srikanth Chary Chennoju @ 2025-08-28 11:29 UTC (permalink / raw)
To: gregkh, Thinh.Nguyen, m.grzeschik, Chris.Wulff, tiwai
Cc: linux-usb, linux-kernel, punnaiah.choudary.kalluri,
Srikanth Chary Chennoju
This patch is applicable for Bulk as well as Isochronous transfers.
Signed-off-by: Srikanth Chary Chennoju <srikanth.chary-chennoju@amd.com>
---
drivers/usb/gadget/legacy/zero.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/legacy/zero.c b/drivers/usb/gadget/legacy/zero.c
index a05785bdeb30..0cfb7dec22e2 100644
--- a/drivers/usb/gadget/legacy/zero.c
+++ b/drivers/usb/gadget/legacy/zero.c
@@ -415,7 +415,7 @@ static struct usb_composite_driver zero_driver = {
.name = "zero",
.dev = &device_desc,
.strings = dev_strings,
- .max_speed = USB_SPEED_SUPER,
+ .max_speed = USB_SPEED_SUPER_PLUS,
.bind = zero_bind,
.unbind = zero_unbind,
.suspend = zero_suspend,
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/3] usb: gadget: f_sourcesink support for maxburst for bulk
2025-08-28 11:29 [PATCH v2 0/3] Add support for Superspeed plus EndPoint for Bulk and Isochronous transfers Srikanth Chary Chennoju
2025-08-28 11:29 ` [PATCH v2 1/3] usb:gadget:zero: support for super speed plus Srikanth Chary Chennoju
@ 2025-08-28 11:29 ` Srikanth Chary Chennoju
2025-08-28 11:29 ` [PATCH v2 3/3] usb: gadget: f_sourcesink: Addition of SSP endpoint for ISOC transfers Srikanth Chary Chennoju
2 siblings, 0 replies; 5+ messages in thread
From: Srikanth Chary Chennoju @ 2025-08-28 11:29 UTC (permalink / raw)
To: gregkh, Thinh.Nguyen, m.grzeschik, Chris.Wulff, tiwai
Cc: linux-usb, linux-kernel, punnaiah.choudary.kalluri,
Srikanth Chary Chennoju
This patch supports bulk_maxburst. Without this change we are not able
to achieve performance for super speed plus device.Without this fix,
we confirmed through lecroy that it is sendingpackets with NumP always
equal to 1.
Signed-off-by: Srikanth Chary Chennoju <srikanth.chary-chennoju@amd.com>
---
drivers/usb/gadget/function/f_sourcesink.c | 9 +++++++++
drivers/usb/gadget/function/g_zero.h | 2 ++
2 files changed, 11 insertions(+)
diff --git a/drivers/usb/gadget/function/f_sourcesink.c b/drivers/usb/gadget/function/f_sourcesink.c
index ec5fd25020fd..a3a69166c343 100644
--- a/drivers/usb/gadget/function/f_sourcesink.c
+++ b/drivers/usb/gadget/function/f_sourcesink.c
@@ -45,6 +45,7 @@ struct f_sourcesink {
unsigned isoc_maxpacket;
unsigned isoc_mult;
unsigned isoc_maxburst;
+ unsigned bulk_maxburst;
unsigned buflen;
unsigned bulk_qlen;
unsigned iso_qlen;
@@ -328,6 +329,10 @@ sourcesink_bind(struct usb_configuration *c, struct usb_function *f)
source_sink_intf_alt0.bInterfaceNumber = id;
source_sink_intf_alt1.bInterfaceNumber = id;
+ /* sanity check the bulk module parameters */
+ if (ss->bulk_maxburst > 15)
+ ss->bulk_maxburst = 15;
+
/* allocate bulk endpoints */
ss->in_ep = usb_ep_autoconfig(cdev->gadget, &fs_source_desc);
if (!ss->in_ep) {
@@ -341,6 +346,9 @@ sourcesink_bind(struct usb_configuration *c, struct usb_function *f)
if (!ss->out_ep)
goto autoconf_fail;
+ ss_source_comp_desc.bMaxBurst = ss->bulk_maxburst;
+ ss_sink_comp_desc.bMaxBurst = ss->bulk_maxburst;
+
/* sanity check the isoc module parameters */
if (ss->isoc_interval < 1)
ss->isoc_interval = 1;
@@ -852,6 +860,7 @@ static struct usb_function *source_sink_alloc_func(
ss->isoc_maxpacket = ss_opts->isoc_maxpacket;
ss->isoc_mult = ss_opts->isoc_mult;
ss->isoc_maxburst = ss_opts->isoc_maxburst;
+ ss->bulk_maxburst = ss_opts->bulk_maxburst;
ss->buflen = ss_opts->bulk_buflen;
ss->bulk_qlen = ss_opts->bulk_qlen;
ss->iso_qlen = ss_opts->iso_qlen;
diff --git a/drivers/usb/gadget/function/g_zero.h b/drivers/usb/gadget/function/g_zero.h
index 98b8462ad538..3f327e37f398 100644
--- a/drivers/usb/gadget/function/g_zero.h
+++ b/drivers/usb/gadget/function/g_zero.h
@@ -20,6 +20,7 @@ struct usb_zero_options {
unsigned isoc_maxpacket;
unsigned isoc_mult;
unsigned isoc_maxburst;
+ unsigned bulk_maxburst;
unsigned bulk_buflen;
unsigned qlen;
unsigned ss_bulk_qlen;
@@ -33,6 +34,7 @@ struct f_ss_opts {
unsigned isoc_maxpacket;
unsigned isoc_mult;
unsigned isoc_maxburst;
+ unsigned bulk_maxburst;
unsigned bulk_buflen;
unsigned bulk_qlen;
unsigned iso_qlen;
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 3/3] usb: gadget: f_sourcesink: Addition of SSP endpoint for ISOC transfers
2025-08-28 11:29 [PATCH v2 0/3] Add support for Superspeed plus EndPoint for Bulk and Isochronous transfers Srikanth Chary Chennoju
2025-08-28 11:29 ` [PATCH v2 1/3] usb:gadget:zero: support for super speed plus Srikanth Chary Chennoju
2025-08-28 11:29 ` [PATCH v2 2/3] usb: gadget: f_sourcesink support for maxburst for bulk Srikanth Chary Chennoju
@ 2025-08-28 11:29 ` Srikanth Chary Chennoju
2025-08-29 21:49 ` Thinh Nguyen
2 siblings, 1 reply; 5+ messages in thread
From: Srikanth Chary Chennoju @ 2025-08-28 11:29 UTC (permalink / raw)
To: gregkh, Thinh.Nguyen, m.grzeschik, Chris.Wulff, tiwai
Cc: linux-usb, linux-kernel, punnaiah.choudary.kalluri,
Srikanth Chary Chennoju
This patch is created to support super speed plus endpoint for Isoc
transfers. Now super speed endpoint companion is accompanied by super
speed plus endpoint companion. With this change we could see the Isoc IN
and OUT performance reaching to ~749MB/sec which is 96K per uframe.
The performance numbers are confirmed through Lecroy trace.
Signed-off-by: Srikanth Chary Chennoju <srikanth.chary-chennoju@amd.com>
---
drivers/usb/gadget/function/f_sourcesink.c | 23 ++++++++++++++++++++--
include/uapi/linux/usb/ch9.h | 2 ++
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/function/f_sourcesink.c b/drivers/usb/gadget/function/f_sourcesink.c
index a3a69166c343..79efb6295725 100644
--- a/drivers/usb/gadget/function/f_sourcesink.c
+++ b/drivers/usb/gadget/function/f_sourcesink.c
@@ -232,6 +232,12 @@ static struct usb_ss_ep_comp_descriptor ss_iso_source_comp_desc = {
.wBytesPerInterval = cpu_to_le16(1024),
};
+static struct usb_ssp_isoc_ep_comp_descriptor ssp_iso_source_comp_desc = {
+ .bLength = USB_DT_SSP_ISOC_EP_COMP_SIZE,
+ .bDescriptorType = USB_DT_SSP_ISOC_ENDPOINT_COMP,
+ .dwBytesPerInterval = cpu_to_le32(1024),
+};
+
static struct usb_endpoint_descriptor ss_iso_sink_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
@@ -250,6 +256,12 @@ static struct usb_ss_ep_comp_descriptor ss_iso_sink_comp_desc = {
.wBytesPerInterval = cpu_to_le16(1024),
};
+static struct usb_ssp_isoc_ep_comp_descriptor ssp_iso_sink_comp_desc = {
+ .bLength = USB_DT_SSP_ISOC_EP_COMP_SIZE,
+ .bDescriptorType = USB_DT_SSP_ISOC_ENDPOINT_COMP,
+ .dwBytesPerInterval = cpu_to_le32(1024),
+};
+
static struct usb_descriptor_header *ss_source_sink_descs[] = {
(struct usb_descriptor_header *) &source_sink_intf_alt0,
(struct usb_descriptor_header *) &ss_source_desc,
@@ -264,8 +276,10 @@ static struct usb_descriptor_header *ss_source_sink_descs[] = {
(struct usb_descriptor_header *) &ss_sink_comp_desc,
(struct usb_descriptor_header *) &ss_iso_source_desc,
(struct usb_descriptor_header *) &ss_iso_source_comp_desc,
+ (struct usb_descriptor_header *) &ssp_iso_source_comp_desc,
(struct usb_descriptor_header *) &ss_iso_sink_desc,
(struct usb_descriptor_header *) &ss_iso_sink_comp_desc,
+ (struct usb_descriptor_header *) &ssp_iso_sink_comp_desc,
NULL,
};
@@ -423,7 +437,7 @@ sourcesink_bind(struct usb_configuration *c, struct usb_function *f)
*/
ss_iso_source_desc.wMaxPacketSize = ss->isoc_maxpacket;
ss_iso_source_desc.bInterval = ss->isoc_interval;
- ss_iso_source_comp_desc.bmAttributes = ss->isoc_mult;
+ ss_iso_source_comp_desc.bmAttributes = USB_DT_SSP_ISOC_COMP | ss->isoc_mult;
ss_iso_source_comp_desc.bMaxBurst = ss->isoc_maxburst;
ss_iso_source_comp_desc.wBytesPerInterval = ss->isoc_maxpacket *
(ss->isoc_mult + 1) * (ss->isoc_maxburst + 1);
@@ -432,12 +446,17 @@ sourcesink_bind(struct usb_configuration *c, struct usb_function *f)
ss_iso_sink_desc.wMaxPacketSize = ss->isoc_maxpacket;
ss_iso_sink_desc.bInterval = ss->isoc_interval;
- ss_iso_sink_comp_desc.bmAttributes = ss->isoc_mult;
+ ss_iso_sink_comp_desc.bmAttributes = USB_DT_SSP_ISOC_COMP | ss->isoc_mult;
ss_iso_sink_comp_desc.bMaxBurst = ss->isoc_maxburst;
ss_iso_sink_comp_desc.wBytesPerInterval = ss->isoc_maxpacket *
(ss->isoc_mult + 1) * (ss->isoc_maxburst + 1);
ss_iso_sink_desc.bEndpointAddress = fs_iso_sink_desc.bEndpointAddress;
+ ssp_iso_source_comp_desc.dwBytesPerInterval = ss->isoc_maxpacket *
+ (ss->isoc_mult + 1) * (ss->isoc_maxburst + 1) * USB_LANE_SPEED_MANTISSA_GEN2_BY_GEN1;
+ ssp_iso_sink_comp_desc.dwBytesPerInterval = ss->isoc_maxpacket *
+ (ss->isoc_mult + 1) * (ss->isoc_maxburst + 1) * USB_LANE_SPEED_MANTISSA_GEN2_BY_GEN1;
+
ret = usb_assign_descriptors(f, fs_source_sink_descs,
hs_source_sink_descs, ss_source_sink_descs,
ss_source_sink_descs);
diff --git a/include/uapi/linux/usb/ch9.h b/include/uapi/linux/usb/ch9.h
index 8003243a4937..22782c5cb2f3 100644
--- a/include/uapi/linux/usb/ch9.h
+++ b/include/uapi/linux/usb/ch9.h
@@ -702,6 +702,8 @@ struct usb_ssp_isoc_ep_comp_descriptor {
} __attribute__ ((packed));
#define USB_DT_SSP_ISOC_EP_COMP_SIZE 8
+#define USB_DT_SSP_ISOC_COMP (1 << 7) /*support for SSP ISOC EP COMP*/
+#define USB_LANE_SPEED_MANTISSA_GEN2_BY_GEN1 2
/*-------------------------------------------------------------------------*/
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 3/3] usb: gadget: f_sourcesink: Addition of SSP endpoint for ISOC transfers
2025-08-28 11:29 ` [PATCH v2 3/3] usb: gadget: f_sourcesink: Addition of SSP endpoint for ISOC transfers Srikanth Chary Chennoju
@ 2025-08-29 21:49 ` Thinh Nguyen
0 siblings, 0 replies; 5+ messages in thread
From: Thinh Nguyen @ 2025-08-29 21:49 UTC (permalink / raw)
To: Srikanth Chary Chennoju
Cc: gregkh@linuxfoundation.org, Thinh Nguyen,
m.grzeschik@pengutronix.de, Chris.Wulff@biamp.com, tiwai@suse.de,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
punnaiah.choudary.kalluri@amd.com
On Thu, Aug 28, 2025, Srikanth Chary Chennoju wrote:
> This patch is created to support super speed plus endpoint for Isoc
> transfers. Now super speed endpoint companion is accompanied by super
> speed plus endpoint companion. With this change we could see the Isoc IN
> and OUT performance reaching to ~749MB/sec which is 96K per uframe.
> The performance numbers are confirmed through Lecroy trace.
>
> Signed-off-by: Srikanth Chary Chennoju <srikanth.chary-chennoju@amd.com>
> ---
> drivers/usb/gadget/function/f_sourcesink.c | 23 ++++++++++++++++++++--
> include/uapi/linux/usb/ch9.h | 2 ++
> 2 files changed, 23 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/gadget/function/f_sourcesink.c b/drivers/usb/gadget/function/f_sourcesink.c
> index a3a69166c343..79efb6295725 100644
> --- a/drivers/usb/gadget/function/f_sourcesink.c
> +++ b/drivers/usb/gadget/function/f_sourcesink.c
> @@ -232,6 +232,12 @@ static struct usb_ss_ep_comp_descriptor ss_iso_source_comp_desc = {
> .wBytesPerInterval = cpu_to_le16(1024),
> };
>
> +static struct usb_ssp_isoc_ep_comp_descriptor ssp_iso_source_comp_desc = {
> + .bLength = USB_DT_SSP_ISOC_EP_COMP_SIZE,
> + .bDescriptorType = USB_DT_SSP_ISOC_ENDPOINT_COMP,
> + .dwBytesPerInterval = cpu_to_le32(1024),
Why set the dwBytesPerInterval and wBytesPerInterval when they will be
overwritten on bind later?
> +};
> +
> static struct usb_endpoint_descriptor ss_iso_sink_desc = {
> .bLength = USB_DT_ENDPOINT_SIZE,
> .bDescriptorType = USB_DT_ENDPOINT,
> @@ -250,6 +256,12 @@ static struct usb_ss_ep_comp_descriptor ss_iso_sink_comp_desc = {
> .wBytesPerInterval = cpu_to_le16(1024),
> };
>
> +static struct usb_ssp_isoc_ep_comp_descriptor ssp_iso_sink_comp_desc = {
> + .bLength = USB_DT_SSP_ISOC_EP_COMP_SIZE,
> + .bDescriptorType = USB_DT_SSP_ISOC_ENDPOINT_COMP,
> + .dwBytesPerInterval = cpu_to_le32(1024),
> +};
> +
> static struct usb_descriptor_header *ss_source_sink_descs[] = {
> (struct usb_descriptor_header *) &source_sink_intf_alt0,
> (struct usb_descriptor_header *) &ss_source_desc,
> @@ -264,8 +276,10 @@ static struct usb_descriptor_header *ss_source_sink_descs[] = {
> (struct usb_descriptor_header *) &ss_sink_comp_desc,
> (struct usb_descriptor_header *) &ss_iso_source_desc,
> (struct usb_descriptor_header *) &ss_iso_source_comp_desc,
> + (struct usb_descriptor_header *) &ssp_iso_source_comp_desc,
> (struct usb_descriptor_header *) &ss_iso_sink_desc,
> (struct usb_descriptor_header *) &ss_iso_sink_comp_desc,
> + (struct usb_descriptor_header *) &ssp_iso_sink_comp_desc,
> NULL,
> };
>
> @@ -423,7 +437,7 @@ sourcesink_bind(struct usb_configuration *c, struct usb_function *f)
> */
> ss_iso_source_desc.wMaxPacketSize = ss->isoc_maxpacket;
> ss_iso_source_desc.bInterval = ss->isoc_interval;
> - ss_iso_source_comp_desc.bmAttributes = ss->isoc_mult;
> + ss_iso_source_comp_desc.bmAttributes = USB_DT_SSP_ISOC_COMP | ss->isoc_mult;
> ss_iso_source_comp_desc.bMaxBurst = ss->isoc_maxburst;
> ss_iso_source_comp_desc.wBytesPerInterval = ss->isoc_maxpacket *
> (ss->isoc_mult + 1) * (ss->isoc_maxburst + 1);
> @@ -432,12 +446,17 @@ sourcesink_bind(struct usb_configuration *c, struct usb_function *f)
>
> ss_iso_sink_desc.wMaxPacketSize = ss->isoc_maxpacket;
> ss_iso_sink_desc.bInterval = ss->isoc_interval;
> - ss_iso_sink_comp_desc.bmAttributes = ss->isoc_mult;
> + ss_iso_sink_comp_desc.bmAttributes = USB_DT_SSP_ISOC_COMP | ss->isoc_mult;
Don't automatically set USB_DT_SSP_ISOC_COMP if deviec is not connected
in SSP. probably need to create a separate set of descriptors for SSP.
> ss_iso_sink_comp_desc.bMaxBurst = ss->isoc_maxburst;
> ss_iso_sink_comp_desc.wBytesPerInterval = ss->isoc_maxpacket *
> (ss->isoc_mult + 1) * (ss->isoc_maxburst + 1);
> ss_iso_sink_desc.bEndpointAddress = fs_iso_sink_desc.bEndpointAddress;
>
> + ssp_iso_source_comp_desc.dwBytesPerInterval = ss->isoc_maxpacket *
> + (ss->isoc_mult + 1) * (ss->isoc_maxburst + 1) * USB_LANE_SPEED_MANTISSA_GEN2_BY_GEN1;
> + ssp_iso_sink_comp_desc.dwBytesPerInterval = ss->isoc_maxpacket *
> + (ss->isoc_mult + 1) * (ss->isoc_maxburst + 1) * USB_LANE_SPEED_MANTISSA_GEN2_BY_GEN1;
> +
Missing cpu_to_le* endian conversions.
> ret = usb_assign_descriptors(f, fs_source_sink_descs,
> hs_source_sink_descs, ss_source_sink_descs,
> ss_source_sink_descs);
> diff --git a/include/uapi/linux/usb/ch9.h b/include/uapi/linux/usb/ch9.h
> index 8003243a4937..22782c5cb2f3 100644
> --- a/include/uapi/linux/usb/ch9.h
> +++ b/include/uapi/linux/usb/ch9.h
> @@ -702,6 +702,8 @@ struct usb_ssp_isoc_ep_comp_descriptor {
> } __attribute__ ((packed));
>
> #define USB_DT_SSP_ISOC_EP_COMP_SIZE 8
> +#define USB_DT_SSP_ISOC_COMP (1 << 7) /*support for SSP ISOC EP COMP*/
Put this under bmAttributes
> +#define USB_LANE_SPEED_MANTISSA_GEN2_BY_GEN1 2
There's no GEN2_BY_GEN1. There's Gen2x1. Also lane speed mantissa is not
2 for Gen2x1. What you probably wanted to put is probably gen value
multiply by lane count?
BR,
Thinh
>
> /*-------------------------------------------------------------------------*/
>
> --
> 2.25.1
>
BR,
Thinh
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-08-29 21:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-28 11:29 [PATCH v2 0/3] Add support for Superspeed plus EndPoint for Bulk and Isochronous transfers Srikanth Chary Chennoju
2025-08-28 11:29 ` [PATCH v2 1/3] usb:gadget:zero: support for super speed plus Srikanth Chary Chennoju
2025-08-28 11:29 ` [PATCH v2 2/3] usb: gadget: f_sourcesink support for maxburst for bulk Srikanth Chary Chennoju
2025-08-28 11:29 ` [PATCH v2 3/3] usb: gadget: f_sourcesink: Addition of SSP endpoint for ISOC transfers Srikanth Chary Chennoju
2025-08-29 21:49 ` Thinh Nguyen
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).