From f4c9a4a1f9c87a103b811efb15c6fdda9a9e17fc Mon Sep 17 00:00:00 2001 From: Junjie Wu Date: Tue, 17 Nov 2015 11:36:00 -0800 Subject: qcom: core_ctl_helper: Add wrapper for CPU hotplug Different kernel version needs to use different kernel APIs for hotplug. Add wrapper for CPU hotplug so that external module can be used across different kernel releases. Use device_online/offline() API for CPU hotplug. Change-Id: Id21855f4ddc62bc9e9e6b45a856c245fd18d1514 Signed-off-by: Junjie Wu --- drivers/soc/qcom/core_ctl_helper.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'drivers/soc') diff --git a/drivers/soc/qcom/core_ctl_helper.c b/drivers/soc/qcom/core_ctl_helper.c index 3b25d9811cf7..7f674229f1f8 100644 --- a/drivers/soc/qcom/core_ctl_helper.c +++ b/drivers/soc/qcom/core_ctl_helper.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -57,6 +57,22 @@ EXPORT_SYMBOL(core_ctl_find_cpu_device); int __ref core_ctl_online_core(unsigned int cpu) { - return cpu_up(cpu); + int ret; + + lock_device_hotplug(); + ret = device_online(get_cpu_device(cpu)); + unlock_device_hotplug(); + return ret; } EXPORT_SYMBOL(core_ctl_online_core); + +int __ref core_ctl_offline_core(unsigned int cpu) +{ + int ret; + + lock_device_hotplug(); + ret = device_offline(get_cpu_device(cpu)); + unlock_device_hotplug(); + return ret; +} +EXPORT_SYMBOL(core_ctl_offline_core); -- cgit v1.2.3