]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'master' into linux-next
authorRafael J. Wysocki <rjw@sisk.pl>
Tue, 25 Sep 2012 20:03:13 +0000 (22:03 +0200)
committerRafael J. Wysocki <rjw@sisk.pl>
Tue, 25 Sep 2012 20:03:13 +0000 (22:03 +0200)
* master: (76 commits)
  Revert "PM QoS: Use spinlock in the per-device PM QoS constraints code"
  PM / Runtime: let rpm_resume() succeed if RPM_ACTIVE, even when disabled, v2
  cpuidle: rename function name "__cpuidle_register_driver", v2
  cpufreq: OMAP: Check IS_ERR() instead of NULL for omap_device_get_by_hwmod_name
  cpuidle: remove some empty lines
  PM: Prevent runtime suspend during system resume
  PM QoS: Use spinlock in the per-device PM QoS constraints code
  PM / Sleep: use resume event when call dpm_resume_early
  cpuidle / ACPI : move cpuidle_device field out of the acpi_processor_power structure
  ACPI / processor: remove pointless variable initialization
  ACPI / processor: remove unused function parameter
  cpufreq: OMAP: remove loops_per_jiffy recalculate for smp
  sections: fix section conflicts in drivers/cpufreq
  cpufreq: conservative: update frequency when limits are relaxed
  cpufreq / ondemand: update frequency when limits are relaxed
  properly __init-annotate pm_sysrq_init()
  cpufreq: Add a generic cpufreq-cpu0 driver
  PM / OPP: Initialize OPP table from device tree
  ARM: add cpufreq transiton notifier to adjust loops_per_jiffy for smp
  cpufreq: Remove support for hardware P-state chips from powernow-k8
  ...

Conflicts:
drivers/cpufreq/powernow-k8.c

1  2 
drivers/cpufreq/powernow-k8.c
kernel/time/timekeeping.c

index 1a40935c85fdcc1f21e976ad8dbd5298a87d6060,0b19faf002eeb30d44c28e56b57a8a907814989d..129e80bfff22e1d399fbe5320012f5721de1bcaf
@@@ -1104,52 -978,11 +977,18 @@@ static int transition_frequency_fidvid(
        return res;
  }
  
- /* Take a frequency, and issue the hardware pstate transition command */
- static int transition_frequency_pstate(struct powernow_k8_data *data,
-               unsigned int index)
- {
-       u32 pstate = 0;
-       int res, i;
-       struct cpufreq_freqs freqs;
-       pr_debug("cpu %d transition to index %u\n", smp_processor_id(), index);
-       /* get MSR index for hardware pstate transition */
-       pstate = index & HW_PSTATE_MASK;
-       if (pstate > data->max_hw_pstate)
-               return -EINVAL;
-       freqs.old = find_khz_freq_from_pstate(data->powernow_table,
-                       data->currpstate);
-       freqs.new = find_khz_freq_from_pstate(data->powernow_table, pstate);
-       for_each_cpu(i, data->available_cores) {
-               freqs.cpu = i;
-               cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
-       }
-       res = transition_pstate(data, pstate);
-       freqs.new = find_khz_freq_from_pstate(data->powernow_table, pstate);
-       for_each_cpu(i, data->available_cores) {
-               freqs.cpu = i;
-               cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
-       }
-       return res;
- }
 -/* Driver entry point to switch to the target frequency */
 -static int powernowk8_target(struct cpufreq_policy *pol,
 -              unsigned targfreq, unsigned relation)
 +struct powernowk8_target_arg {
 +      struct cpufreq_policy           *pol;
 +      unsigned                        targfreq;
 +      unsigned                        relation;
 +};
 +
 +static long powernowk8_target_fn(void *arg)
  {
 -      cpumask_var_t oldmask;
 +      struct powernowk8_target_arg *pta = arg;
 +      struct cpufreq_policy *pol = pta->pol;
 +      unsigned targfreq = pta->targfreq;
 +      unsigned relation = pta->relation;
        struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu);
        u32 checkfid;
        u32 checkvid;
                pol->cpu, targfreq, pol->min, pol->max, relation);
  
        if (query_current_values_with_pending_wait(data))
 -              goto err_out;
 +              return -EIO;
  
-       if (cpu_family != CPU_HW_PSTATE) {
-               pr_debug("targ: curr fid 0x%x, vid 0x%x\n",
-               data->currfid, data->currvid);
+       pr_debug("targ: curr fid 0x%x, vid 0x%x\n",
+                data->currfid, data->currvid);
  
-               if ((checkvid != data->currvid) ||
-                   (checkfid != data->currfid)) {
-                       printk(KERN_INFO PFX
-                               "error - out of sync, fix 0x%x 0x%x, "
-                               "vid 0x%x 0x%x\n",
-                               checkfid, data->currfid,
-                               checkvid, data->currvid);
-               }
+       if ((checkvid != data->currvid) ||
+           (checkfid != data->currfid)) {
+               pr_info(PFX
+                      "error - out of sync, fix 0x%x 0x%x, vid 0x%x 0x%x\n",
+                      checkfid, data->currfid,
+                      checkvid, data->currvid);
        }
  
        if (cpufreq_frequency_table_target(pol, data->powernow_table,
  
        powernow_k8_acpi_pst_values(data, newstate);
  
-       if (cpu_family == CPU_HW_PSTATE)
-               ret = transition_frequency_pstate(data,
-                       data->powernow_table[newstate].index);
-       else
-               ret = transition_frequency_fidvid(data, newstate);
+       ret = transition_frequency_fidvid(data, newstate);
        if (ret) {
                printk(KERN_ERR PFX "transition frequency failed\n");
 -              ret = 1;
                mutex_unlock(&fidvid_mutex);
 -              goto err_out;
 +              return 1;
        }
        mutex_unlock(&fidvid_mutex);
  
-       if (cpu_family == CPU_HW_PSTATE)
-               pol->cur = find_khz_freq_from_pstate(data->powernow_table,
-                               data->powernow_table[newstate].index);
-       else
-               pol->cur = find_khz_freq_from_fid(data->currfid);
+       pol->cur = find_khz_freq_from_fid(data->currfid);
 -      ret = 0;
  
 -err_out:
 -      set_cpus_allowed_ptr(current, oldmask);
 -      free_cpumask_var(oldmask);
 -      return ret;
 +      return 0;
 +}
 +
 +/* Driver entry point to switch to the target frequency */
 +static int powernowk8_target(struct cpufreq_policy *pol,
 +              unsigned targfreq, unsigned relation)
 +{
 +      struct powernowk8_target_arg pta = { .pol = pol, .targfreq = targfreq,
 +                                           .relation = relation };
 +
 +      /*
 +       * Must run on @pol->cpu.  cpufreq core is responsible for ensuring
 +       * that we're bound to the current CPU and pol->cpu stays online.
 +       */
 +      if (smp_processor_id() == pol->cpu)
 +              return powernowk8_target_fn(&pta);
 +      else
 +              return work_on_cpu(pol->cpu, powernowk8_target_fn, &pta);
  }
  
  /* Driver entry point to verify the policy and range of frequencies */
Simple merge