From: Andrey Panin Signed-off-by: Andrew Morton --- 25-akpm/arch/i386/kernel/apic.c | 58 ++++++++++++++++++++++++++++++++++++ 25-akpm/arch/i386/kernel/dmi_scan.c | 42 -------------------------- 2 files changed, 58 insertions(+), 42 deletions(-) diff -puN arch/i386/kernel/apic.c~dmi-port-local-apic-quirks-to-new-dmi-probing arch/i386/kernel/apic.c --- 25/arch/i386/kernel/apic.c~dmi-port-local-apic-quirks-to-new-dmi-probing Fri May 28 14:28:54 2004 +++ 25-akpm/arch/i386/kernel/apic.c Fri May 28 14:28:54 2004 @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -624,11 +625,66 @@ static int __init lapic_enable(char *str } __setup("lapic", lapic_enable); +/* + * Some machines, usually laptops, can't handle an enabled local APIC. + * The symptoms include hangs or reboots when suspending or resuming, + * attaching or detaching the power cord, or entering BIOS setup screens + * through magic key sequences. + */ +static int __init local_apic_kills_bios(struct dmi_system_id *d) +{ + if (enable_local_apic == 0) { + enable_local_apic = -1; + printk(KERN_WARNING "%s with broken BIOS detected. " + "Refusing to enable the local APIC.\n", + d->ident); + } + return 0; +} + +static struct dmi_system_id __initdata apic_dmi_table[] = { + { + .callback = local_apic_kills_bios, + .ident = "Dell Inspiron", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"), + DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron"), + }, + }, + { + .callback = local_apic_kills_bios, + .ident = "Dell Latitude", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"), + DMI_MATCH(DMI_PRODUCT_NAME, "Latitude"), + }, + }, + { + .callback = local_apic_kills_bios, + .ident = "IBM Thinkpad T20", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), + DMI_MATCH(DMI_BOARD_NAME, "264741U"), + }, + }, + { + .callback = local_apic_kills_bios, + .ident = "ASUS L3C", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), + DMI_MATCH(DMI_BOARD_NAME, "P4_L3C"), + }, + }, + { } +}; + static int __init detect_init_APIC (void) { u32 h, l, features; extern void get_cpu_vendor(struct cpuinfo_x86*); + dmi_check_system(apic_dmi_table); + /* Disabled by DMI scan or kernel option? */ if (enable_local_apic < 0) return -1; @@ -1159,6 +1215,8 @@ asmlinkage void smp_error_interrupt(void */ int __init APIC_init_uniprocessor (void) { + dmi_check_system(apic_dmi_table); + if (enable_local_apic < 0) clear_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability); diff -puN arch/i386/kernel/dmi_scan.c~dmi-port-local-apic-quirks-to-new-dmi-probing arch/i386/kernel/dmi_scan.c --- 25/arch/i386/kernel/dmi_scan.c~dmi-port-local-apic-quirks-to-new-dmi-probing Fri May 28 14:28:54 2004 +++ 25-akpm/arch/i386/kernel/dmi_scan.c Fri May 28 14:28:54 2004 @@ -156,26 +156,6 @@ static void __init dmi_save_ident(struct } /* - * Some machines, usually laptops, can't handle an enabled local APIC. - * The symptoms include hangs or reboots when suspending or resuming, - * attaching or detaching the power cord, or entering BIOS setup screens - * through magic key sequences. - */ -static int __init local_apic_kills_bios(struct dmi_system_id *d) -{ -#ifdef CONFIG_X86_LOCAL_APIC - extern int enable_local_apic; - if (enable_local_apic == 0) { - enable_local_apic = -1; - printk(KERN_WARNING "%s with broken BIOS detected. " - "Refusing to enable the local APIC.\n", - d->ident); - } -#endif - return 0; -} - -/* * HP Proliant 8500 systems can't use i8042 in mux mode, * or they instantly reboot. */ @@ -262,28 +242,6 @@ static __init int disable_acpi_pci(struc static __initdata struct dmi_system_id dmi_blacklist[]={ - /* Machines which have problems handling enabled local APICs */ - - { local_apic_kills_bios, "Dell Inspiron", { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"), - DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron"), - } }, - - { local_apic_kills_bios, "Dell Latitude", { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"), - DMI_MATCH(DMI_PRODUCT_NAME, "Latitude"), - } }, - - { local_apic_kills_bios, "IBM Thinkpad T20", { - DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), - DMI_MATCH(DMI_BOARD_NAME, "264741U"), - } }, - - { local_apic_kills_bios, "ASUS L3C", { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), - DMI_MATCH(DMI_BOARD_NAME, "P4_L3C"), - } }, - { broken_acpi_Sx, "ASUS K7V-RM", { /* Bad ACPI Sx table */ DMI_MATCH(DMI_BIOS_VERSION,"ASUS K7V-RM ACPI BIOS Revision 1003A"), DMI_MATCH(DMI_BOARD_NAME, ""), _