ACPI / processor: Rework processor throttling with work_on_cpu()
authorLan Tianyu <tianyu.lan@intel.com>
Wed, 26 Feb 2014 13:03:05 +0000 (21:03 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Mar 2014 06:06:23 +0000 (22:06 -0800)
commit3d1fe6dc50ee5443e3a529a9b60b5aa1f5e3cc1e
tree9908959b1576993434eb970c4d2d9afb47931007
parent55cd2c655d5470a7caf1a7ac56371f44645ed70f
ACPI / processor: Rework processor throttling with work_on_cpu()

commit f3ca4164529b875374c410193bbbac0ee960895f upstream.

acpi_processor_set_throttling() uses set_cpus_allowed_ptr() to make
sure that the (struct acpi_processor)->acpi_processor_set_throttling()
callback will run on the right CPU.  However, the function may be
called from a worker thread already bound to a different CPU in which
case that won't work.

Make acpi_processor_set_throttling() use work_on_cpu() as appropriate
instead of abusing set_cpus_allowed_ptr().

Reported-and-tested-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
[rjw: Changelog]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/acpi/processor_throttling.c