diff options
author | Len Brown <len.brown@intel.com> | 2004-08-13 17:11:05 -0400 |
---|---|---|
committer | Len Brown <lenb@dhcppc3.> | 2004-08-13 17:11:05 -0400 |
commit | 7a4bd3568f114d5936a3a6836cf1448e1ffa1651 (patch) | |
tree | 46836bc8826f21550548a257612fd8ddc469aaac /drivers | |
parent | d0f855c14397a9f9149251dadb2e58e3ec126176 (diff) | |
download | history-7a4bd3568f114d5936a3a6836cf1448e1ffa1651.tar.gz |
[ACPI] Enter ACPI mode earlier
Fixes two common boot failures due to buggy SMM BIOS code
SMP boot crash if SMI_CMD=ACPI written from CPU1
http://bugzilla.kernel.org/show_bug.cgi?id=2941
laptop crash due to LAPIC timer before SMI_CMD=ACPI
http://bugzilla.kernel.org/show_bug.cgi?id=1269
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/bus.c | 38 | ||||
-rw-r--r-- | drivers/acpi/osl.c | 10 |
2 files changed, 42 insertions, 6 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 51362331a5f6e2..c99c4e54e09fce 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -590,10 +590,9 @@ acpi_bus_init_irq (void) } -static int __init -acpi_bus_init (void) +void __init +acpi_early_init (void) { - int result = 0; acpi_status status = AE_OK; struct acpi_buffer buffer = {sizeof(acpi_fadt), &acpi_fadt}; @@ -617,7 +616,7 @@ acpi_bus_init (void) status = acpi_get_table(ACPI_TABLE_FADT, 1, &buffer); if (ACPI_FAILURE(status)) { printk(KERN_ERR PREFIX "Unable to get the FADT\n"); - goto error1; + goto error0; } #ifdef CONFIG_X86 @@ -640,12 +639,40 @@ acpi_bus_init (void) } #endif - status = acpi_enable_subsystem(ACPI_FULL_INITIALIZATION); + status = acpi_enable_subsystem(~(ACPI_NO_HARDWARE_INIT | ACPI_NO_ACPI_ENABLE)); + if (ACPI_FAILURE(status)) { + printk(KERN_ERR PREFIX "Unable to enable ACPI\n"); + goto error0; + } + + return; + +error0: + disable_acpi(); + return; +} + +static int __init +acpi_bus_init (void) +{ + int result = 0; + acpi_status status = AE_OK; + extern acpi_status acpi_os_initialize1(void); + + ACPI_FUNCTION_TRACE("acpi_bus_init"); + + status = acpi_os_initialize1(); + + status = acpi_enable_subsystem(ACPI_NO_HARDWARE_INIT | ACPI_NO_ACPI_ENABLE); if (ACPI_FAILURE(status)) { printk(KERN_ERR PREFIX "Unable to start the ACPI Interpreter\n"); goto error1; } + if (ACPI_FAILURE(status)) { + printk(KERN_ERR PREFIX "Unable to initialize ACPI OS objects\n"); + goto error1; + } #ifdef CONFIG_ACPI_EC /* * ACPI 2.0 requires the EC driver to be loaded and work before @@ -693,7 +720,6 @@ acpi_bus_init (void) /* Mimic structured exception handling */ error1: acpi_terminate(); -error0: return_VALUE(-ENODEV); } diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index a045753abdc456..22e7094bbe0831 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -71,6 +71,12 @@ static struct workqueue_struct *kacpid_wq; acpi_status acpi_os_initialize(void) { + return AE_OK; +} + +acpi_status +acpi_os_initialize1(void) +{ /* * Initialize PCI configuration space access, as we'll need to access * it while walking the namespace (bus 0 and root bridges w/ _BBNs). @@ -470,6 +476,8 @@ acpi_os_read_pci_configuration (struct acpi_pci_id *pci_id, u32 reg, void *value return AE_ERROR; } + BUG_ON(!raw_pci_ops); + result = raw_pci_ops->read(pci_id->segment, pci_id->bus, PCI_DEVFN(pci_id->device, pci_id->function), reg, size, value); @@ -496,6 +504,8 @@ acpi_os_write_pci_configuration (struct acpi_pci_id *pci_id, u32 reg, acpi_integ return AE_ERROR; } + BUG_ON(!raw_pci_ops); + result = raw_pci_ops->write(pci_id->segment, pci_id->bus, PCI_DEVFN(pci_id->device, pci_id->function), reg, size, value); |