policy->max = policy->cpuinfo.max_freq;
        }
   
 -      if (cpu->policy == CPUFREQ_POLICY_PERFORMANCE) {
 -              limits = &performance_limits;
 -              if (policy->max >= policy->cpuinfo.max_freq) {
 +      if (per_cpu_limits)
 +              perf_limits = cpu->perf_limits;
 + 
 +      mutex_lock(&intel_pstate_limits_lock);
 + 
 +      if (policy->policy == CPUFREQ_POLICY_PERFORMANCE) {
 +              if (!perf_limits) {
 +                      limits = &performance_limits;
 +                      perf_limits = limits;
 +              }
-               if (policy->max >= policy->cpuinfo.max_freq) {
++              if (policy->max >= policy->cpuinfo.max_freq &&
++                  !limits->no_turbo) {
                        pr_debug("set performance\n");
 -                      intel_pstate_set_performance_limits(limits);
 +                      intel_pstate_set_performance_limits(perf_limits);
                        goto out;
                }
        } else {