aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/Kconfig3
-rw-r--r--drivers/acpi/blacklist.c27
-rw-r--r--drivers/acpi/osl.c64
-rw-r--r--drivers/acpi/processor_core.c2
-rw-r--r--drivers/acpi/processor_idle.c25
-rw-r--r--drivers/acpi/tables.c3
6 files changed, 42 insertions, 82 deletions
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 82710ae3922..5cb96300eb0 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -256,7 +256,8 @@ config ACPI_CUSTOM_DSDT_FILE
depends on ACPI_CUSTOM_DSDT
default ""
help
- Enter the full path name to the file wich includes the AmlCode declaration.
+ Enter the full path name to the file which includes the AmlCode
+ declaration.
config ACPI_BLACKLIST_YEAR
int "Disable ACPI for systems before Jan 1st this year" if X86_32
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c
index 9824f679a91..f9c972b26f4 100644
--- a/drivers/acpi/blacklist.c
+++ b/drivers/acpi/blacklist.c
@@ -77,28 +77,13 @@ static struct acpi_blacklist_item acpi_blacklist[] __initdata = {
static int __init blacklist_by_year(void)
{
- int year;
- char *s = dmi_get_system_info(DMI_BIOS_DATE);
-
- if (!s)
- return 0;
- if (!*s)
- return 0;
-
- s = strrchr(s, '/');
- if (!s)
+ int year = dmi_get_year(DMI_BIOS_DATE);
+ /* Doesn't exist? Likely an old system */
+ if (year == -1)
+ return 1;
+ /* 0? Likely a buggy new BIOS */
+ if (year == 0)
return 0;
-
- s += 1;
-
- year = simple_strtoul(s, NULL, 0);
-
- if (year < 100) { /* 2-digit year */
- year += 1900;
- if (year < 1996) /* no dates < spec 1.0 */
- year += 100;
- }
-
if (year < CONFIG_ACPI_BLACKLIST_YEAR) {
printk(KERN_ERR PREFIX "BIOS age (%d) fails cutoff (%d), "
"acpi=force is required to enable ACPI\n",
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index ac5bbaedac1..13b5fd5854a 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -156,12 +156,10 @@ acpi_status acpi_os_get_root_pointer(u32 flags, struct acpi_pointer *addr)
{
if (efi_enabled) {
addr->pointer_type = ACPI_PHYSICAL_POINTER;
- if (efi.acpi20)
- addr->pointer.physical =
- (acpi_physical_address) virt_to_phys(efi.acpi20);
- else if (efi.acpi)
- addr->pointer.physical =
- (acpi_physical_address) virt_to_phys(efi.acpi);
+ if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
+ addr->pointer.physical = efi.acpi20;
+ else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
+ addr->pointer.physical = efi.acpi;
else {
printk(KERN_ERR PREFIX
"System description tables not found\n");
@@ -182,22 +180,14 @@ acpi_status
acpi_os_map_memory(acpi_physical_address phys, acpi_size size,
void __iomem ** virt)
{
- if (efi_enabled) {
- if (EFI_MEMORY_WB & efi_mem_attributes(phys)) {
- *virt = (void __iomem *)phys_to_virt(phys);
- } else {
- *virt = ioremap(phys, size);
- }
- } else {
- if (phys > ULONG_MAX) {
- printk(KERN_ERR PREFIX "Cannot map memory that high\n");
- return AE_BAD_PARAMETER;
- }
- /*
- * ioremap checks to ensure this is in reserved space
- */
- *virt = ioremap((unsigned long)phys, size);
+ if (phys > ULONG_MAX) {
+ printk(KERN_ERR PREFIX "Cannot map memory that high\n");
+ return AE_BAD_PARAMETER;
}
+ /*
+ * ioremap checks to ensure this is in reserved space
+ */
+ *virt = ioremap((unsigned long)phys, size);
if (!*virt)
return AE_NO_MEMORY;
@@ -409,18 +399,8 @@ acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width)
{
u32 dummy;
void __iomem *virt_addr;
- int iomem = 0;
- if (efi_enabled) {
- if (EFI_MEMORY_WB & efi_mem_attributes(phys_addr)) {
- /* HACK ALERT! We can use readb/w/l on real memory too.. */
- virt_addr = (void __iomem *)phys_to_virt(phys_addr);
- } else {
- iomem = 1;
- virt_addr = ioremap(phys_addr, width);
- }
- } else
- virt_addr = (void __iomem *)phys_to_virt(phys_addr);
+ virt_addr = ioremap(phys_addr, width);
if (!value)
value = &dummy;
@@ -438,10 +418,7 @@ acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width)
BUG();
}
- if (efi_enabled) {
- if (iomem)
- iounmap(virt_addr);
- }
+ iounmap(virt_addr);
return AE_OK;
}
@@ -450,18 +427,8 @@ acpi_status
acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width)
{
void __iomem *virt_addr;
- int iomem = 0;
- if (efi_enabled) {
- if (EFI_MEMORY_WB & efi_mem_attributes(phys_addr)) {
- /* HACK ALERT! We can use writeb/w/l on real memory too */
- virt_addr = (void __iomem *)phys_to_virt(phys_addr);
- } else {
- iomem = 1;
- virt_addr = ioremap(phys_addr, width);
- }
- } else
- virt_addr = (void __iomem *)phys_to_virt(phys_addr);
+ virt_addr = ioremap(phys_addr, width);
switch (width) {
case 8:
@@ -477,8 +444,7 @@ acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width)
BUG();
}
- if (iomem)
- iounmap(virt_addr);
+ iounmap(virt_addr);
return AE_OK;
}
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 99a3a28594d..713b763884a 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -246,7 +246,7 @@ static int acpi_processor_errata(struct acpi_processor *pr)
}
/* --------------------------------------------------------------------------
- Common ACPI processor fucntions
+ Common ACPI processor functions
-------------------------------------------------------------------------- */
/*
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index eb730a80952..80fa43471f4 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -878,12 +878,9 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
unsigned int working = 0;
#ifdef ARCH_APICTIMER_STOPS_ON_C3
- struct cpuinfo_x86 *c = cpu_data + pr->id;
+ int timer_broadcast = 0;
cpumask_t mask = cpumask_of_cpu(pr->id);
-
- if (c->x86_vendor == X86_VENDOR_INTEL) {
- on_each_cpu(switch_ipi_to_APIC_timer, &mask, 1, 1);
- }
+ on_each_cpu(switch_ipi_to_APIC_timer, &mask, 1, 1);
#endif
for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) {
@@ -896,15 +893,20 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
case ACPI_STATE_C2:
acpi_processor_power_verify_c2(cx);
+#ifdef ARCH_APICTIMER_STOPS_ON_C3
+ /* Some AMD systems fake C3 as C2, but still
+ have timer troubles */
+ if (cx->valid &&
+ boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
+ timer_broadcast++;
+#endif
break;
case ACPI_STATE_C3:
acpi_processor_power_verify_c3(pr, cx);
#ifdef ARCH_APICTIMER_STOPS_ON_C3
- if (cx->valid && c->x86_vendor == X86_VENDOR_INTEL) {
- on_each_cpu(switch_APIC_timer_to_ipi,
- &mask, 1, 1);
- }
+ if (cx->valid)
+ timer_broadcast++;
#endif
break;
}
@@ -913,6 +915,11 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
working++;
}
+#ifdef ARCH_APICTIMER_STOPS_ON_C3
+ if (timer_broadcast)
+ on_each_cpu(switch_APIC_timer_to_ipi, &mask, 1, 1);
+#endif
+
return (working);
}
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index 31d4f3ffc26..7f37c7cc5ef 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -587,7 +587,8 @@ int __init acpi_table_init(void)
return -ENODEV;
}
- rsdp = (struct acpi_table_rsdp *)__va(rsdp_phys);
+ rsdp = (struct acpi_table_rsdp *)__acpi_map_table(rsdp_phys,
+ sizeof(struct acpi_table_rsdp));
if (!rsdp) {
printk(KERN_WARNING PREFIX "Unable to map RSDP\n");
return -ENODEV;