OSDN Git Service

cpuidle: Do not unset the driver if it is there already
authorZhenzhong Duan <zhenzhong.duan@oracle.com>
Wed, 23 Oct 2019 01:57:14 +0000 (09:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Dec 2019 19:35:00 +0000 (20:35 +0100)
commitc96788214ed3eac541501365ce47ff5c3bad836d
tree6681dace5aec8e2be81dbbe32986158431391048
parentaedc1c75ff6affa30e37e7d1a3a48d6686eefe6f
cpuidle: Do not unset the driver if it is there already

commit 918c1fe9fbbe46fcf56837ff21f0ef96424e8b29 upstream.

Fix __cpuidle_set_driver() to check if any of the CPUs in the mask has
a driver different from drv already and, if so, return -EBUSY before
updating any cpuidle_drivers per-CPU pointers.

Fixes: 82467a5a885d ("cpuidle: simplify multiple driver support")
Cc: 3.11+ <stable@vger.kernel.org> # 3.11+
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
[ rjw: Subject & changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/cpuidle/driver.c