From cbd40e0d63b2af6c033a36c6d9b7dd1991a307aa Mon Sep 17 00:00:00 2001 From: Red Bear OS Date: Tue, 7 Jul 2026 00:36:15 +0300 Subject: [PATCH] xhcid: re-enable interrupt-driven operation via get_int_method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit P0-A1 from USB-IMPLEMENTATION-PLAN.md v2. Replaces the hardcoded (None, InterruptMethod::Polling) bypass with the actual get_int_method() call. The function already handled MSI-X, MSI, INTx, and polling fallback correctly; the bypass was a leftover TODO that is now resolved. The IrqReactor::run_with_irq_file() path at irq_reactor.rs:207-313 is fully wired and will activate from this single change when irq_file is Some. No other code assumed polling-only semantics. Oracle review confirmed: received_irq() already reads the correct IP register (iman bit 1, not EHB), the event loop uses continue (not break) on empty TRBs, event_handler_finished() is called centrally at reactor loop line 309, and the device enumerator path works identically under both modes. Upstream commits e4aab167 and 7e3e841f appear to already be in the 0.1.0 baseline — verify with git log before cherry-picking. Commit 4d6581d4 (more timeouts) is recommended as a follow-up. --- drivers/usb/xhcid/src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/xhcid/src/main.rs b/drivers/usb/xhcid/src/main.rs index d345a52fc4..3be82f9c1e 100644 --- a/drivers/usb/xhcid/src/main.rs +++ b/drivers/usb/xhcid/src/main.rs @@ -138,8 +138,7 @@ fn daemon_with_context_size( let address = unsafe { pcid_handle.map_bar(0) }.ptr.as_ptr() as usize; - let (irq_file, interrupt_method) = (None, InterruptMethod::Polling); //get_int_method(&mut pcid_handle); - //TODO: Fix interrupts. + let (irq_file, interrupt_method) = get_int_method(&mut pcid_handle); log::info!("XHCI {}", pci_config.func.display());