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)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 24 Oct 2019 21:22:33 +0000 (23:22 +0200)
commit918c1fe9fbbe46fcf56837ff21f0ef96424e8b29
tree1379838ce6818072eff03abe646081f37b1b97ef
parent2c2a83d329b89c74063580bad95bcb595dc09535
cpuidle: Do not unset the driver if it is there already

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>
drivers/cpuidle/driver.c