diff --git a/src/system/kernel/arch/x86/ioapic.cpp b/src/system/kernel/arch/x86/ioapic.cpp index 7b7b237de3..5b5e52f910 100644 --- a/src/system/kernel/arch/x86/ioapic.cpp +++ b/src/system/kernel/arch/x86/ioapic.cpp @@ -246,7 +246,7 @@ static void ioapic_enable_io_interrupt(int32 gsi) { // If enabling an overriden source is attempted, enable the override entry - // instead. An interrupt handler was installed at the override GSI to rely + // instead. An interrupt handler was installed at the override GSI to relay // interrupts to the overriden source. if (gsi < ISA_INTERRUPT_COUNT && sSourceOverrides[gsi] != 0) gsi = sSourceOverrides[gsi]; @@ -709,8 +709,6 @@ ioapic_init(kernel_args* args) return; } - print_irq_routing_table(table); - // use the boot CPU as the target for all interrupts uint8 targetAPIC = args->arch_args.cpu_apic_id[0]; @@ -726,6 +724,11 @@ ioapic_init(kernel_args* args) current = current->next; } +#ifdef TRACE_IOAPIC + dprintf("trying interrupt routing:\n"); + print_irq_routing_table(table); +#endif + status = enable_irq_routing(acpiModule, table); if (status != B_OK) { panic("failed to enable IRQ routing"); @@ -734,6 +737,8 @@ ioapic_init(kernel_args* args) return; } + print_irq_routing_table(table); + // configure the source overrides, but let the PCI config below override it acpi_configure_source_overrides(madt); diff --git a/src/system/kernel/arch/x86/irq_routing_table.cpp b/src/system/kernel/arch/x86/irq_routing_table.cpp index ce93bdc84a..160e1ebe30 100644 --- a/src/system/kernel/arch/x86/irq_routing_table.cpp +++ b/src/system/kernel/arch/x86/irq_routing_table.cpp @@ -312,8 +312,19 @@ configure_link_devices(acpi_module_info* acpi, IRQRoutingTable& routingTable) status_t status = set_current_irq(acpi, irqEntry.source, configuration); if (status != B_OK) { - panic("failed to set irq on link device"); - return status; + dprintf("failed to set irq on link device, keeping current\n"); + print_irq_descriptor(configuration); + + // we failed to set the resource, fall back to current + read_current_irq(acpi, irqEntry.source, configuration); + for (int j = i; j < routingTable.Count(); j++) { + irq_routing_entry& other = routingTable.ElementAt(j); + if (other.source == irqEntry.source) { + other.irq = configuration.irq; + other.polarity = configuration.polarity; + other.trigger_mode = configuration.trigger_mode; + } + } } irqEntry.needs_configuration = false;