kernel_optimize_test/drivers/acpi
Ingo Molnar 5d0e600d90 [PATCH] x86: fix laptop bootup hang in init_acpi()
During kernel bootup, a new T60 laptop (CoreDuo, 32-bit) hangs about
10%-20% of the time in acpi_init():

 Calling initcall 0xc055ce1a: topology_init+0x0/0x2f()
 Calling initcall 0xc055d75e: mtrr_init_finialize+0x0/0x2c()
 Calling initcall 0xc05664f3: param_sysfs_init+0x0/0x175()
 Calling initcall 0xc014cb65: pm_sysrq_init+0x0/0x17()
 Calling initcall 0xc0569f99: init_bio+0x0/0xf4()
 Calling initcall 0xc056b865: genhd_device_init+0x0/0x50()
 Calling initcall 0xc056c4bd: fbmem_init+0x0/0x87()
 Calling initcall 0xc056dd74: acpi_init+0x0/0x1ee()

It's a hard hang that not even an NMI could punch through!  Frustratingly,
adding printks or function tracing to the ACPI code made the hangs go away
...

After some time an additional detail emerged: disabling the NMI watchdog
made these occasional hangs go away.

So i spent the better part of today trying to debug this and trying out
various theories when i finally found the likely reason for the hang: if
acpi_ns_initialize_devices() executes an _INI AML method and an NMI
happens to hit that AML execution in the wrong moment, the machine would
hang.  (my theory is that this must be some sort of chipset setup method
doing stores to chipset mmio registers?)

Unfortunately given the characteristics of the hang it was sheer
impossible to figure out which of the numerous AML methods is impacted
by this problem.

As a workaround i wrote an interface to disable chipset-based NMIs while
executing _INI sections - and indeed this fixed the hang.  I did a
boot-loop of 100 separate reboots and none hung - while without the patch
it would hang every 5-10 attempts.  Out of caution i did not touch the
nmi_watchdog=2 case (it's not related to the chipset anyway and didnt
hang).

I implemented this for both x86_64 and i686, tested the i686 laptop both
with nmi_watchdog=1 [which triggered the hangs] and nmi_watchdog=2, and
tested an Athlon64 box with the 64-bit kernel as well. Everything builds
and works with the patch applied.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Andi Kleen <ak@suse.de>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2007-02-13 13:26:24 +01:00
..
dispatcher ACPICA: Update copyright to 2007. 2007-02-02 21:14:31 -05:00
events ACPICA: Update copyright to 2007. 2007-02-02 21:14:31 -05:00
executer ACPICA: Update copyright to 2007. 2007-02-02 21:14:31 -05:00
hardware ACPICA: Update copyright to 2007. 2007-02-02 21:14:31 -05:00
namespace [PATCH] x86: fix laptop bootup hang in init_acpi() 2007-02-13 13:26:24 +01:00
parser ACPICA: Update copyright to 2007. 2007-02-02 21:14:31 -05:00
resources ACPICA: Update copyright to 2007. 2007-02-02 21:14:31 -05:00
sleep ACPICA: minimal patch to integrate new tables into Linux 2007-02-02 21:14:22 -05:00
tables ACPICA: reduce table header messages to fit within 80 columns 2007-02-06 15:28:23 -05:00
utilities ACPICA: fix gcc build warnings 2007-02-02 23:08:40 -05:00
ac.c ACPI: replace kmalloc+memset with kzalloc 2006-12-20 16:54:54 -05:00
acpi_memhotplug.c ACPI: replace kmalloc+memset with kzalloc 2006-12-20 16:54:54 -05:00
asus_acpi.c ACPICA: minimal patch to integrate new tables into Linux 2007-02-02 21:14:22 -05:00
battery.c Pull sysfs into test branch 2007-02-03 01:14:35 -05:00
bay.c [PATCH] wrong order of kzalloc arguments 2007-02-09 08:28:48 -08:00
blacklist.c ACPICA: Miscellaneous table manager updates and optimizations 2007-02-02 21:14:29 -05:00
bus.c Pull sysfs into test branch 2007-02-03 01:14:35 -05:00
button.c Pull sysfs into test branch 2007-02-03 01:14:35 -05:00
cm_sbs.c [PATCH] acpi NULL noise removal 2006-10-10 15:37:22 -07:00
container.c Pull sysfs into test branch 2007-02-03 01:14:35 -05:00
debug.c ACPI: add ACPI debug attribute in sysfs 2007-01-28 22:33:36 -05:00
dock.c ACPI: dock: check if parent is on dock 2007-02-03 01:11:17 -05:00
ec.c ACPICA: Remove duplicate table definitions (non-conflicting), cont 2007-02-02 21:14:29 -05:00
event.c ACPI: add 'const' to several ACPI file_operations 2006-07-10 00:04:29 -04:00
fan.c Pull sysfs into test branch 2007-02-03 01:14:35 -05:00
glue.c ACPI: Optimize acpi_get_pci_rootbridge_handle() to boot faster 2007-01-16 16:41:56 -05:00
hotkey.c ACPI: Remove unnecessary from/to-void* and to-void casts in drivers/acpi 2006-10-14 01:51:07 -04:00
i2c_ec.c ACPI: replace kmalloc+memset with kzalloc 2006-12-20 16:54:54 -05:00
i2c_ec.h ACPI: add support for Smart Battery 2006-07-01 16:36:14 -04:00
ibm_acpi.c Revert "ACPI: ibm-acpi: make non-generic bay support optional" 2007-01-11 02:58:15 -05:00
Kconfig Pull trivial into test branch 2007-02-03 01:39:07 -05:00
Makefile Pull motherboard into test branch 2007-02-03 01:38:16 -05:00
numa.c ACPICA: Remove duplicate table definitions (non-conflicting), cont 2007-02-02 21:14:29 -05:00
osl.c Pull motherboard into test branch 2007-02-03 01:38:16 -05:00
pci_bind.c ACPI: fix Supermicro X7DB8+ Boot regression 2006-12-21 03:07:37 -05:00
pci_irq.c ACPI: replace kmalloc+memset with kzalloc 2006-12-20 16:54:54 -05:00
pci_link.c ACPICA: use new ACPI headers. 2007-02-02 21:14:28 -05:00
pci_root.c Pull sysfs into test branch 2007-02-03 01:14:35 -05:00
power.c ACPI: replace kmalloc+memset with kzalloc 2006-12-20 16:54:54 -05:00
processor_core.c Pull sysfs into test branch 2007-02-03 01:14:35 -05:00
processor_idle.c ACPICA: fix gcc build warnings 2007-02-02 23:08:40 -05:00
processor_perflib.c ACPICA: use new ACPI headers. 2007-02-02 21:14:28 -05:00
processor_thermal.c ACPI: Remove unnecessary from/to-void* and to-void casts in drivers/acpi 2006-10-14 01:51:07 -04:00
processor_throttling.c ACPICA: use new ACPI headers. 2007-02-02 21:14:28 -05:00
sbs.c ACPI: replace kmalloc+memset with kzalloc 2006-12-20 16:54:54 -05:00
scan.c Pull trivial into test branch 2007-02-03 01:39:07 -05:00
system.c Pull sysfs into test branch 2007-02-03 01:14:35 -05:00
tables.c ACPICA: Remove duplicate table definitions (non-conflicting) 2007-02-02 21:14:29 -05:00
thermal.c Pull sysfs into test branch 2007-02-03 01:14:35 -05:00
toshiba_acpi.c [PATCH] fix the toshiba_acpi write_lcd return value 2007-01-05 23:55:29 -08:00
utils.c ACPI: replace kmalloc+memset with kzalloc 2006-12-20 16:54:54 -05:00
video.c Pull sysfs into test branch 2007-02-03 01:14:35 -05:00