diff options
author | Dou Liyang <douly.fnst@cn.fujitsu.com> | 2017-03-03 03:02:27 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-03-11 08:41:20 -0500 |
commit | a77d6cd968497792e072b74dff45b891ba778ddb (patch) | |
tree | bb7b7f81de61a5d2eb988b72c6270c192a7fa08b /drivers/acpi/acpi_processor.c | |
parent | 8c8cb30f49b86333d8e036e1945cf1a78c03577e (diff) |
acpi/processor: Check for duplicate processor ids at hotplug time
The check for duplicate processor ids happens at boot time based on the
ACPI table contents, but the final sanity checks for a processor happen
at hotplug time.
At hotplug time, where the physical information is available, which might
differ from the ACPI table information, a check for duplicate processor
ids is missing.
Add it to the hotplug checks and rename the function so it better
reflects its purpose.
Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
Tested-by: Xiaolong Ye <xiaolong.ye@intel.com>
Cc: rjw@rjwysocki.net
Cc: linux-acpi@vger.kernel.org
Cc: guzheng1@huawei.com
Cc: izumi.taku@jp.fujitsu.com
Cc: lenb@kernel.org
Link: http://lkml.kernel.org/r/1488528147-2279-6-git-send-email-douly.fnst@cn.fujitsu.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/acpi/acpi_processor.c')
-rw-r--r-- | drivers/acpi/acpi_processor.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index 9a98d7e00200..0143135b3abe 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c | |||
@@ -280,6 +280,13 @@ static int acpi_processor_get_info(struct acpi_device *device) | |||
280 | pr->acpi_id = value; | 280 | pr->acpi_id = value; |
281 | } | 281 | } |
282 | 282 | ||
283 | if (acpi_duplicate_processor_id(pr->acpi_id)) { | ||
284 | dev_err(&device->dev, | ||
285 | "Failed to get unique processor _UID (0x%x)\n", | ||
286 | pr->acpi_id); | ||
287 | return -ENODEV; | ||
288 | } | ||
289 | |||
283 | pr->phys_id = acpi_get_phys_id(pr->handle, device_declaration, | 290 | pr->phys_id = acpi_get_phys_id(pr->handle, device_declaration, |
284 | pr->acpi_id); | 291 | pr->acpi_id); |
285 | if (invalid_phys_cpuid(pr->phys_id)) | 292 | if (invalid_phys_cpuid(pr->phys_id)) |
@@ -580,7 +587,7 @@ static struct acpi_scan_handler processor_container_handler = { | |||
580 | static int nr_unique_ids __initdata; | 587 | static int nr_unique_ids __initdata; |
581 | 588 | ||
582 | /* The number of the duplicate processor IDs */ | 589 | /* The number of the duplicate processor IDs */ |
583 | static int nr_duplicate_ids __initdata; | 590 | static int nr_duplicate_ids; |
584 | 591 | ||
585 | /* Used to store the unique processor IDs */ | 592 | /* Used to store the unique processor IDs */ |
586 | static int unique_processor_ids[] __initdata = { | 593 | static int unique_processor_ids[] __initdata = { |
@@ -588,7 +595,7 @@ static int unique_processor_ids[] __initdata = { | |||
588 | }; | 595 | }; |
589 | 596 | ||
590 | /* Used to store the duplicate processor IDs */ | 597 | /* Used to store the duplicate processor IDs */ |
591 | static int duplicate_processor_ids[] __initdata = { | 598 | static int duplicate_processor_ids[] = { |
592 | [0 ... NR_CPUS - 1] = -1, | 599 | [0 ... NR_CPUS - 1] = -1, |
593 | }; | 600 | }; |
594 | 601 | ||
@@ -679,7 +686,7 @@ void __init acpi_processor_check_duplicates(void) | |||
679 | NULL, NULL); | 686 | NULL, NULL); |
680 | } | 687 | } |
681 | 688 | ||
682 | bool __init acpi_processor_validate_proc_id(int proc_id) | 689 | bool acpi_duplicate_processor_id(int proc_id) |
683 | { | 690 | { |
684 | int i; | 691 | int i; |
685 | 692 | ||