From a462a4f47a321d3be20ecbc712f85eef2abc255c Mon Sep 17 00:00:00 2001 From: Jianxin Pan Date: Wed, 12 Apr 2017 17:03:53 +0800 Subject: [PATCH] hotplug: add cpu hotplug support for m8b PD#141217: add cpu hotplug support for m8b 1) enable CONFIG_AMLOGIC_CPU_HOTPLUG 2) clusterID of M8b is 2 Change-Id: I8f6dc6ced430364beb5eb82f20cb7034eb714eb0 Signed-off-by: Jianxin Pan --- arch/arm/configs/meson32_defconfig | 1 + drivers/amlogic/cpu_hotplug/cpu_hotplug.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/arm/configs/meson32_defconfig b/arch/arm/configs/meson32_defconfig index b623088be77c..3fc5e00cd1be 100644 --- a/arch/arm/configs/meson32_defconfig +++ b/arch/arm/configs/meson32_defconfig @@ -56,6 +56,7 @@ CONFIG_AMLOGIC_CLK=y CONFIG_AMLOGIC_M8B_CLK=y CONFIG_AMLOGIC_CRYPTO=y CONFIG_AMLOGIC_CRYPTO_BLKMV=y +CONFIG_AMLOGIC_CPU_HOTPLUG=y CONFIG_AMLOGIC_MMC=y CONFIG_AMLOGIC_M8B_MMC=y CONFIG_DEVTMPFS=y diff --git a/drivers/amlogic/cpu_hotplug/cpu_hotplug.c b/drivers/amlogic/cpu_hotplug/cpu_hotplug.c index a92b90b46974..c8cb0d9b75ec 100644 --- a/drivers/amlogic/cpu_hotplug/cpu_hotplug.c +++ b/drivers/amlogic/cpu_hotplug/cpu_hotplug.c @@ -62,12 +62,13 @@ int cpu_hotplug_cpumask_init(void) for (cpu = 0; cpu < num_possible_cpus(); cpu++) { clstr = topology_physical_package_id(cpu); - if (clstr >= 0 && clstr < MAX_CLUSTRS) { - cpumask_set_cpu(cpu, &hpg.cpumask[clstr]); - if (hpg.clusters < clstr + 1) - hpg.clusters = clstr + 1; - hpg.cpunum[clstr]++; - } + if (clstr < 0) + continue; + clstr &= (MAX_CLUSTRS - 1); + cpumask_set_cpu(cpu, &hpg.cpumask[clstr]); + if (hpg.clusters < clstr + 1) + hpg.clusters = clstr + 1; + hpg.cpunum[clstr]++; } return 0; } @@ -301,9 +302,8 @@ static int __init cpu_hotplug_init(void) mutex_unlock(&hpg.mutex); wake_up_process(hpg.hotplug_thread); - if (cpufreq_global_kobject) - err = sysfs_create_file(cpufreq_global_kobject, - &hotplug_max_cpus.attr); + err = sysfs_create_file(&cpu_subsys.dev_root->kobj, + &hotplug_max_cpus.attr); return 0; }