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>
Sat, 21 Dec 2019 09:35:27 +0000 (10:35 +0100)
commit9c319a2d2027dc51d4583061cb9a25682000be4a
tree787b93aff7909429435f1ad2e8a571b5e1f7b1d3
parent0688a490fa9530c25c61b13692578b7c3bd36b39
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