Commit cc31e9b7 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branch 'acpi-cppc'

* acpi-cppc:
  ACPI / CPPC: Fix per-CPU pointer management in acpi_cppc_processor_probe()
  ACPI / CPPC: Fix crash in acpi_cppc_processor_exit()
parents a67485d4 28076483
...@@ -776,9 +776,6 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr) ...@@ -776,9 +776,6 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
init_waitqueue_head(&pcc_data.pcc_write_wait_q); init_waitqueue_head(&pcc_data.pcc_write_wait_q);
} }
/* Plug PSD data into this CPUs CPC descriptor. */
per_cpu(cpc_desc_ptr, pr->id) = cpc_ptr;
/* Everything looks okay */ /* Everything looks okay */
pr_debug("Parsed CPC struct for CPU: %d\n", pr->id); pr_debug("Parsed CPC struct for CPU: %d\n", pr->id);
...@@ -789,10 +786,15 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr) ...@@ -789,10 +786,15 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
goto out_free; goto out_free;
} }
/* Plug PSD data into this CPUs CPC descriptor. */
per_cpu(cpc_desc_ptr, pr->id) = cpc_ptr;
ret = kobject_init_and_add(&cpc_ptr->kobj, &cppc_ktype, &cpu_dev->kobj, ret = kobject_init_and_add(&cpc_ptr->kobj, &cppc_ktype, &cpu_dev->kobj,
"acpi_cppc"); "acpi_cppc");
if (ret) if (ret) {
per_cpu(cpc_desc_ptr, pr->id) = NULL;
goto out_free; goto out_free;
}
kfree(output.pointer); kfree(output.pointer);
return 0; return 0;
...@@ -826,6 +828,8 @@ void acpi_cppc_processor_exit(struct acpi_processor *pr) ...@@ -826,6 +828,8 @@ void acpi_cppc_processor_exit(struct acpi_processor *pr)
void __iomem *addr; void __iomem *addr;
cpc_ptr = per_cpu(cpc_desc_ptr, pr->id); cpc_ptr = per_cpu(cpc_desc_ptr, pr->id);
if (!cpc_ptr)
return;
/* Free all the mapped sys mem areas for this CPU */ /* Free all the mapped sys mem areas for this CPU */
for (i = 2; i < cpc_ptr->num_entries; i++) { for (i = 2; i < cpc_ptr->num_entries; i++) {
......
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