Skip to content

Commit c705c78

Browse files
committed
acpi: Export the acpi_processor_get_performance_info
The git commit d5aaffa (cpufreq: handle cpufreq being disabled for all exported function) tightens the cpufreq API by returning errors when disable_cpufreq() had been called. The problem we are hitting is that the module xen-acpi-processor which uses the ACPI's functions: acpi_processor_register_performance, acpi_processor_preregister_performance, and acpi_processor_notify_smm fails at acpi_processor_register_performance with -22. Note that earlier during bootup in arch/x86/xen/setup.c there is also an call to cpufreq's API: disable_cpufreq(). This is b/c we want the Linux kernel to parse the ACPI data, but leave the cpufreq decisions to the hypervisor. In v3.9 all the checks that d5aaffa added are now hit and the calls to cpufreq_register_notifier will now fail. This means that acpi_processor_ppc_init ends up printing: "Warning: Processor Platform Limit not supported" and the acpi_processor_ppc_status is not set. The repercussions of that is that the call to acpi_processor_register_performance fails right away at: if (!(acpi_processor_ppc_status & PPC_REGISTERED)) and we don't progress any further on parsing and extracting the _P* objects. The only reason the Xen code called that function was b/c it was exported and the only way to gather the P-states. But we can also just make acpi_processor_get_performance_info be exported and not use acpi_processor_register_performance. This patch does so. Acked-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Konrad Rzeszutek Wilk <[email protected]>
1 parent bdc5c18 commit c705c78

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

drivers/acpi/processor_perflib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
465465
return result;
466466
}
467467

468-
static int acpi_processor_get_performance_info(struct acpi_processor *pr)
468+
int acpi_processor_get_performance_info(struct acpi_processor *pr)
469469
{
470470
int result = 0;
471471
acpi_status status = AE_OK;
@@ -509,7 +509,7 @@ static int acpi_processor_get_performance_info(struct acpi_processor *pr)
509509
#endif
510510
return result;
511511
}
512-
512+
EXPORT_SYMBOL_GPL(acpi_processor_get_performance_info);
513513
int acpi_processor_notify_smm(struct module *calling_module)
514514
{
515515
acpi_status status;

drivers/xen/xen-acpi-processor.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -500,16 +500,16 @@ static int __init xen_acpi_processor_init(void)
500500
(void)acpi_processor_preregister_performance(acpi_perf_data);
501501

502502
for_each_possible_cpu(i) {
503+
struct acpi_processor *pr;
503504
struct acpi_processor_performance *perf;
504505

506+
pr = per_cpu(processors, i);
505507
perf = per_cpu_ptr(acpi_perf_data, i);
506-
rc = acpi_processor_register_performance(perf, i);
508+
pr->performance = perf;
509+
rc = acpi_processor_get_performance_info(pr);
507510
if (rc)
508511
goto err_out;
509512
}
510-
rc = acpi_processor_notify_smm(THIS_MODULE);
511-
if (rc)
512-
goto err_unregister;
513513

514514
for_each_possible_cpu(i) {
515515
struct acpi_processor *_pr;

include/acpi/processor.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,9 @@ extern void acpi_processor_unregister_performance(struct
235235
if a _PPC object exists, rmmod is disallowed then */
236236
int acpi_processor_notify_smm(struct module *calling_module);
237237

238+
/* parsing the _P* objects. */
239+
extern int acpi_processor_get_performance_info(struct acpi_processor *pr);
240+
238241
/* for communication between multiple parts of the processor kernel module */
239242
DECLARE_PER_CPU(struct acpi_processor *, processors);
240243
extern struct acpi_processor_errata errata;

0 commit comments

Comments
 (0)