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.
This commit is contained in:
Augustin Cavalier 2019-01-10 14:17:55 -05:00
parent 696138675a
commit daa6582acb

View File

@ -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 // Install the interrupt handler
TRACE("installing interrupt handler\n"); TRACE("installing interrupt handler\n");
install_io_interrupt_handler(fIRQ, InterruptHandler, (void *)this, 0); 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++) { 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 if (item->class_base == PCI_serial_bus && item->class_sub == PCI_usb
&& item->class_api == PCI_usb_xhci) { && item->class_api == PCI_usb_xhci) {
if (item->u.h0.interrupt_line == 0 TRACE_MODULE("found device at PCI:%d:%d:%d\n",
|| item->u.h0.interrupt_line == 0xFF) { item->bus, item->device, item->funcion);
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);
XHCI *bus = new(std::nothrow) XHCI(item, stack); XHCI *bus = new(std::nothrow) XHCI(item, stack);
if (!bus) { if (!bus) {
delete item; delete item;