XHCI reduce stalling to increase driver performance
All checks were successful
Build ISO image / build-and-deploy (push) Successful in 3m39s
Build documentation / build-and-deploy (push) Successful in 3m41s

This commit is contained in:
2026-04-03 03:19:51 +02:00
parent d79556a58f
commit 725cee6ffc
2 changed files with 5 additions and 9 deletions

View File

@@ -390,7 +390,7 @@ static void xhci_bios_handover (struct xhci* xhci) {
if (!(val & (1 << XHCI_USBLEGSUP_BIOS_SEMA)) && (val & (1 << XHCI_USBLEGSUP_OS_SEMA)))
break;
stall_ms (100);
stall_ms (3);
}
DEBUG ("XHCI Handover OK\n");
@@ -436,7 +436,7 @@ static void xhci_port_reset (struct xhci* xhci, uint8_t port) {
xhci_portsc_write (xhci, port, portsc);
stall_ms (500);
stall_ms (250);
portsc |= (1 << XHCI_PORTSC_PRC) |
(1 << XHCI_PORTSC_WRC) |
@@ -955,8 +955,6 @@ static void xhci_pdevice_setup_init_endpoints (struct xhci* xhci, struct xhci_pd
uint32_t ctrl = (pdevice->slot_id << 24) | (XHCI_TRB_CFG_ENDP_CMD << XHCI_GTRB_TRB_TYPE);
xhci_send_cmd (xhci, input_ctx_phys, 0, ctrl, lockflags);
stall_ms (500);
if (xhci->last_cmpl_code != 1)
DEBUG ("Failed to configure endpoints for this device\n");
else
@@ -1054,8 +1052,6 @@ static void xhci_pdevice_setup_addressing (struct xhci* xhci, struct xhci_pdevic
uint32_t ctrl = (pdevice->slot_id << 24) | (XHCI_TRB_ADDR_DEV_CMD << XHCI_GTRB_TRB_TYPE);
xhci_send_cmd (xhci, input_ctx_phys, 0, ctrl, lockflags);
stall_ms (500);
if (xhci->last_cmpl_code != 1) {
DEBUG ("Failed to address device. port = %u, slot = %u\n", pdevice->xhci_port->port_value,
pdevice->slot_id);
@@ -1321,7 +1317,7 @@ DEFINE_DEVICE_INIT (xhci_init) {
usbcmd &= ~(1 << 0);
xhci_write32 (xhci->xhci_oper_base, XHCI_USBCMD, usbcmd);
stall_ms (1000);
stall_ms (100);
xhci_bios_handover (xhci);
@@ -1405,7 +1401,7 @@ DEFINE_DEVICE_INIT (xhci_init) {
usbcmd = xhci_read32 (xhci->xhci_oper_base, XHCI_USBCMD);
xhci_write32 (xhci->xhci_oper_base, XHCI_USBCMD, usbcmd | (1 << 0) | (1 << 2));
stall_ms (500);
stall_ms (250);
xhci_reset_ports (xhci);