From: Rafael J. Wysocki Date: Tue, 28 Jul 2015 15:21:32 +0000 (+0200) Subject: Merge back earlier cpufreq material for v4.3. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c6e53c69ef463ba2749ba9ee9b3d9d7f97dab94a;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git Merge back earlier cpufreq material for v4.3. --- c6e53c69ef463ba2749ba9ee9b3d9d7f97dab94a diff --cc drivers/cpufreq/cpufreq.c index 7a3c30c4336f,febda462681c..46251e8d30f2 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@@ -1264,21 -1224,15 +1230,18 @@@ static int cpufreq_add_dev(struct devic pr_debug("adding CPU %u\n", cpu); - /* - * Only possible if 'cpu' wasn't physically present earlier and we are - * here from subsys_interface add callback. A hotplug notifier will - * follow and we will handle it like logical CPU hotplug then. For now, - * just create the sysfs link. - */ - if (cpu_is_offline(cpu)) - return add_cpu_dev_symlink(per_cpu(cpufreq_cpu_data, cpu), cpu); + if (cpu_is_offline(cpu)) { + /* + * Only possible if we are here from the subsys_interface add + * callback. A hotplug notifier will follow and we will handle + * it as CPU online then. For now, just create the sysfs link, + * unless there is no policy or the link is already present. + */ + policy = per_cpu(cpufreq_cpu_data, cpu); + return policy && !cpumask_test_and_set_cpu(cpu, policy->real_cpus) + ? add_cpu_dev_symlink(policy, cpu) : 0; + } - if (!down_read_trylock(&cpufreq_rwsem)) - return 0; - /* Check if this CPU already has a policy to manage it */ policy = per_cpu(cpufreq_cpu_data, cpu); if (policy && !policy_is_inactive(policy)) {