Merge back earlier cpufreq material for v4.3.
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 28 Jul 2015 15:21:32 +0000 (17:21 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 28 Jul 2015 15:21:32 +0000 (17:21 +0200)
1  2 
drivers/cpufreq/cpufreq.c
drivers/cpufreq/intel_pstate.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)) {
Simple merge