Commit bde5c490 authored by Len Brown's avatar Len Brown

Merge intel.com:/home/lenb/bk/linux-2.6.0

into intel.com:/home/lenb/bk/linux-acpi-test-2.6.0
parents e0618466 5fa817f1
...@@ -183,8 +183,7 @@ acpi_parse_lapic_nmi ( ...@@ -183,8 +183,7 @@ acpi_parse_lapic_nmi (
#endif /*CONFIG_X86_LOCAL_APIC*/ #endif /*CONFIG_X86_LOCAL_APIC*/
#ifdef CONFIG_X86_IO_APIC #if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER)
static int __init static int __init
acpi_parse_ioapic ( acpi_parse_ioapic (
...@@ -368,7 +367,6 @@ acpi_boot_init (void) ...@@ -368,7 +367,6 @@ acpi_boot_init (void)
result = acpi_table_parse(ACPI_APIC, acpi_parse_madt); result = acpi_table_parse(ACPI_APIC, acpi_parse_madt);
if (!result) { if (!result) {
printk(KERN_WARNING PREFIX "MADT not present\n");
return 0; return 0;
} }
else if (result < 0) { else if (result < 0) {
...@@ -416,7 +414,7 @@ acpi_boot_init (void) ...@@ -416,7 +414,7 @@ acpi_boot_init (void)
#endif /*CONFIG_X86_LOCAL_APIC*/ #endif /*CONFIG_X86_LOCAL_APIC*/
#ifdef CONFIG_X86_IO_APIC #if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER)
/* /*
* I/O APIC * I/O APIC
...@@ -472,7 +470,8 @@ acpi_boot_init (void) ...@@ -472,7 +470,8 @@ acpi_boot_init (void)
acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC; acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC;
acpi_ioapic = 1; acpi_ioapic = 1;
#endif /*CONFIG_X86_IO_APIC*/
#endif /* CONFIG_X86_IO_APIC && CONFIG_ACPI_INTERPRETER */
#ifdef CONFIG_X86_LOCAL_APIC #ifdef CONFIG_X86_LOCAL_APIC
if (acpi_lapic && acpi_ioapic) { if (acpi_lapic && acpi_ioapic) {
...@@ -480,6 +479,7 @@ acpi_boot_init (void) ...@@ -480,6 +479,7 @@ acpi_boot_init (void)
clustered_apic_check(); clustered_apic_check();
} }
#endif #endif
#ifdef CONFIG_HPET_TIMER #ifdef CONFIG_HPET_TIMER
acpi_table_parse(ACPI_HPET, acpi_parse_hpet); acpi_table_parse(ACPI_HPET, acpi_parse_hpet);
#endif #endif
......
...@@ -939,11 +939,6 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={ ...@@ -939,11 +939,6 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={
MATCH(DMI_BOARD_NAME, "CUR-DLS"), MATCH(DMI_BOARD_NAME, "CUR-DLS"),
NO_MATCH, NO_MATCH }}, NO_MATCH, NO_MATCH }},
{ force_acpi_ht, "ASUS A7V", {
MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"),
MATCH(DMI_BOARD_NAME, "<A7V>"),
MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1011"), NO_MATCH }},
{ force_acpi_ht, "ABIT i440BX-W83977", { { force_acpi_ht, "ABIT i440BX-W83977", {
MATCH(DMI_BOARD_VENDOR, "ABIT <http://www.abit.com>"), MATCH(DMI_BOARD_VENDOR, "ABIT <http://www.abit.com>"),
MATCH(DMI_BOARD_NAME, "i440BX-W83977 (BP6)"), MATCH(DMI_BOARD_NAME, "i440BX-W83977 (BP6)"),
...@@ -978,7 +973,10 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={ ...@@ -978,7 +973,10 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={
{ disable_acpi_pci, "ASUS A7V", { { disable_acpi_pci, "ASUS A7V", {
MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"), MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"),
MATCH(DMI_BOARD_NAME, "<A7V>"), MATCH(DMI_BOARD_NAME, "<A7V>"),
MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1007"), NO_MATCH }}, /* newer BIOS, Revision 1011, does work */
MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1007"),
NO_MATCH }},
#endif #endif
{ NULL, } { NULL, }
......
...@@ -830,7 +830,7 @@ void __init mp_register_lapic ( ...@@ -830,7 +830,7 @@ void __init mp_register_lapic (
MP_processor_info(&processor); MP_processor_info(&processor);
} }
#ifdef CONFIG_X86_IO_APIC #if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER)
#define MP_ISA_BUS 0 #define MP_ISA_BUS 0
#define MP_MAX_IOAPIC_PIN 127 #define MP_MAX_IOAPIC_PIN 127
...@@ -1019,10 +1019,6 @@ void __init mp_config_acpi_legacy_irqs (void) ...@@ -1019,10 +1019,6 @@ void __init mp_config_acpi_legacy_irqs (void)
} }
} }
#ifdef CONFIG_ACPI
/* Ensure the ACPI SCI interrupt level is active low, edge-triggered */
extern FADT_DESCRIPTOR acpi_fadt; extern FADT_DESCRIPTOR acpi_fadt;
void __init mp_config_ioapic_for_sci(int irq) void __init mp_config_ioapic_for_sci(int irq)
...@@ -1031,6 +1027,7 @@ void __init mp_config_ioapic_for_sci(int irq) ...@@ -1031,6 +1027,7 @@ void __init mp_config_ioapic_for_sci(int irq)
int ioapic_pin; int ioapic_pin;
struct acpi_table_madt *madt; struct acpi_table_madt *madt;
struct acpi_table_int_src_ovr *entry = NULL; struct acpi_table_int_src_ovr *entry = NULL;
acpi_interrupt_flags flags;
void *madt_end; void *madt_end;
acpi_status status; acpi_status status;
...@@ -1049,32 +1046,37 @@ void __init mp_config_ioapic_for_sci(int irq) ...@@ -1049,32 +1046,37 @@ void __init mp_config_ioapic_for_sci(int irq)
while ((void *) entry < madt_end) { while ((void *) entry < madt_end) {
if (entry->header.type == ACPI_MADT_INT_SRC_OVR && if (entry->header.type == ACPI_MADT_INT_SRC_OVR &&
acpi_fadt.sci_int == entry->bus_irq) { acpi_fadt.sci_int == entry->bus_irq)
/* goto found;
* See the note at the end of ACPI 2.0b section
* 5.2.10.8 for what this is about.
*/
if (entry->bus_irq != entry->global_irq) {
acpi_fadt.sci_int = entry->global_irq;
irq = entry->global_irq;
break;
}
else
return;
}
entry = (struct acpi_table_int_src_ovr *) entry = (struct acpi_table_int_src_ovr *)
((unsigned long) entry + entry->header.length); ((unsigned long) entry + entry->header.length);
} }
} }
/*
* Although the ACPI spec says that the SCI should be level/low
* don't reprogram it unless there is an explicit MADT OVR entry
* instructing us to do so -- otherwise we break Tyan boards which
* have the SCI wired edge/high but no MADT OVR.
*/
return;
found:
/*
* See the note at the end of ACPI 2.0b section
* 5.2.10.8 for what this is about.
*/
flags = entry->flags;
acpi_fadt.sci_int = entry->global_irq;
irq = entry->global_irq;
ioapic = mp_find_ioapic(irq); ioapic = mp_find_ioapic(irq);
ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start; ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start;
io_apic_set_pci_routing(ioapic, ioapic_pin, irq, 1, 1); // Active low, level triggered io_apic_set_pci_routing(ioapic, ioapic_pin, irq,
(flags.trigger >> 1) , (flags.polarity >> 1));
} }
#endif /* CONFIG_ACPI */
#ifdef CONFIG_ACPI_PCI #ifdef CONFIG_ACPI_PCI
...@@ -1110,8 +1112,10 @@ void __init mp_parse_prt (void) ...@@ -1110,8 +1112,10 @@ void __init mp_parse_prt (void)
} }
/* Don't set up the ACPI SCI because it's already set up */ /* Don't set up the ACPI SCI because it's already set up */
if (acpi_fadt.sci_int == irq) if (acpi_fadt.sci_int == irq) {
entry->irq = irq; /*we still need to set entry's irq*/
continue; continue;
}
ioapic = mp_find_ioapic(irq); ioapic = mp_find_ioapic(irq);
if (ioapic < 0) if (ioapic < 0)
...@@ -1154,5 +1158,5 @@ void __init mp_parse_prt (void) ...@@ -1154,5 +1158,5 @@ void __init mp_parse_prt (void)
} }
#endif /*CONFIG_ACPI_PCI*/ #endif /*CONFIG_ACPI_PCI*/
#endif /* CONFIG_X86_IO_APIC */ #endif /*CONFIG_X86_IO_APIC && CONFIG_ACPI_INTERPRETER*/
#endif /*CONFIG_ACPI_BOOT*/ #endif /*CONFIG_ACPI_BOOT*/
...@@ -64,10 +64,10 @@ struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1, 1, 0, 0, -1 }; ...@@ -64,10 +64,10 @@ struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
unsigned long mmu_cr4_features; unsigned long mmu_cr4_features;
EXPORT_SYMBOL_GPL(mmu_cr4_features); EXPORT_SYMBOL_GPL(mmu_cr4_features);
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI_INTERPRETER
int acpi_disabled __initdata = 0; int acpi_disabled = 0;
#else #else
int acpi_disabled __initdata = 1; int acpi_disabled = 1;
#endif #endif
EXPORT_SYMBOL(acpi_disabled); EXPORT_SYMBOL(acpi_disabled);
......
...@@ -56,7 +56,7 @@ void (*pm_power_off) (void); ...@@ -56,7 +56,7 @@ void (*pm_power_off) (void);
unsigned char acpi_kbd_controller_present = 1; unsigned char acpi_kbd_controller_present = 1;
int acpi_disabled __initdata; /* XXX this shouldn't be needed---we can't boot without ACPI! */ int acpi_disabled; /* XXX this shouldn't be needed---we can't boot without ACPI! */
const char * const char *
acpi_get_sysname (void) acpi_get_sysname (void)
......
...@@ -3,34 +3,14 @@ ...@@ -3,34 +3,14 @@
# #
menu "ACPI (Advanced Configuration and Power Interface) Support" menu "ACPI (Advanced Configuration and Power Interface) Support"
config ACPI_HT
bool "ACPI Processor Enumeration for HT"
depends on X86
default y
---help---
ACPI enumerates both logical (a.k.a. Hyper-Threaded -- HT)
and physical processors. It is designed to obsolete several older
specifications, including the MultiProcessor Specification (MPS),
which supported only physical processors.
CONFIG_ACPI_HT includes the minimal ACPI boot-time code
necessary to enumerate logical processors and enable HT.
CONFIG_ACPI includes CONFIG_ACPI_HT, plus IO APIC enumeration,
and the hooks to run the ACPI AML interpreter for run-time events.
When CONFIG_ACPI is selected, the command-line option "acpi=ht"
is available to run just the ACPI boot-time code -- just as if
only CONFIG_ACPI_HT were selected.
Note that "acpi=off" can be used to disable all ACPI code in the kernel.
config ACPI
bool "Full ACPI Support"
depends on !X86_VISWS depends on !X86_VISWS
depends on !IA64_HP_SIM depends on !IA64_HP_SIM
depends on IA64 || (X86 || ACPI_HT) depends on IA64 || X86
config ACPI
bool "ACPI Support"
depends on IA64 || X86
default y default y
---help--- ---help---
Advanced Configuration and Power Interface (ACPI) support for Advanced Configuration and Power Interface (ACPI) support for
...@@ -60,14 +40,47 @@ config ACPI ...@@ -60,14 +40,47 @@ config ACPI
available at: available at:
<http://www.acpi.info> <http://www.acpi.info>
config ACPI_HT_ONLY
bool "Restrict ACPI to minimum boot code to enable HT"
depends on X86
depends on ACPI
depends on SMP
default n
---help---
ACPI enumerates both logical (a.k.a. Hyper-Threaded -- HT)
and physical processors. It is designed to obsolete several older
specifications, including the MultiProcessor Specification (MPS),
which supported only physical processors.
CONFIG_ACPI_HT_ONLY includes just the minimal ACPI boot-time code
necessary to enumerate logical processors and enable HT.
CONFIG_ACPI includes this, plus IO APIC enumeration,
and the hooks to run the ACPI AML interpreter for run-time events.
When CONFIG_ACPI is selected, the command-line option "acpi=ht"
is available to run just the ACPI boot-time code -- just as if
only CONFIG_ACPI_HT_ONLY were selected.
Note that "acpi=off" can be used to disable all ACPI code in the kernel.
config ACPI_BOOT config ACPI_BOOT
bool bool
depends on ACPI || ACPI_HT depends on ACPI
default y
config ACPI_INTERPRETER
bool
depends on ACPI
depends on !IA64_SGI_SN
depends on !ACPI_HT_ONLY
default y default y
config ACPI_SLEEP config ACPI_SLEEP
bool "Sleep States (EXPERIMENTAL)" bool "Sleep States (EXPERIMENTAL)"
depends on X86 && ACPI depends on X86 && ACPI
depends on ACPI_INTERPRETER
depends on EXPERIMENTAL && PM depends on EXPERIMENTAL && PM
default y default y
---help--- ---help---
...@@ -93,7 +106,8 @@ config ACPI_SLEEP_PROC_FS ...@@ -93,7 +106,8 @@ config ACPI_SLEEP_PROC_FS
config ACPI_AC config ACPI_AC
tristate "AC Adapter" tristate "AC Adapter"
depends on X86 && ACPI depends on X86
depends on ACPI_INTERPRETER
default m default m
help help
This driver adds support for the AC Adapter object, which indicates This driver adds support for the AC Adapter object, which indicates
...@@ -102,7 +116,8 @@ config ACPI_AC ...@@ -102,7 +116,8 @@ config ACPI_AC
config ACPI_BATTERY config ACPI_BATTERY
tristate "Battery" tristate "Battery"
depends on X86 && ACPI depends on X86
depends on ACPI_INTERPRETER
default m default m
help help
This driver adds support for battery information through This driver adds support for battery information through
...@@ -111,7 +126,7 @@ config ACPI_BATTERY ...@@ -111,7 +126,7 @@ config ACPI_BATTERY
config ACPI_BUTTON config ACPI_BUTTON
tristate "Button" tristate "Button"
depends on ACPI depends on ACPI_INTERPRETER
depends on !IA64_SGI_SN depends on !IA64_SGI_SN
default m default m
help help
...@@ -123,7 +138,7 @@ config ACPI_BUTTON ...@@ -123,7 +138,7 @@ config ACPI_BUTTON
config ACPI_FAN config ACPI_FAN
tristate "Fan" tristate "Fan"
depends on ACPI depends on ACPI_INTERPRETER
depends on !IA64_SGI_SN depends on !IA64_SGI_SN
default m default m
help help
...@@ -132,7 +147,7 @@ config ACPI_FAN ...@@ -132,7 +147,7 @@ config ACPI_FAN
config ACPI_PROCESSOR config ACPI_PROCESSOR
tristate "Processor" tristate "Processor"
depends on ACPI depends on ACPI_INTERPRETER
depends on !IA64_SGI_SN depends on !IA64_SGI_SN
default m default m
help help
...@@ -152,14 +167,15 @@ config ACPI_THERMAL ...@@ -152,14 +167,15 @@ config ACPI_THERMAL
config ACPI_NUMA config ACPI_NUMA
bool "NUMA support" bool "NUMA support"
depends on ACPI depends on ACPI_INTERPRETER
depends on NUMA depends on NUMA
depends on !X86_64 depends on !X86_64
default y if IA64_GENERIC || IA64_SGI_SN2 default y if IA64_GENERIC || IA64_SGI_SN2
config ACPI_ASUS config ACPI_ASUS
tristate "ASUS/Medion Laptop Extras" tristate "ASUS/Medion Laptop Extras"
depends on X86 && ACPI depends on X86
depends on ACPI_INTERPRETER
default m default m
---help--- ---help---
This driver provides support for extra features of ACPI-compatible This driver provides support for extra features of ACPI-compatible
...@@ -185,7 +201,8 @@ config ACPI_ASUS ...@@ -185,7 +201,8 @@ config ACPI_ASUS
config ACPI_TOSHIBA config ACPI_TOSHIBA
tristate "Toshiba Laptop Extras" tristate "Toshiba Laptop Extras"
depends on X86 && ACPI depends on X86
depends on ACPI_INTERPRETER
default m default m
---help--- ---help---
This driver adds support for access to certain system settings This driver adds support for access to certain system settings
...@@ -212,7 +229,7 @@ config ACPI_TOSHIBA ...@@ -212,7 +229,7 @@ config ACPI_TOSHIBA
config ACPI_DEBUG config ACPI_DEBUG
bool "Debug Statements" bool "Debug Statements"
depends on ACPI depends on ACPI_INTERPRETER
depends on !IA64_SGI_SN depends on !IA64_SGI_SN
default n default n
help help
...@@ -222,19 +239,14 @@ config ACPI_DEBUG ...@@ -222,19 +239,14 @@ config ACPI_DEBUG
config ACPI_BUS config ACPI_BUS
bool bool
depends on ACPI depends on ACPI_INTERPRETER
depends on !IA64_SGI_SN
default y
config ACPI_INTERPRETER
bool
depends on ACPI
depends on !IA64_SGI_SN depends on !IA64_SGI_SN
default y default y
config ACPI_EC config ACPI_EC
bool bool
depends on X86 && ACPI depends on X86
depends on ACPI_INTERPRETER
default y default y
help help
This driver is required on some systems for the proper operation of This driver is required on some systems for the proper operation of
...@@ -243,19 +255,19 @@ config ACPI_EC ...@@ -243,19 +255,19 @@ config ACPI_EC
config ACPI_POWER config ACPI_POWER
bool bool
depends on ACPI depends on ACPI_INTERPRETER
depends on !IA64_SGI_SN depends on !IA64_SGI_SN
default y default y
config ACPI_PCI config ACPI_PCI
bool bool
depends on ACPI depends on ACPI_INTERPRETER
depends on !IA64_SGI_SN depends on !IA64_SGI_SN
default PCI default PCI
config ACPI_SYSTEM config ACPI_SYSTEM
bool bool
depends on ACPI depends on ACPI_INTERPRETER
depends on !IA64_SGI_SN depends on !IA64_SGI_SN
default y default y
help help
...@@ -264,7 +276,7 @@ config ACPI_SYSTEM ...@@ -264,7 +276,7 @@ config ACPI_SYSTEM
config ACPI_EFI config ACPI_EFI
bool bool
depends on ACPI depends on ACPI_INTERPRETER
depends on IA64 depends on IA64
default y default y
......
...@@ -18,7 +18,7 @@ obj-$(CONFIG_ACPI) := acpi_ksyms.o ...@@ -18,7 +18,7 @@ obj-$(CONFIG_ACPI) := acpi_ksyms.o
# ACPI Boot-Time Table Parsing # ACPI Boot-Time Table Parsing
# #
obj-$(CONFIG_ACPI_BOOT) += tables.o obj-$(CONFIG_ACPI_BOOT) += tables.o
obj-$(CONFIG_ACPI) += blacklist.o obj-$(CONFIG_ACPI_INTERPRETER) += blacklist.o
# #
# ACPI Core Subsystem (Interpreter) # ACPI Core Subsystem (Interpreter)
......
...@@ -634,8 +634,7 @@ acpi_bus_init (void) ...@@ -634,8 +634,7 @@ acpi_bus_init (void)
* the EC parameters out of that. * the EC parameters out of that.
*/ */
status = acpi_ec_ecdt_probe(); status = acpi_ec_ecdt_probe();
if (ACPI_FAILURE(status)) /* Ignore result. Not having an ECDT is not fatal. */
goto error1;
#endif #endif
status = acpi_initialize_objects(ACPI_FULL_INITIALIZATION); status = acpi_initialize_objects(ACPI_FULL_INITIALIZATION);
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <acpi/acpi_bus.h> #include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h> #include <acpi/acpi_drivers.h>
#include <acpi/actypes.h>
#define _COMPONENT ACPI_EC_COMPONENT #define _COMPONENT ACPI_EC_COMPONENT
ACPI_MODULE_NAME ("acpi_ec") ACPI_MODULE_NAME ("acpi_ec")
...@@ -412,7 +412,10 @@ acpi_ec_space_setup ( ...@@ -412,7 +412,10 @@ acpi_ec_space_setup (
* The EC object is in the handler context and is needed * The EC object is in the handler context and is needed
* when calling the acpi_ec_space_handler. * when calling the acpi_ec_space_handler.
*/ */
*return_context = handler_context; if(function == ACPI_REGION_DEACTIVATE)
*return_context = NULL;
else
*return_context = handler_context;
return AE_OK; return AE_OK;
} }
......
...@@ -382,7 +382,7 @@ acpi_ev_detach_region( ...@@ -382,7 +382,7 @@ acpi_ev_detach_region(
union acpi_operand_object *obj_desc; union acpi_operand_object *obj_desc;
union acpi_operand_object **last_obj_ptr; union acpi_operand_object **last_obj_ptr;
acpi_adr_space_setup region_setup; acpi_adr_space_setup region_setup;
void *region_context; void **region_context;
union acpi_operand_object *region_obj2; union acpi_operand_object *region_obj2;
acpi_status status; acpi_status status;
...@@ -394,7 +394,7 @@ acpi_ev_detach_region( ...@@ -394,7 +394,7 @@ acpi_ev_detach_region(
if (!region_obj2) { if (!region_obj2) {
return_VOID; return_VOID;
} }
region_context = region_obj2->extra.region_context; region_context = &region_obj2->extra.region_context;
/* Get the address handler from the region object */ /* Get the address handler from the region object */
...@@ -450,7 +450,7 @@ acpi_ev_detach_region( ...@@ -450,7 +450,7 @@ acpi_ev_detach_region(
region_setup = handler_obj->address_space.setup; region_setup = handler_obj->address_space.setup;
status = region_setup (region_obj, ACPI_REGION_DEACTIVATE, status = region_setup (region_obj, ACPI_REGION_DEACTIVATE,
handler_obj->address_space.context, &region_context); handler_obj->address_space.context, region_context);
/* Init routine may fail, Just ignore errors */ /* Init routine may fail, Just ignore errors */
......
...@@ -220,7 +220,6 @@ acpi_pci_link_check_current ( ...@@ -220,7 +220,6 @@ acpi_pci_link_check_current (
return AE_CTRL_TERMINATE; return AE_CTRL_TERMINATE;
} }
static int static int
acpi_pci_link_get_current ( acpi_pci_link_get_current (
struct acpi_pci_link *link) struct acpi_pci_link *link)
...@@ -279,6 +278,28 @@ acpi_pci_link_get_current ( ...@@ -279,6 +278,28 @@ acpi_pci_link_get_current (
return_VALUE(result); return_VALUE(result);
} }
static int
acpi_pci_link_try_get_current (
struct acpi_pci_link *link,
int irq)
{
int result;
ACPI_FUNCTION_TRACE("acpi_pci_link_try_get_current");
result = acpi_pci_link_get_current(link);
if (result && link->irq.active) {
return_VALUE(result);
}
if (!link->irq.active) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "No active IRQ resource found\n"));
printk(KERN_WARNING "_CRS returns NULL! Using IRQ %d for device (%s [%s]).\n", irq, acpi_device_name(link->device), acpi_device_bid(link->device));
link->irq.active = irq;
}
return 0;
}
static int static int
acpi_pci_link_set ( acpi_pci_link_set (
...@@ -294,6 +315,7 @@ acpi_pci_link_set ( ...@@ -294,6 +315,7 @@ acpi_pci_link_set (
struct acpi_buffer buffer = {sizeof(resource)+1, &resource}; struct acpi_buffer buffer = {sizeof(resource)+1, &resource};
int i = 0; int i = 0;
int valid = 0; int valid = 0;
int resource_type = 0;
ACPI_FUNCTION_TRACE("acpi_pci_link_set"); ACPI_FUNCTION_TRACE("acpi_pci_link_set");
...@@ -317,20 +339,32 @@ acpi_pci_link_set ( ...@@ -317,20 +339,32 @@ acpi_pci_link_set (
} }
} }
/* If IRQ<=15, first try with a "normal" IRQ descriptor. If that fails, try with
* an extended one */
if (irq <= 15) {
resource_type = ACPI_RSTYPE_IRQ;
} else {
resource_type = ACPI_RSTYPE_EXT_IRQ;
}
retry_programming:
memset(&resource, 0, sizeof(resource)); memset(&resource, 0, sizeof(resource));
/* NOTE: PCI interrupts are always level / active_low / shared. But not all /* NOTE: PCI interrupts are always level / active_low / shared. But not all
interrupts > 15 are PCI interrupts. Rely on the ACPI IRQ definition for interrupts > 15 are PCI interrupts. Rely on the ACPI IRQ definition for
parameters */ parameters */
if (irq <= 15) { switch(resource_type) {
case ACPI_RSTYPE_IRQ:
resource.res.id = ACPI_RSTYPE_IRQ; resource.res.id = ACPI_RSTYPE_IRQ;
resource.res.length = sizeof(struct acpi_resource); resource.res.length = sizeof(struct acpi_resource);
resource.res.data.irq.edge_level = link->irq.edge_level; resource.res.data.irq.edge_level = link->irq.edge_level;
resource.res.data.irq.active_high_low = link->irq.active_high_low; resource.res.data.irq.active_high_low = link->irq.active_high_low;
resource.res.data.irq.number_of_interrupts = 1; resource.res.data.irq.number_of_interrupts = 1;
resource.res.data.irq.interrupts[0] = irq; resource.res.data.irq.interrupts[0] = irq;
} break;
else {
case ACPI_RSTYPE_EXT_IRQ:
resource.res.id = ACPI_RSTYPE_EXT_IRQ; resource.res.id = ACPI_RSTYPE_EXT_IRQ;
resource.res.length = sizeof(struct acpi_resource); resource.res.length = sizeof(struct acpi_resource);
resource.res.data.extended_irq.producer_consumer = ACPI_CONSUMER; resource.res.data.extended_irq.producer_consumer = ACPI_CONSUMER;
...@@ -339,11 +373,21 @@ acpi_pci_link_set ( ...@@ -339,11 +373,21 @@ acpi_pci_link_set (
resource.res.data.extended_irq.number_of_interrupts = 1; resource.res.data.extended_irq.number_of_interrupts = 1;
resource.res.data.extended_irq.interrupts[0] = irq; resource.res.data.extended_irq.interrupts[0] = irq;
/* ignore resource_source, it's optional */ /* ignore resource_source, it's optional */
break;
} }
resource.end.id = ACPI_RSTYPE_END_TAG; resource.end.id = ACPI_RSTYPE_END_TAG;
/* Attempt to set the resource */ /* Attempt to set the resource */
status = acpi_set_current_resources(link->handle, &buffer); status = acpi_set_current_resources(link->handle, &buffer);
/* if we failed and IRQ <= 15, try again with an extended descriptor */
if (ACPI_FAILURE(status) && (resource_type == ACPI_RSTYPE_IRQ)) {
resource_type = ACPI_RSTYPE_EXT_IRQ;
printk(PREFIX "Retrying with extended IRQ descriptor\n");
goto retry_programming;
}
/* check for total failure */
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _SRS\n")); ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _SRS\n"));
return_VALUE(-ENODEV); return_VALUE(-ENODEV);
...@@ -361,7 +405,7 @@ acpi_pci_link_set ( ...@@ -361,7 +405,7 @@ acpi_pci_link_set (
} }
/* Make sure the active IRQ is the one we requested. */ /* Make sure the active IRQ is the one we requested. */
result = acpi_pci_link_get_current(link); result = acpi_pci_link_try_get_current(link, irq);
if (result) { if (result) {
return_VALUE(result); return_VALUE(result);
} }
...@@ -458,14 +502,14 @@ static int acpi_pci_link_allocate(struct acpi_pci_link* link) { ...@@ -458,14 +502,14 @@ static int acpi_pci_link_allocate(struct acpi_pci_link* link) {
irq = link->irq.possible[0]; irq = link->irq.possible[0];
} }
/* /*
* Select the best IRQ. This is done in reverse to promote * Select the best IRQ. This is done in reverse to promote
* the use of IRQs 9, 10, 11, and >15. * the use of IRQs 9, 10, 11, and >15.
*/ */
for (i=(link->irq.possible_count-1); i>0; i--) { for (i=(link->irq.possible_count-1); i>0; i--) {
if (acpi_irq_penalty[irq] > acpi_irq_penalty[link->irq.possible[i]]) if (acpi_irq_penalty[irq] > acpi_irq_penalty[link->irq.possible[i]])
irq = link->irq.possible[i]; irq = link->irq.possible[i];
} }
/* Attempt to enable the link device at this IRQ. */ /* Attempt to enable the link device at this IRQ. */
if (acpi_pci_link_set(link, irq)) { if (acpi_pci_link_set(link, irq)) {
...@@ -574,10 +618,6 @@ acpi_pci_link_add ( ...@@ -574,10 +618,6 @@ acpi_pci_link_add (
else else
printk(" %d", link->irq.possible[i]); printk(" %d", link->irq.possible[i]);
} }
if (!link->irq.active)
printk(", disabled");
else if (!found)
printk(", enabled at IRQ %d", link->irq.active);
printk(")\n"); printk(")\n");
/* TBD: Acquire/release lock */ /* TBD: Acquire/release lock */
......
...@@ -69,7 +69,8 @@ struct acpi_table_sdt { ...@@ -69,7 +69,8 @@ struct acpi_table_sdt {
static unsigned long sdt_pa; /* Physical Address */ static unsigned long sdt_pa; /* Physical Address */
static unsigned long sdt_count; /* Table count */ static unsigned long sdt_count; /* Table count */
static struct acpi_table_sdt *sdt_entry;
static struct acpi_table_sdt sdt_entry[ACPI_MAX_TABLES];
void void
acpi_table_print ( acpi_table_print (
...@@ -418,12 +419,6 @@ acpi_table_get_sdt ( ...@@ -418,12 +419,6 @@ acpi_table_get_sdt (
sdt_count = ACPI_MAX_TABLES; sdt_count = ACPI_MAX_TABLES;
} }
sdt_entry = alloc_bootmem(sdt_count * sizeof(struct acpi_table_sdt));
if (!sdt_entry) {
printk(KERN_ERR "ACPI: Could not allocate mem for SDT entries!\n");
return -ENOMEM;
}
for (i = 0; i < sdt_count; i++) for (i = 0; i < sdt_count; i++)
sdt_entry[i].pa = (unsigned long) mapped_xsdt->entry[i]; sdt_entry[i].pa = (unsigned long) mapped_xsdt->entry[i];
} }
...@@ -470,12 +465,6 @@ acpi_table_get_sdt ( ...@@ -470,12 +465,6 @@ acpi_table_get_sdt (
sdt_count = ACPI_MAX_TABLES; sdt_count = ACPI_MAX_TABLES;
} }
sdt_entry = alloc_bootmem(sdt_count * sizeof(struct acpi_table_sdt));
if (!sdt_entry) {
printk(KERN_ERR "ACPI: Could not allocate mem for SDT entries!\n");
return -ENOMEM;
}
for (i = 0; i < sdt_count; i++) for (i = 0; i < sdt_count; i++)
sdt_entry[i].pa = (unsigned long) mapped_rsdt->entry[i]; sdt_entry[i].pa = (unsigned long) mapped_rsdt->entry[i];
} }
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
/* Version string */ /* Version string */
#define ACPI_CA_VERSION 0x20030813 #define ACPI_CA_VERSION 0x20030916
/* Maximum objects in the various object caches */ /* Maximum objects in the various object caches */
......
...@@ -424,17 +424,17 @@ int ec_write(u8 addr, u8 val); ...@@ -424,17 +424,17 @@ int ec_write(u8 addr, u8 val);
#endif /*CONFIG_ACPI_EC*/ #endif /*CONFIG_ACPI_EC*/
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI_INTERPRETER
int acpi_blacklisted(void); int acpi_blacklisted(void);
#else #else /*!CONFIG_ACPI_INTERPRETER*/
static inline int acpi_blacklisted(void) static inline int acpi_blacklisted(void)
{ {
return 0; return 0;
} }
#endif /*CONFIG_ACPI*/ #endif /*!CONFIG_ACPI_INTERPRETER*/
#endif /*_LINUX_ACPI_H*/ #endif /*_LINUX_ACPI_H*/
...@@ -104,4 +104,3 @@ void md_run_setup(void); ...@@ -104,4 +104,3 @@ void md_run_setup(void);
static inline void md_run_setup(void) {} static inline void md_run_setup(void) {}
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment