Commit 65a4f3a1 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branches 'acpi-pci', 'acpi-power' and 'acpi-misc'

* acpi-pci:
  ACPI: Fix build failure when CONFIG_NLS is set to 'n'

* acpi-power:
  ACPI: power: Skip duplicate power resource references in _PRx

* acpi-misc:
  ACPI: NUMA: Use correct type for printing addresses on i386-PAE
...@@ -10,6 +10,7 @@ menuconfig ACPI ...@@ -10,6 +10,7 @@ menuconfig ACPI
bool "ACPI (Advanced Configuration and Power Interface) Support" bool "ACPI (Advanced Configuration and Power Interface) Support"
depends on ARCH_SUPPORTS_ACPI depends on ARCH_SUPPORTS_ACPI
select PNP select PNP
select NLS
default y if X86 default y if X86
help help
Advanced Configuration and Power Interface (ACPI) support for Advanced Configuration and Power Interface (ACPI) support for
......
...@@ -146,9 +146,9 @@ acpi_table_print_srat_entry(struct acpi_subtable_header *header) ...@@ -146,9 +146,9 @@ acpi_table_print_srat_entry(struct acpi_subtable_header *header)
{ {
struct acpi_srat_mem_affinity *p = struct acpi_srat_mem_affinity *p =
(struct acpi_srat_mem_affinity *)header; (struct acpi_srat_mem_affinity *)header;
pr_debug("SRAT Memory (0x%lx length 0x%lx) in proximity domain %d %s%s%s\n", pr_debug("SRAT Memory (0x%llx length 0x%llx) in proximity domain %d %s%s%s\n",
(unsigned long)p->base_address, (unsigned long long)p->base_address,
(unsigned long)p->length, (unsigned long long)p->length,
p->proximity_domain, p->proximity_domain,
(p->flags & ACPI_SRAT_MEM_ENABLED) ? (p->flags & ACPI_SRAT_MEM_ENABLED) ?
"enabled" : "disabled", "enabled" : "disabled",
......
...@@ -131,6 +131,23 @@ void acpi_power_resources_list_free(struct list_head *list) ...@@ -131,6 +131,23 @@ void acpi_power_resources_list_free(struct list_head *list)
} }
} }
static bool acpi_power_resource_is_dup(union acpi_object *package,
unsigned int start, unsigned int i)
{
acpi_handle rhandle, dup;
unsigned int j;
/* The caller is expected to check the package element types */
rhandle = package->package.elements[i].reference.handle;
for (j = start; j < i; j++) {
dup = package->package.elements[j].reference.handle;
if (dup == rhandle)
return true;
}
return false;
}
int acpi_extract_power_resources(union acpi_object *package, unsigned int start, int acpi_extract_power_resources(union acpi_object *package, unsigned int start,
struct list_head *list) struct list_head *list)
{ {
...@@ -150,6 +167,11 @@ int acpi_extract_power_resources(union acpi_object *package, unsigned int start, ...@@ -150,6 +167,11 @@ int acpi_extract_power_resources(union acpi_object *package, unsigned int start,
err = -ENODEV; err = -ENODEV;
break; break;
} }
/* Some ACPI tables contain duplicate power resource references */
if (acpi_power_resource_is_dup(package, start, i))
continue;
err = acpi_add_power_resource(rhandle); err = acpi_add_power_resource(rhandle);
if (err) if (err)
break; break;
......
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