|
@@ -909,6 +909,13 @@ static long __acpi_processor_get_throttling(void *data)
|
|
|
return pr->throttling.acpi_processor_get_throttling(pr);
|
|
|
}
|
|
|
|
|
|
+static int call_on_cpu(int cpu, long (*fn)(void *), void *arg, bool direct)
|
|
|
+{
|
|
|
+ if (direct || (is_percpu_thread() && cpu == smp_processor_id()))
|
|
|
+ return fn(arg);
|
|
|
+ return work_on_cpu(cpu, fn, arg);
|
|
|
+}
|
|
|
+
|
|
|
static int acpi_processor_get_throttling(struct acpi_processor *pr)
|
|
|
{
|
|
|
if (!pr)
|
|
@@ -926,7 +933,7 @@ static int acpi_processor_get_throttling(struct acpi_processor *pr)
|
|
|
if (!cpu_online(pr->id))
|
|
|
return -ENODEV;
|
|
|
|
|
|
- return work_on_cpu(pr->id, __acpi_processor_get_throttling, pr);
|
|
|
+ return call_on_cpu(pr->id, __acpi_processor_get_throttling, pr, false);
|
|
|
}
|
|
|
|
|
|
static int acpi_processor_get_fadt_info(struct acpi_processor *pr)
|
|
@@ -1076,13 +1083,6 @@ static long acpi_processor_throttling_fn(void *data)
|
|
|
arg->target_state, arg->force);
|
|
|
}
|
|
|
|
|
|
-static int call_on_cpu(int cpu, long (*fn)(void *), void *arg, bool direct)
|
|
|
-{
|
|
|
- if (direct)
|
|
|
- return fn(arg);
|
|
|
- return work_on_cpu(cpu, fn, arg);
|
|
|
-}
|
|
|
-
|
|
|
static int __acpi_processor_set_throttling(struct acpi_processor *pr,
|
|
|
int state, bool force, bool direct)
|
|
|
{
|