Page MenuHomeFreeBSD

D61246.1796026376.diff
No OneTemporary

Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None

D61246.1796026376.diff

diff --git a/sys/dev/usb/controller/xhci.h b/sys/dev/usb/controller/xhci.h
--- a/sys/dev/usb/controller/xhci.h
+++ b/sys/dev/usb/controller/xhci.h
@@ -35,7 +35,7 @@
#define XHCI_MAX_EVENTS 232
#define XHCI_MAX_COMMANDS (16 * 1)
#define XHCI_MAX_RSEG 1
-#define XHCI_MAX_TRANSFERS 4
+#define XHCI_MAX_TRANSFERS 8
#if USB_MAX_EP_STREAMS == 8
#define XHCI_MAX_STREAMS 8
#define XHCI_MAX_STREAMS_LOG 3
@@ -355,6 +355,9 @@
XHCI_MAX_TRANSFERS) + XHCI_MAX_STREAMS];
};
+/* The endpoint rings are addressed from a single physical page */
+CTASSERT(sizeof(struct xhci_dev_endpoint_trbs) <= 4096);
+
#if (USB_PAGE_SIZE < 4096)
#error "The XHCI driver needs a pagesize above or equal to 4K"
#endif
diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c
--- a/sys/dev/usb/controller/xhci.c
+++ b/sys/dev/usb/controller/xhci.c
@@ -3183,7 +3183,10 @@
trb_limit = 1;
break;
default:
- /* multi buffered */
+ /*
+ * multi buffered, less the hardcoded LINK TRB and the
+ * chain end marker
+ */
trb_limit = (XHCI_MAX_TRANSFERS - 2);
break;
}
@@ -3363,27 +3366,25 @@
/*
* Check if the current transfer is started and then pickup
- * the next one, if any. Else wait for next start event due to
+ * the next ones, if any. Else wait for next start event due to
* block on failure feature.
*/
if (!xfer->flags_int.bandwidth_reclaimed)
return;
- xfer = TAILQ_FIRST(&ep->endpoint_q[stream_id].head);
- if (xfer == NULL) {
- /*
- * In case of enter we have to consider that the
- * transfer is queued by the USB core after the enter
- * method is called.
- */
- xfer = enter_xfer;
-
- if (xfer == NULL)
+ /*
+ * Try to multi buffer all waiting transfers, in order.
+ */
+ TAILQ_FOREACH(xfer, &ep->endpoint_q[stream_id].head, wait_entry) {
+ if (xfer->flags_int.bandwidth_reclaimed)
+ continue;
+ if (xhci_transfer_insert(xfer) != 0 ||
+ !xfer->flags_int.bandwidth_reclaimed)
return;
}
- /* try to multi buffer */
- xhci_transfer_insert(xfer);
+ if (enter_xfer != NULL)
+ xhci_transfer_insert(enter_xfer);
}
static void

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 30, 8:12 AM (15 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41748679
Default Alt Text
D61246.1796026376.diff (2 KB)

Event Timeline