From daa6582acb3737f5a83dc0983528a5e1a526c614 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 10 Jan 2019 14:17:55 -0500 Subject: [PATCH] XHCI: Don't reject devices with "invalid" IRQs immediately. It seems some controllers are assigned "invalid" interrupt lines under the expectation they will be allocated an MSI. So, don't reject these devices for having an invalid interrupt line until after we have tried to allocate an MSI for them. Should fix #14792. --- src/add-ons/kernel/busses/usb/xhci.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/add-ons/kernel/busses/usb/xhci.cpp b/src/add-ons/kernel/busses/usb/xhci.cpp index c1f08bff12..d9d8111d52 100644 --- a/src/add-ons/kernel/busses/usb/xhci.cpp +++ b/src/add-ons/kernel/busses/usb/xhci.cpp @@ -306,6 +306,11 @@ XHCI::XHCI(pci_info *info, Stack *stack) } } + if (fIRQ == 0 || fIRQ == 0xFF) { + TRACE_MODULE_ERROR("device was assigned an invalid IRQ\n"); + return; + } + // Install the interrupt handler TRACE("installing interrupt handler\n"); install_io_interrupt_handler(fIRQ, InterruptHandler, (void *)this, 0); @@ -839,15 +844,8 @@ XHCI::AddTo(Stack *stack) for (int32 i = 0; sPCIModule->get_nth_pci_info(i, item) >= B_OK; i++) { if (item->class_base == PCI_serial_bus && item->class_sub == PCI_usb && item->class_api == PCI_usb_xhci) { - if (item->u.h0.interrupt_line == 0 - || item->u.h0.interrupt_line == 0xFF) { - TRACE_MODULE_ERROR("found device with invalid IRQ - check IRQ " - "assignment\n"); - continue; - } - - TRACE_MODULE("found device at IRQ %u\n", - item->u.h0.interrupt_line); + TRACE_MODULE("found device at PCI:%d:%d:%d\n", + item->bus, item->device, item->funcion); XHCI *bus = new(std::nothrow) XHCI(item, stack); if (!bus) { delete item;