Skip to contentSkip to conversation

x86: when acpi_noirq is set, use mptable instead of MADT

PATCH In review Yinghai Lu 3 participants 5 messages Nov 26, 2006 – Nov 28, 2006 ACPI

lore
Share & tools
lore

Yinghai Lu

author
#0 lore raw

PATCH 3/3 x86: when acpi_noirq is set, use mptable instead of MADT

[PATCH 3/3] x86: when acpi_noirq is set, use mptable instead of MADT

When using pci=noacpi, or apci=noirq, acpi_noirq is set. We should skip acpi_process_madt. Because it will set acpi_lapic and acpi_ioapic, at last mptable is skipped, but we need io apic routing table in mptable.

arch/i386/kernel/acpi/boot.c +9 -1
index d12fb97..6d62dd1 100644
@@ -1242,7 +1242,15 @@ int __init acpi_boot_init(void)
 	/*
 	 * Process the Multiple APIC Description Table (MADT), if present
 	 */
-	acpi_process_madt();
+	/* with acpi_noirq we don't need to process madt, it will set
+	 *	acpi_lapic and acpi_ioapic, they will make get_smp_config aka.
+	 *	MPTABLE be skipped and mp_irqs will not include entries for 
+	 *	irq routing for io apic, then pirq_enable_irq together with 
+	 * 	IO_APIC_get_PCI_irq_vector can not find irq in mp_irqs for 
+	 * 	devices that are using IOAPIC
+	 */
+	if(!acpi_noirq && !acpi_pci_disabled)
+		acpi_process_madt();
 
 	acpi_table_parse(ACPI_HPET, acpi_parse_hpet);
 
#2 lore raw
In reply to Yinghai Lu

"acpi=noirq" and "pci=noacpi" are not reliable in IOAPIC mode -- as, by definition, they skip the processing of the ACPI interrupt itself. On some systems this happens to work, and on some systems it doesn't -- depends on if there was an override for the SCI or if it appears as a standard PCI interrupt.

So the bigger question is why you need these workarounds in the first place.

-Len

author
#3 lore raw
Quoted 2 lines · Len Brown

So the bigger question is why you need these workarounds in the first place.

in the LinuxBIOS, acpi support is there including acpi tables and dsdt for amd chipset.
but for other chipset, I can not put dsdt there. becase we need one clean room implementation for dsdt with those chipset.

So I have all acpi tables (SRAT, SLIT, ...) but no dsdt.
We need to use mptable instead of MADT + dsdt for io apic irq routing.

I forget to remove MADT in one test, the kernel will skip the mptable.

After look at the kernel acpi code, it turns out that acpi_process_madt will set acpi_lapic, and acpi_ioapic. So get_smp_config will skip the mptable.

With normal BIOS, if there is problem with DSDT, and you are trying acpi=noirq, it means you are going to PIC mode instead of APIC mode if you are skipping mptable.

YH

author
#4 lore raw
In reply to Len Brown

Please check the updated patch.

[PATCH 3/3] x86: when acpi_noirq is set, use mptable instead of MADT

If no DSDT found, call acpi_disable_pci

When using pci=noacpi, or apci=noirq, acpi_noirq is set. We should skip acpi_process_madt. So to avoid enumerate lapic two times.

drivers/acpi/tables.c +1 -0
index bfb3bfc..f497d78 100644
@@ -297,6 +297,7 @@ acpi_get_table_header_early(enum acpi_ta
 
 		if (!*header) {
 			printk(KERN_WARNING PREFIX "Unable to map DSDT\n");
+			acpi_disable_pci();
 			return -ENODEV;
 		}
 	}
arch/i386/kernel/acpi/boot.c +5 -1
index d12fb97..0d350d0 100644
@@ -1242,7 +1242,11 @@ int __init acpi_boot_init(void)
 	/*
 	 * Process the Multiple APIC Description Table (MADT), if present
 	 */
-	acpi_process_madt();
+	/* with acpi_noirq we don't need to process madt, So don't need 
+	 *	ennumerate lapic two times 
+	 */
+	if(!acpi_noirq && !acpi_pci_disabled)
+		acpi_process_madt();
 
 	acpi_table_parse(ACPI_HPET, acpi_parse_hpet);