From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: linux-usb@vger.kernel.org
Cc: linux-media@vger.kernel.org, gregkh@linuxfoundation.org,
laurent.pinchart@ideasonboard.com, hdegoede@redhat.com,
Thinh.Nguyen@synopsys.com, Amardeep Rai <amardeep.rai@intel.com>,
Kannappan R <r.kannappan@intel.com>,
Mathias Nyman <mathias.nyman@linux.intel.com>
Subject: [PATCH v2 2/4] USB: core: support eUSB2 double bandwidth large isoc URB frames
Date: Fri, 11 Jul 2025 11:34:11 +0300 [thread overview]
Message-ID: <20250711083413.1552423-3-sakari.ailus@linux.intel.com> (raw)
In-Reply-To: <20250711083413.1552423-1-sakari.ailus@linux.intel.com>
From: "Rai, Amardeep" <amardeep.rai@intel.com>
eUSB2 double isochronous in bandwidth devices support up to 6 transactions
per microframe, and thus doubles the total bytes possible to receive per
microframe.
Support larger URB isoc frame sizes for eUSB2 double isoc in endpoints.
Also usb_endpoint_maxp() returns a natural number so there's no need to
assume it could be < 0.
Signed-off-by: Rai, Amardeep <amardeep.rai@intel.com>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Co-developed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/usb/core/urb.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
index 7a76d5a62db1..2c8698cc452c 100644
--- a/drivers/usb/core/urb.c
+++ b/drivers/usb/core/urb.c
@@ -372,6 +372,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
struct usb_host_endpoint *ep;
int is_out;
unsigned int allowed;
+ bool is_eusb2_isoch_double;
if (!urb || !urb->complete)
return -EINVAL;
@@ -434,7 +435,12 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
return -ENODEV;
max = usb_endpoint_maxp(&ep->desc);
- if (max <= 0) {
+ is_eusb2_isoch_double = dev->speed == USB_SPEED_HIGH &&
+ xfertype == USB_ENDPOINT_XFER_ISOC &&
+ usb_endpoint_dir_in(&ep->desc) &&
+ le16_to_cpu(dev->descriptor.bcdUSB) == 0x220 &&
+ le16_to_cpu(ep->desc.wMaxPacketSize) == 0;
+ if (!max && !is_eusb2_isoch_double) {
dev_dbg(&dev->dev,
"bogus endpoint ep%d%s in %s (bad maxpacket %d)\n",
usb_endpoint_num(&ep->desc), is_out ? "out" : "in",
@@ -467,9 +473,13 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
max = le32_to_cpu(isoc_ep_comp->dwBytesPerInterval);
}
- /* "high bandwidth" mode, 1-3 packets/uframe? */
- if (dev->speed == USB_SPEED_HIGH)
- max *= usb_endpoint_maxp_mult(&ep->desc);
+ /* High speed, 1-3 packets/uframe, max 6 for eUSB2 double bw */
+ if (dev->speed == USB_SPEED_HIGH) {
+ if (is_eusb2_isoch_double)
+ max = le32_to_cpu(ep->eusb2_isoc_ep_comp.dwBytesPerInterval);
+ else
+ max *= usb_endpoint_maxp_mult(&ep->desc);
+ }
if (urb->number_of_packets <= 0)
return -EINVAL;
--
2.39.5
next prev parent reply other threads:[~2025-07-11 8:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-11 8:34 [PATCH v2 0/4] eUSB2 support Sakari Ailus
2025-07-11 8:34 ` [PATCH v2 1/4] xhci: Add host support for eUSB2 double isochronous bandwidth devices Sakari Ailus
2025-07-11 8:34 ` Sakari Ailus [this message]
2025-07-11 8:34 ` [PATCH v2 3/4] USB: Add a function to obtain USB version independent maximum bpi value Sakari Ailus
2025-07-11 13:44 ` Hans de Goede
2025-07-15 8:13 ` Sakari Ailus
2025-07-16 16:35 ` Hans de Goede
2025-07-28 22:21 ` Sakari Ailus
2025-07-11 14:18 ` Alan Stern
2025-07-11 8:34 ` [PATCH v2 4/4] media: uvcvideo: eUSB2 double isochronous bandwidth support Sakari Ailus
2025-07-15 9:10 ` Laurent Pinchart
2025-08-21 9:08 ` Sakari Ailus
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=20250711083413.1552423-3-sakari.ailus@linux.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=Thinh.Nguyen@synopsys.com \
--cc=amardeep.rai@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@linux.intel.com \
--cc=r.kannappan@intel.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).