Revert "cpufreq: Notify all policy->cpus in cpufreq_notify_transition()"
Dan Willemsen [Tue, 20 Aug 2013 04:42:38 +0000 (21:42 -0700)]
This reverts commit b43a7ffbf33be7e4d3b10b7714ee663ea2c52fe2.

Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com>

50 files changed:
arch/arm/mach-s3c24xx/cpufreq.c
arch/arm/mach-tegra/cpu-tegra.c
arch/powerpc/platforms/pasemi/cpufreq.c
arch/powerpc/platforms/powermac/cpufreq_32.c
arch/powerpc/platforms/powermac/cpufreq_64.c
drivers/cpufreq/acpi-cpufreq.c
drivers/cpufreq/at32ap-cpufreq.c
drivers/cpufreq/blackfin-cpufreq.c
drivers/cpufreq/cpufreq-cpu0.c
drivers/cpufreq/cpufreq-nforce2.c
drivers/cpufreq/cpufreq.c
drivers/cpufreq/cris-artpec3-cpufreq.c
drivers/cpufreq/cris-etraxfs-cpufreq.c
drivers/cpufreq/davinci-cpufreq.c
drivers/cpufreq/dbx500-cpufreq.c
drivers/cpufreq/e_powersaver.c
drivers/cpufreq/elanfreq.c
drivers/cpufreq/exynos-cpufreq.c
drivers/cpufreq/gx-suspmod.c
drivers/cpufreq/ia64-acpi-cpufreq.c
drivers/cpufreq/imx6q-cpufreq.c
drivers/cpufreq/integrator-cpufreq.c
drivers/cpufreq/kirkwood-cpufreq.c
drivers/cpufreq/longhaul.c
drivers/cpufreq/loongson2_cpufreq.c
drivers/cpufreq/maple-cpufreq.c
drivers/cpufreq/omap-cpufreq.c
drivers/cpufreq/p4-clockmod.c
drivers/cpufreq/pcc-cpufreq.c
drivers/cpufreq/powernow-k6.c
drivers/cpufreq/powernow-k7.c
drivers/cpufreq/powernow-k8.c
drivers/cpufreq/ppc_cbe_cpufreq.c
drivers/cpufreq/pxa2xx-cpufreq.c
drivers/cpufreq/pxa3xx-cpufreq.c
drivers/cpufreq/s3c2416-cpufreq.c
drivers/cpufreq/s3c64xx-cpufreq.c
drivers/cpufreq/s5pv210-cpufreq.c
drivers/cpufreq/sa1100-cpufreq.c
drivers/cpufreq/sa1110-cpufreq.c
drivers/cpufreq/sc520_freq.c
drivers/cpufreq/sh-cpufreq.c
drivers/cpufreq/sparc-us2e-cpufreq.c
drivers/cpufreq/sparc-us3-cpufreq.c
drivers/cpufreq/spear-cpufreq.c
drivers/cpufreq/speedstep-centrino.c
drivers/cpufreq/speedstep-ich.c
drivers/cpufreq/speedstep-smi.c
drivers/cpufreq/unicore2-cpufreq.c
include/linux/cpufreq.h

index 3c0e78e..5f181e7 100644 (file)
@@ -204,6 +204,7 @@ static int s3c_cpufreq_settarget(struct cpufreq_policy *policy,
        freqs.old = cpu_cur.freq;
        freqs.new = cpu_new.freq;
 
+       freqs.freqs.cpu = 0;
        freqs.freqs.old = cpu_cur.freq.armclk / 1000;
        freqs.freqs.new = cpu_new.freq.armclk / 1000;
 
@@ -217,7 +218,9 @@ static int s3c_cpufreq_settarget(struct cpufreq_policy *policy,
        s3c_cpufreq_updateclk(clk_pclk, cpu_new.freq.pclk);
 
        /* start the frequency change */
-       cpufreq_notify_transition(policy, &freqs.freqs, CPUFREQ_PRECHANGE);
+
+       if (policy)
+               cpufreq_notify_transition(&freqs.freqs, CPUFREQ_PRECHANGE);
 
        /* If hclk is staying the same, then we do not need to
         * re-write the IO or the refresh timings whilst we are changing
@@ -261,7 +264,8 @@ static int s3c_cpufreq_settarget(struct cpufreq_policy *policy,
        local_irq_restore(flags);
 
        /* notify everyone we've done this */
-       cpufreq_notify_transition(policy, &freqs.freqs, CPUFREQ_POSTCHANGE);
+       if (policy)
+               cpufreq_notify_transition(&freqs.freqs, CPUFREQ_POSTCHANGE);
 
        s3c_freq_dbg("%s: finished\n", __func__);
        return 0;
index 11ca730..e3d6e15 100644 (file)
@@ -106,8 +106,7 @@ out:
        return ret;
 }
 
-static int tegra_update_cpu_speed(struct cpufreq_policy *policy,
-               unsigned long rate)
+static int tegra_update_cpu_speed(unsigned long rate)
 {
        int ret = 0;
        struct cpufreq_freqs freqs;
@@ -129,7 +128,8 @@ static int tegra_update_cpu_speed(struct cpufreq_policy *policy,
        else
                clk_set_rate(emc_clk, 100000000);  /* emc 50Mhz */
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       for_each_online_cpu(freqs.cpu)
+               cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
 #ifdef CONFIG_CPU_FREQ_DEBUG
        printk(KERN_DEBUG "cpufreq-tegra: transition: %u --> %u\n",
@@ -143,7 +143,8 @@ static int tegra_update_cpu_speed(struct cpufreq_policy *policy,
                return ret;
        }
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       for_each_online_cpu(freqs.cpu)
+               cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        return 0;
 }
@@ -180,7 +181,7 @@ static int tegra_target(struct cpufreq_policy *policy,
 
        target_cpu_speed[policy->cpu] = freq;
 
-       ret = tegra_update_cpu_speed(policy, tegra_cpu_highest_speed());
+       ret = tegra_update_cpu_speed(tegra_cpu_highest_speed());
 
 out:
        mutex_unlock(&tegra_cpu_lock);
@@ -192,12 +193,10 @@ static int tegra_pm_notify(struct notifier_block *nb, unsigned long event,
 {
        mutex_lock(&tegra_cpu_lock);
        if (event == PM_SUSPEND_PREPARE) {
-               struct cpufreq_policy *policy = cpufreq_cpu_get(0);
                is_suspended = true;
                pr_info("Tegra cpufreq suspend: setting frequency to %d kHz\n",
                        freq_table[0].frequency);
-               tegra_update_cpu_speed(policy, freq_table[0].frequency);
-               cpufreq_cpu_put(policy);
+               tegra_update_cpu_speed(freq_table[0].frequency);
        } else if (event == PM_POST_SUSPEND) {
                is_suspended = false;
        }
index be1e795..890f30e 100644 (file)
@@ -273,9 +273,10 @@ static int pas_cpufreq_target(struct cpufreq_policy *policy,
 
        freqs.old = policy->cur;
        freqs.new = pas_freqs[pas_astate_new].frequency;
+       freqs.cpu = policy->cpu;
 
        mutex_lock(&pas_switch_mutex);
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        pr_debug("setting frequency for cpu %d to %d kHz, 1/%d of max frequency\n",
                 policy->cpu,
@@ -287,7 +288,7 @@ static int pas_cpufreq_target(struct cpufreq_policy *policy,
        for_each_online_cpu(i)
                set_astate(i, pas_astate_new);
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
        mutex_unlock(&pas_switch_mutex);
 
        ppc_proc_freq = freqs.new * 1000ul;
index 3104fad..311b804 100644 (file)
@@ -335,8 +335,7 @@ static int pmu_set_cpu_speed(int low_speed)
        return 0;
 }
 
-static int do_set_cpu_speed(struct cpufreq_policy *policy, int speed_mode,
-               int notify)
+static int do_set_cpu_speed(int speed_mode, int notify)
 {
        struct cpufreq_freqs freqs;
        unsigned long l3cr;
@@ -344,12 +343,13 @@ static int do_set_cpu_speed(struct cpufreq_policy *policy, int speed_mode,
 
        freqs.old = cur_freq;
        freqs.new = (speed_mode == CPUFREQ_HIGH) ? hi_freq : low_freq;
+       freqs.cpu = smp_processor_id();
 
        if (freqs.old == freqs.new)
                return 0;
 
        if (notify)
-               cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+               cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
        if (speed_mode == CPUFREQ_LOW &&
            cpu_has_feature(CPU_FTR_L3CR)) {
                l3cr = _get_L3CR();
@@ -366,7 +366,7 @@ static int do_set_cpu_speed(struct cpufreq_policy *policy, int speed_mode,
                        _set_L3CR(prev_l3cr);
        }
        if (notify)
-               cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+               cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
        cur_freq = (speed_mode == CPUFREQ_HIGH) ? hi_freq : low_freq;
 
        return 0;
@@ -393,7 +393,7 @@ static int pmac_cpufreq_target(     struct cpufreq_policy *policy,
                        target_freq, relation, &newstate))
                return -EINVAL;
 
-       rc = do_set_cpu_speed(policy, newstate, 1);
+       rc = do_set_cpu_speed(newstate, 1);
 
        ppc_proc_freq = cur_freq * 1000ul;
        return rc;
@@ -442,7 +442,7 @@ static int pmac_cpufreq_suspend(struct cpufreq_policy *policy)
        no_schedule = 1;
        sleep_freq = cur_freq;
        if (cur_freq == low_freq && !is_pmu_based)
-               do_set_cpu_speed(policy, CPUFREQ_HIGH, 0);
+               do_set_cpu_speed(CPUFREQ_HIGH, 0);
        return 0;
 }
 
@@ -458,7 +458,7 @@ static int pmac_cpufreq_resume(struct cpufreq_policy *policy)
         * is that we force a switch to whatever it was, which is
         * probably high speed due to our suspend() routine
         */
-       do_set_cpu_speed(policy, sleep_freq == low_freq ?
+       do_set_cpu_speed(sleep_freq == low_freq ?
                         CPUFREQ_LOW : CPUFREQ_HIGH, 0);
 
        ppc_proc_freq = cur_freq * 1000ul;
index 7ba4234..9650c60 100644 (file)
@@ -339,10 +339,11 @@ static int g5_cpufreq_target(struct cpufreq_policy *policy,
 
        freqs.old = g5_cpu_freqs[g5_pmode_cur].frequency;
        freqs.new = g5_cpu_freqs[newstate].frequency;
+       freqs.cpu = 0;
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
        rc = g5_switch_freq(newstate);
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        mutex_unlock(&g5_switch_mutex);
 
index edc089e..bb5939b 100644 (file)
@@ -423,6 +423,7 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
        struct drv_cmd cmd;
        unsigned int next_state = 0; /* Index into freq_table */
        unsigned int next_perf_state = 0; /* Index into perf table */
+       unsigned int i;
        int result = 0;
 
        pr_debug("acpi_cpufreq_target %d (%d)\n", target_freq, policy->cpu);
@@ -485,7 +486,10 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
 
        freqs.old = perf->states[perf->state].core_frequency * 1000;
        freqs.new = data->freq_table[next_state].frequency;
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       for_each_cpu(i, policy->cpus) {
+               freqs.cpu = i;
+               cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+       }
 
        drv_write(&cmd);
 
@@ -498,7 +502,10 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
                }
        }
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       for_each_cpu(i, policy->cpus) {
+               freqs.cpu = i;
+               cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+       }
        perf->state = next_perf_state;
 
 out:
index 6544887..18b7656 100644 (file)
@@ -61,6 +61,7 @@ static int at32_set_target(struct cpufreq_policy *policy,
 
        freqs.old = at32_get_speed(0);
        freqs.new = (freq + 500) / 1000;
+       freqs.cpu = 0;
        freqs.flags = 0;
 
        if (!ref_freq) {
@@ -68,7 +69,7 @@ static int at32_set_target(struct cpufreq_policy *policy,
                loops_per_jiffy_ref = boot_cpu_data.loops_per_jiffy;
        }
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
        if (freqs.old < freqs.new)
                boot_cpu_data.loops_per_jiffy = cpufreq_scale(
                                loops_per_jiffy_ref, ref_freq, freqs.new);
@@ -76,7 +77,7 @@ static int at32_set_target(struct cpufreq_policy *policy,
        if (freqs.new < freqs.old)
                boot_cpu_data.loops_per_jiffy = cpufreq_scale(
                                loops_per_jiffy_ref, ref_freq, freqs.new);
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        pr_debug("cpufreq: set frequency %lu Hz\n", freq);
 
index 995511e..d88bd31 100644 (file)
@@ -127,13 +127,13 @@ unsigned long cpu_set_cclk(int cpu, unsigned long new)
 }
 #endif
 
-static int bfin_target(struct cpufreq_policy *policy,
+static int bfin_target(struct cpufreq_policy *poli,
                        unsigned int target_freq, unsigned int relation)
 {
 #ifndef CONFIG_BF60x
        unsigned int plldiv;
 #endif
-       unsigned int index;
+       unsigned int index, cpu;
        unsigned long cclk_hz;
        struct cpufreq_freqs freqs;
        static unsigned long lpj_ref;
@@ -144,48 +144,59 @@ static int bfin_target(struct cpufreq_policy *policy,
        cycles_t cycles;
 #endif
 
-       if (cpufreq_frequency_table_target(policy, bfin_freq_table, target_freq,
-                               relation, &index))
-               return -EINVAL;
+       for_each_online_cpu(cpu) {
+               struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
 
-       cclk_hz = bfin_freq_table[index].frequency;
+               if (!policy)
+                       continue;
 
-       freqs.old = bfin_getfreq_khz(0);
-       freqs.new = cclk_hz;
+               if (cpufreq_frequency_table_target(policy, bfin_freq_table,
+                                target_freq, relation, &index))
+                       return -EINVAL;
 
-       pr_debug("cpufreq: changing cclk to %lu; target = %u, oldfreq = %u\n",
-                       cclk_hz, target_freq, freqs.old);
+               cclk_hz = bfin_freq_table[index].frequency;
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+               freqs.old = bfin_getfreq_khz(0);
+               freqs.new = cclk_hz;
+               freqs.cpu = cpu;
+
+               pr_debug("cpufreq: changing cclk to %lu; target = %u, oldfreq = %u\n",
+                        cclk_hz, target_freq, freqs.old);
+
+               cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+               if (cpu == CPUFREQ_CPU) {
 #ifndef CONFIG_BF60x
-       plldiv = (bfin_read_PLL_DIV() & SSEL) | dpm_state_table[index].csel;
-       bfin_write_PLL_DIV(plldiv);
+                       plldiv = (bfin_read_PLL_DIV() & SSEL) |
+                                               dpm_state_table[index].csel;
+                       bfin_write_PLL_DIV(plldiv);
 #else
-       ret = cpu_set_cclk(policy->cpu, freqs.new * 1000);
-       if (ret != 0) {
-               WARN_ONCE(ret, "cpufreq set freq failed %d\n", ret);
-               return ret;
-       }
+                       ret = cpu_set_cclk(cpu, freqs.new * 1000);
+                       if (ret != 0) {
+                               WARN_ONCE(ret, "cpufreq set freq failed %d\n", ret);
+                               break;
+                       }
 #endif
-       on_each_cpu(bfin_adjust_core_timer, &index, 1);
+                       on_each_cpu(bfin_adjust_core_timer, &index, 1);
 #if defined(CONFIG_CYCLES_CLOCKSOURCE)
-       cycles = get_cycles();
-       SSYNC();
-       cycles += 10; /* ~10 cycles we lose after get_cycles() */
-       __bfin_cycles_off += (cycles << __bfin_cycles_mod) - (cycles << index);
-       __bfin_cycles_mod = index;
+                       cycles = get_cycles();
+                       SSYNC();
+                       cycles += 10; /* ~10 cycles we lose after get_cycles() */
+                       __bfin_cycles_off +=
+                           (cycles << __bfin_cycles_mod) - (cycles << index);
+                       __bfin_cycles_mod = index;
 #endif
-       if (!lpj_ref_freq) {
-               lpj_ref = loops_per_jiffy;
-               lpj_ref_freq = freqs.old;
+                       if (!lpj_ref_freq) {
+                               lpj_ref = loops_per_jiffy;
+                               lpj_ref_freq = freqs.old;
+                       }
+                       if (freqs.new != freqs.old) {
+                               loops_per_jiffy = cpufreq_scale(lpj_ref,
+                                               lpj_ref_freq, freqs.new);
+                       }
+               }
+               /* TODO: just test case for cycles clock source, remove later */
+               cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
        }
-       if (freqs.new != freqs.old) {
-               loops_per_jiffy = cpufreq_scale(lpj_ref,
-                               lpj_ref_freq, freqs.new);
-       }
-
-       /* TODO: just test case for cycles clock source, remove later */
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
 
        pr_debug("cpufreq: done\n");
        return ret;
index ad1fde2..70f8aed 100644 (file)
@@ -46,7 +46,7 @@ static int cpu0_set_target(struct cpufreq_policy *policy,
        struct opp *opp;
        unsigned long volt = 0, volt_old = 0, tol = 0;
        long freq_Hz, freq_exact;
-       unsigned int index;
+       unsigned int index, cpu;
        int ret;
 
        ret = cpufreq_frequency_table_target(policy, freq_table, target_freq,
@@ -67,7 +67,10 @@ static int cpu0_set_target(struct cpufreq_policy *policy,
        if (freqs.old == freqs.new)
                return 0;
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       for_each_online_cpu(cpu) {
+               freqs.cpu = cpu;
+               cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+       }
 
        if (cpu_reg) {
                rcu_read_lock();
@@ -119,7 +122,10 @@ static int cpu0_set_target(struct cpufreq_policy *policy,
        }
 
 post_notify:
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       for_each_online_cpu(cpu) {
+               freqs.cpu = cpu;
+               cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+       }
 
        return ret;
 }
index af1542d..edce29a 100644 (file)
@@ -263,6 +263,7 @@ static int nforce2_target(struct cpufreq_policy *policy,
 
        freqs.old = nforce2_get(policy->cpu);
        freqs.new = target_fsb * fid * 100;
+       freqs.cpu = 0;          /* Only one CPU on nForce2 platforms */
 
        if (freqs.old == freqs.new)
                return 0;
@@ -270,7 +271,7 @@ static int nforce2_target(struct cpufreq_policy *policy,
        pr_debug("Old CPU frequency %d kHz, new %d kHz\n",
               freqs.old, freqs.new);
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        /* Disable IRQs */
        /* local_irq_save(flags); */
@@ -285,7 +286,7 @@ static int nforce2_target(struct cpufreq_policy *policy,
        /* Enable IRQs */
        /* local_irq_restore(flags); */
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        return 0;
 }
index 6485547..52836dc 100644 (file)
@@ -249,9 +249,19 @@ static inline void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci)
 #endif
 
 
-void __cpufreq_notify_transition(struct cpufreq_policy *policy,
-               struct cpufreq_freqs *freqs, unsigned int state)
+/**
+ * cpufreq_notify_transition - call notifier chain and adjust_jiffies
+ * on frequency transition.
+ *
+ * This function calls the transition notifiers and the "adjust_jiffies"
+ * function. It is called twice on all CPU frequency changes that have
+ * external effects.
+ */
+void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state)
 {
+       struct cpufreq_policy *policy;
+       unsigned long flags;
+
        BUG_ON(irqs_disabled());
 
        if (cpufreq_disabled())
@@ -261,6 +271,10 @@ void __cpufreq_notify_transition(struct cpufreq_policy *policy,
        pr_debug("notification %u of frequency transition to %u kHz\n",
                state, freqs->new);
 
+       read_lock_irqsave(&cpufreq_driver_lock, flags);
+       policy = per_cpu(cpufreq_cpu_data, freqs->cpu);
+       read_unlock_irqrestore(&cpufreq_driver_lock, flags);
+
        switch (state) {
 
        case CPUFREQ_PRECHANGE:
@@ -294,20 +308,6 @@ void __cpufreq_notify_transition(struct cpufreq_policy *policy,
                break;
        }
 }
-/**
- * cpufreq_notify_transition - call notifier chain and adjust_jiffies
- * on frequency transition.
- *
- * This function calls the transition notifiers and the "adjust_jiffies"
- * function. It is called twice on all CPU frequency changes that have
- * external effects.
- */
-void cpufreq_notify_transition(struct cpufreq_policy *policy,
-               struct cpufreq_freqs *freqs, unsigned int state)
-{
-       for_each_cpu(freqs->cpu, policy->cpus)
-               __cpufreq_notify_transition(policy, freqs, state);
-}
 EXPORT_SYMBOL_GPL(cpufreq_notify_transition);
 
 
@@ -1148,23 +1148,16 @@ static void handle_update(struct work_struct *work)
 static void cpufreq_out_of_sync(unsigned int cpu, unsigned int old_freq,
                                unsigned int new_freq)
 {
-       struct cpufreq_policy *policy;
        struct cpufreq_freqs freqs;
-       unsigned long flags;
-
 
        pr_debug("Warning: CPU frequency out of sync: cpufreq and timing "
               "core thinks of %u, is %u kHz.\n", old_freq, new_freq);
 
+       freqs.cpu = cpu;
        freqs.old = old_freq;
        freqs.new = new_freq;
-
-       read_lock_irqsave(&cpufreq_driver_lock, flags);
-       policy = per_cpu(cpufreq_cpu_data, cpu);
-       read_unlock_irqrestore(&cpufreq_driver_lock, flags);
-
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 }
 
 
index ee142c4..ee391ec 100644 (file)
@@ -27,17 +27,23 @@ static unsigned int cris_freq_get_cpu_frequency(unsigned int cpu)
        return clk_ctrl.pll ? 200000 : 6000;
 }
 
-static void cris_freq_set_cpu_state(struct cpufreq_policy *policy,
-               unsigned int state)
+static void cris_freq_set_cpu_state(unsigned int state)
 {
+       int i = 0;
        struct cpufreq_freqs freqs;
        reg_clkgen_rw_clk_ctrl clk_ctrl;
        clk_ctrl = REG_RD(clkgen, regi_clkgen, rw_clk_ctrl);
 
-       freqs.old = cris_freq_get_cpu_frequency(policy->cpu);
-       freqs.new = cris_freq_table[state].frequency;
+#ifdef CONFIG_SMP
+       for_each_present_cpu(i)
+#endif
+       {
+               freqs.old = cris_freq_get_cpu_frequency(i);
+               freqs.new = cris_freq_table[state].frequency;
+               freqs.cpu = i;
+       }
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        local_irq_disable();
 
@@ -51,7 +57,7 @@ static void cris_freq_set_cpu_state(struct cpufreq_policy *policy,
 
        local_irq_enable();
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 };
 
 static int cris_freq_verify(struct cpufreq_policy *policy)
@@ -69,7 +75,7 @@ static int cris_freq_target(struct cpufreq_policy *policy,
                        target_freq, relation, &newstate))
                return -EINVAL;
 
-       cris_freq_set_cpu_state(policy, newstate);
+       cris_freq_set_cpu_state(newstate);
 
        return 0;
 }
index 1295223..d92cf70 100644 (file)
@@ -27,17 +27,20 @@ static unsigned int cris_freq_get_cpu_frequency(unsigned int cpu)
        return clk_ctrl.pll ? 200000 : 6000;
 }
 
-static void cris_freq_set_cpu_state(struct cpufreq_policy *policy,
-               unsigned int state)
+static void cris_freq_set_cpu_state(unsigned int state)
 {
+       int i;
        struct cpufreq_freqs freqs;
        reg_config_rw_clk_ctrl clk_ctrl;
        clk_ctrl = REG_RD(config, regi_config, rw_clk_ctrl);
 
-       freqs.old = cris_freq_get_cpu_frequency(policy->cpu);
-       freqs.new = cris_freq_table[state].frequency;
+       for_each_possible_cpu(i) {
+               freqs.old = cris_freq_get_cpu_frequency(i);
+               freqs.new = cris_freq_table[state].frequency;
+               freqs.cpu = i;
+       }
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        local_irq_disable();
 
@@ -51,7 +54,7 @@ static void cris_freq_set_cpu_state(struct cpufreq_policy *policy,
 
        local_irq_enable();
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 };
 
 static int cris_freq_verify(struct cpufreq_policy *policy)
@@ -68,7 +71,7 @@ static int cris_freq_target(struct cpufreq_policy *policy,
            (policy, cris_freq_table, target_freq, relation, &newstate))
                return -EINVAL;
 
-       cris_freq_set_cpu_state(policy, newstate);
+       cris_freq_set_cpu_state(newstate);
 
        return 0;
 }
index c33c76c..f41e3ad 100644 (file)
@@ -79,6 +79,7 @@ static int davinci_target(struct cpufreq_policy *policy,
 
        freqs.old = davinci_getspeed(0);
        freqs.new = clk_round_rate(armclk, target_freq * 1000) / 1000;
+       freqs.cpu = 0;
 
        if (freqs.old == freqs.new)
                return ret;
@@ -90,7 +91,7 @@ static int davinci_target(struct cpufreq_policy *policy,
        if (ret)
                return -EINVAL;
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        /* if moving to higher frequency, up the voltage beforehand */
        if (pdata->set_voltage && freqs.new > freqs.old) {
@@ -114,7 +115,7 @@ static int davinci_target(struct cpufreq_policy *policy,
                pdata->set_voltage(idx);
 
 out:
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        return ret;
 }
index 6ec6539..74aaa6b 100644 (file)
@@ -49,7 +49,8 @@ static int dbx500_cpufreq_target(struct cpufreq_policy *policy,
                return 0;
 
        /* pre-change notification */
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       for_each_cpu(freqs.cpu, policy->cpus)
+               cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        /* update armss clk frequency */
        ret = clk_set_rate(armss_clk, freqs.new * 1000);
@@ -61,7 +62,8 @@ static int dbx500_cpufreq_target(struct cpufreq_policy *policy,
        }
 
        /* post change notification */
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       for_each_cpu(freqs.cpu, policy->cpus)
+               cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        return 0;
 }
index 37380fb..3fffbe6 100644 (file)
@@ -104,7 +104,7 @@ static unsigned int eps_get(unsigned int cpu)
 }
 
 static int eps_set_state(struct eps_cpu_data *centaur,
-                        struct cpufreq_policy *policy,
+                        unsigned int cpu,
                         u32 dest_state)
 {
        struct cpufreq_freqs freqs;
@@ -112,9 +112,10 @@ static int eps_set_state(struct eps_cpu_data *centaur,
        int err = 0;
        int i;
 
-       freqs.old = eps_get(policy->cpu);
+       freqs.old = eps_get(cpu);
        freqs.new = centaur->fsb * ((dest_state >> 8) & 0xff);
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       freqs.cpu = cpu;
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        /* Wait while CPU is busy */
        rdmsr(MSR_IA32_PERF_STATUS, lo, hi);
@@ -161,7 +162,7 @@ postchange:
                current_multiplier);
        }
 #endif
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
        return err;
 }
 
@@ -189,7 +190,7 @@ static int eps_target(struct cpufreq_policy *policy,
 
        /* Make frequency transition */
        dest_state = centaur->freq_table[newstate].index & 0xffff;
-       ret = eps_set_state(centaur, policy, dest_state);
+       ret = eps_set_state(centaur, cpu, dest_state);
        if (ret)
                printk(KERN_ERR "eps: Timeout!\n");
        return ret;
index 658d860..960671f 100644 (file)
@@ -117,15 +117,15 @@ static unsigned int elanfreq_get_cpu_frequency(unsigned int cpu)
  *     There is no return value.
  */
 
-static void elanfreq_set_cpu_state(struct cpufreq_policy *policy,
-               unsigned int state)
+static void elanfreq_set_cpu_state(unsigned int state)
 {
        struct cpufreq_freqs    freqs;
 
        freqs.old = elanfreq_get_cpu_frequency(0);
        freqs.new = elan_multiplier[state].clock;
+       freqs.cpu = 0; /* elanfreq.c is UP only driver */
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        printk(KERN_INFO "elanfreq: attempting to set frequency to %i kHz\n",
                        elan_multiplier[state].clock);
@@ -161,7 +161,7 @@ static void elanfreq_set_cpu_state(struct cpufreq_policy *policy,
        udelay(10000);
        local_irq_enable();
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 };
 
 
@@ -188,7 +188,7 @@ static int elanfreq_target(struct cpufreq_policy *policy,
                                target_freq, relation, &newstate))
                return -EINVAL;
 
-       elanfreq_set_cpu_state(policy, newstate);
+       elanfreq_set_cpu_state(newstate);
 
        return 0;
 }
index 475b4f6..ee75997 100644 (file)
@@ -70,6 +70,7 @@ static int exynos_cpufreq_scale(unsigned int target_freq)
 
        freqs.old = policy->cur;
        freqs.new = target_freq;
+       freqs.cpu = policy->cpu;
 
        if (freqs.new == freqs.old)
                goto out;
@@ -104,7 +105,8 @@ static int exynos_cpufreq_scale(unsigned int target_freq)
        }
        arm_volt = volt_table[index];
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       for_each_cpu(freqs.cpu, policy->cpus)
+               cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        /* When the new frequency is higher than current frequency */
        if ((freqs.new > freqs.old) && !safe_arm_volt) {
@@ -129,7 +131,8 @@ static int exynos_cpufreq_scale(unsigned int target_freq)
 
        exynos_info->set_freq(old_index, index);
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       for_each_cpu(freqs.cpu, policy->cpus)
+               cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        /* When the new frequency is lower than current frequency */
        if ((freqs.new < freqs.old) ||
index 3dfc99b..456bee0 100644 (file)
@@ -251,13 +251,14 @@ static unsigned int gx_validate_speed(unsigned int khz, u8 *on_duration,
  * set cpu speed in khz.
  **/
 
-static void gx_set_cpuspeed(struct cpufreq_policy *policy, unsigned int khz)
+static void gx_set_cpuspeed(unsigned int khz)
 {
        u8 suscfg, pmer1;
        unsigned int new_khz;
        unsigned long flags;
        struct cpufreq_freqs freqs;
 
+       freqs.cpu = 0;
        freqs.old = gx_get_cpuspeed(0);
 
        new_khz = gx_validate_speed(khz, &gx_params->on_duration,
@@ -265,9 +266,11 @@ static void gx_set_cpuspeed(struct cpufreq_policy *policy, unsigned int khz)
 
        freqs.new = new_khz;
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
        local_irq_save(flags);
 
+
+
        if (new_khz != stock_freq) {
                /* if new khz == 100% of CPU speed, it is special case */
                switch (gx_params->cs55x0->device) {
@@ -314,7 +317,7 @@ static void gx_set_cpuspeed(struct cpufreq_policy *policy, unsigned int khz)
 
        gx_params->pci_suscfg = suscfg;
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        pr_debug("suspend modulation w/ duration of ON:%d us, OFF:%d us\n",
                gx_params->on_duration * 32, gx_params->off_duration * 32);
@@ -394,7 +397,7 @@ static int cpufreq_gx_target(struct cpufreq_policy *policy,
                tmp_freq = gx_validate_speed(tmp_freq, &tmp1, &tmp2);
        }
 
-       gx_set_cpuspeed(policy, tmp_freq);
+       gx_set_cpuspeed(tmp_freq);
 
        return 0;
 }
index c0075db..ca924e9 100644 (file)
@@ -136,7 +136,7 @@ migrate_end:
 static int
 processor_set_freq (
        struct cpufreq_acpi_io  *data,
-       struct cpufreq_policy   *policy,
+       unsigned int            cpu,
        int                     state)
 {
        int                     ret = 0;
@@ -148,8 +148,8 @@ processor_set_freq (
        pr_debug("processor_set_freq\n");
 
        saved_mask = current->cpus_allowed;
-       set_cpus_allowed_ptr(current, cpumask_of(policy->cpu));
-       if (smp_processor_id() != policy->cpu) {
+       set_cpus_allowed_ptr(current, cpumask_of(cpu));
+       if (smp_processor_id() != cpu) {
                retval = -EAGAIN;
                goto migrate_end;
        }
@@ -169,11 +169,12 @@ processor_set_freq (
                data->acpi_data.state, state);
 
        /* cpufreq frequency struct */
+       cpufreq_freqs.cpu = cpu;
        cpufreq_freqs.old = data->freq_table[data->acpi_data.state].frequency;
        cpufreq_freqs.new = data->freq_table[state].frequency;
 
        /* notify cpufreq */
-       cpufreq_notify_transition(policy, &cpufreq_freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_PRECHANGE);
 
        /*
         * First we write the target state's 'control' value to the
@@ -187,20 +188,17 @@ processor_set_freq (
        ret = processor_set_pstate(value);
        if (ret) {
                unsigned int tmp = cpufreq_freqs.new;
-               cpufreq_notify_transition(policy, &cpufreq_freqs,
-                               CPUFREQ_POSTCHANGE);
+               cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_POSTCHANGE);
                cpufreq_freqs.new = cpufreq_freqs.old;
                cpufreq_freqs.old = tmp;
-               cpufreq_notify_transition(policy, &cpufreq_freqs,
-                               CPUFREQ_PRECHANGE);
-               cpufreq_notify_transition(policy, &cpufreq_freqs,
-                               CPUFREQ_POSTCHANGE);
+               cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_PRECHANGE);
+               cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_POSTCHANGE);
                printk(KERN_WARNING "Transition failed with error %d\n", ret);
                retval = -ENODEV;
                goto migrate_end;
        }
 
-       cpufreq_notify_transition(policy, &cpufreq_freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_POSTCHANGE);
 
        data->acpi_data.state = state;
 
@@ -241,7 +239,7 @@ acpi_cpufreq_target (
        if (result)
                return (result);
 
-       result = processor_set_freq(data, policy, next_state);
+       result = processor_set_freq(data, policy->cpu, next_state);
 
        return (result);
 }
index b78bc35..54e336d 100644 (file)
@@ -50,7 +50,7 @@ static int imx6q_set_target(struct cpufreq_policy *policy,
        struct cpufreq_freqs freqs;
        struct opp *opp;
        unsigned long freq_hz, volt, volt_old;
-       unsigned int index;
+       unsigned int index, cpu;
        int ret;
 
        ret = cpufreq_frequency_table_target(policy, freq_table, target_freq,
@@ -68,7 +68,10 @@ static int imx6q_set_target(struct cpufreq_policy *policy,
        if (freqs.old == freqs.new)
                return 0;
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       for_each_online_cpu(cpu) {
+               freqs.cpu = cpu;
+               cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+       }
 
        rcu_read_lock();
        opp = opp_find_freq_ceil(cpu_dev, &freq_hz);
@@ -163,7 +166,10 @@ static int imx6q_set_target(struct cpufreq_policy *policy,
                }
        }
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       for_each_online_cpu(cpu) {
+               freqs.cpu = cpu;
+               cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+       }
 
        return 0;
 }
index f7c99df..6245002 100644 (file)
@@ -121,12 +121,14 @@ static int integrator_set_target(struct cpufreq_policy *policy,
        vco = icst_hz_to_vco(&cclk_params, target_freq * 1000);
        freqs.new = icst_hz(&cclk_params, vco) / 1000;
 
+       freqs.cpu = policy->cpu;
+
        if (freqs.old == freqs.new) {
                set_cpus_allowed(current, cpus_allowed);
                return 0;
        }
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        cm_osc = __raw_readl(CM_OSC);
 
@@ -147,7 +149,7 @@ static int integrator_set_target(struct cpufreq_policy *policy,
         */
        set_cpus_allowed(current, cpus_allowed);
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        return 0;
 }
index b2644af..9a278be 100644 (file)
@@ -55,8 +55,7 @@ static unsigned int kirkwood_cpufreq_get_cpu_frequency(unsigned int cpu)
        return kirkwood_freq_table[0].frequency;
 }
 
-static void kirkwood_cpufreq_set_cpu_state(struct cpufreq_policy *policy,
-               unsigned int index)
+static void kirkwood_cpufreq_set_cpu_state(unsigned int index)
 {
        struct cpufreq_freqs freqs;
        unsigned int state = kirkwood_freq_table[index].index;
@@ -64,8 +63,9 @@ static void kirkwood_cpufreq_set_cpu_state(struct cpufreq_policy *policy,
 
        freqs.old = kirkwood_cpufreq_get_cpu_frequency(0);
        freqs.new = kirkwood_freq_table[index].frequency;
+       freqs.cpu = 0; /* Kirkwood is UP */
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        dev_dbg(priv.dev, "Attempting to set frequency to %i KHz\n",
                kirkwood_freq_table[index].frequency);
@@ -99,7 +99,7 @@ static void kirkwood_cpufreq_set_cpu_state(struct cpufreq_policy *policy,
 
                local_irq_enable();
        }
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 };
 
 static int kirkwood_cpufreq_verify(struct cpufreq_policy *policy)
@@ -117,7 +117,7 @@ static int kirkwood_cpufreq_target(struct cpufreq_policy *policy,
                                target_freq, relation, &index))
                return -EINVAL;
 
-       kirkwood_cpufreq_set_cpu_state(policy, index);
+       kirkwood_cpufreq_set_cpu_state(index);
 
        return 0;
 }
index b448638..1180d53 100644 (file)
@@ -242,8 +242,7 @@ static void do_powersaver(int cx_address, unsigned int mults_index,
  * Sets a new clock ratio.
  */
 
-static void longhaul_setstate(struct cpufreq_policy *policy,
-               unsigned int table_index)
+static void longhaul_setstate(unsigned int table_index)
 {
        unsigned int mults_index;
        int speed, mult;
@@ -268,8 +267,9 @@ static void longhaul_setstate(struct cpufreq_policy *policy,
 
        freqs.old = calc_speed(longhaul_get_cpu_mult());
        freqs.new = speed;
+       freqs.cpu = 0; /* longhaul.c is UP only driver */
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        pr_debug("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n",
                        fsb, mult/10, mult%10, print_speed(speed/1000));
@@ -386,7 +386,7 @@ retry_loop:
                }
        }
        /* Report true CPU frequency */
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        if (!bm_timeout)
                printk(KERN_INFO PFX "Warning: Timeout while waiting for "
@@ -648,7 +648,7 @@ static int longhaul_target(struct cpufreq_policy *policy,
                return 0;
 
        if (!can_scale_voltage)
-               longhaul_setstate(policy, table_index);
+               longhaul_setstate(table_index);
        else {
                /* On test system voltage transitions exceeding single
                 * step up or down were turning motherboard off. Both
@@ -663,7 +663,7 @@ static int longhaul_target(struct cpufreq_policy *policy,
                while (i != table_index) {
                        vid = (longhaul_table[i].index >> 8) & 0x1f;
                        if (vid != current_vid) {
-                               longhaul_setstate(policy, i);
+                               longhaul_setstate(i);
                                current_vid = vid;
                                msleep(200);
                        }
@@ -672,7 +672,7 @@ static int longhaul_target(struct cpufreq_policy *policy,
                        else
                                i--;
                }
-               longhaul_setstate(policy, table_index);
+               longhaul_setstate(table_index);
        }
        longhaul_index = table_index;
        return 0;
@@ -998,17 +998,15 @@ static int __init longhaul_init(void)
 
 static void __exit longhaul_exit(void)
 {
-       struct cpufreq_policy *policy = cpufreq_cpu_get(0);
        int i;
 
        for (i = 0; i < numscales; i++) {
                if (mults[i] == maxmult) {
-                       longhaul_setstate(policy, i);
+                       longhaul_setstate(i);
                        break;
                }
        }
 
-       cpufreq_cpu_put(policy);
        cpufreq_unregister_driver(&longhaul_driver);
        kfree(longhaul_table);
 }
index f92b02a..0ca5306 100644 (file)
@@ -78,6 +78,7 @@ static int loongson2_cpufreq_target(struct cpufreq_policy *policy,
 
        pr_debug("cpufreq: requested frequency %u Hz\n", target_freq * 1000);
 
+       freqs.cpu = cpu;
        freqs.old = loongson2_cpufreq_get(cpu);
        freqs.new = freq;
        freqs.flags = 0;
@@ -86,7 +87,7 @@ static int loongson2_cpufreq_target(struct cpufreq_policy *policy,
                return 0;
 
        /* notifiers */
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        set_cpus_allowed_ptr(current, &cpus_allowed);
 
@@ -94,7 +95,7 @@ static int loongson2_cpufreq_target(struct cpufreq_policy *policy,
        clk_set_rate(cpuclk, freq);
 
        /* notifiers */
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        pr_debug("cpufreq: set frequency %u kHz\n", freq);
 
index cdd6291..d4c4989 100644 (file)
@@ -158,10 +158,11 @@ static int maple_cpufreq_target(struct cpufreq_policy *policy,
 
        freqs.old = maple_cpu_freqs[maple_pmode_cur].frequency;
        freqs.new = maple_cpu_freqs[newstate].frequency;
+       freqs.cpu = 0;
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
        rc = maple_scom_switch_freq(newstate);
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        mutex_unlock(&maple_switch_mutex);
 
index 0279d18..bae6079 100644 (file)
@@ -89,12 +89,16 @@ static int omap_target(struct cpufreq_policy *policy,
        }
 
        freqs.old = omap_getspeed(policy->cpu);
+       freqs.cpu = policy->cpu;
 
        if (freqs.old == freqs.new && policy->cur == freqs.new)
                return ret;
 
        /* notifiers */
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       for_each_cpu(i, policy->cpus) {
+               freqs.cpu = i;
+               cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+       }
 
        freq = freqs.new * 1000;
        ret = clk_round_rate(mpu_clk, freq);
@@ -154,7 +158,10 @@ static int omap_target(struct cpufreq_policy *policy,
 
 done:
        /* notifiers */
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       for_each_cpu(i, policy->cpus) {
+               freqs.cpu = i;
+               cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+       }
 
        return ret;
 }
index 421ef37..7899700 100644 (file)
@@ -124,7 +124,10 @@ static int cpufreq_p4_target(struct cpufreq_policy *policy,
                return 0;
 
        /* notifiers */
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       for_each_cpu(i, policy->cpus) {
+               freqs.cpu = i;
+               cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+       }
 
        /* run on each logical CPU,
         * see section 13.15.3 of IA32 Intel Architecture Software
@@ -134,7 +137,10 @@ static int cpufreq_p4_target(struct cpufreq_policy *policy,
                cpufreq_p4_setdc(i, p4clockmod_table[newstate].index);
 
        /* notifiers */
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       for_each_cpu(i, policy->cpus) {
+               freqs.cpu = i;
+               cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+       }
 
        return 0;
 }
index 0de0008..503996a 100644 (file)
@@ -215,7 +215,8 @@ static int pcc_cpufreq_target(struct cpufreq_policy *policy,
                (pcch_virt_addr + pcc_cpu_data->input_offset));
 
        freqs.new = target_freq;
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       freqs.cpu = cpu;
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        input_buffer = 0x1 | (((target_freq * 100)
                               / (ioread32(&pcch_hdr->nominal) * 1000)) << 8);
@@ -236,7 +237,7 @@ static int pcc_cpufreq_target(struct cpufreq_policy *policy,
        }
        iowrite16(0, &pcch_hdr->status);
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
        pr_debug("target: was SUCCESSFUL for cpu %d\n", cpu);
        spin_unlock(&pcc_lock);
 
index ea0222a..af23e0b 100644 (file)
@@ -68,8 +68,7 @@ static int powernow_k6_get_cpu_multiplier(void)
  *
  *   Tries to change the PowerNow! multiplier
  */
-static void powernow_k6_set_state(struct cpufreq_policy *policy,
-               unsigned int best_i)
+static void powernow_k6_set_state(unsigned int best_i)
 {
        unsigned long outvalue = 0, invalue = 0;
        unsigned long msrval;
@@ -82,8 +81,9 @@ static void powernow_k6_set_state(struct cpufreq_policy *policy,
 
        freqs.old = busfreq * powernow_k6_get_cpu_multiplier();
        freqs.new = busfreq * clock_ratio[best_i].index;
+       freqs.cpu = 0; /* powernow-k6.c is UP only driver */
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        /* we now need to transform best_i to the BVC format, see AMD#23446 */
 
@@ -98,7 +98,7 @@ static void powernow_k6_set_state(struct cpufreq_policy *policy,
        msrval = POWERNOW_IOPORT + 0x0;
        wrmsr(MSR_K6_EPMR, msrval, 0); /* disable it again */
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        return;
 }
@@ -136,7 +136,7 @@ static int powernow_k6_target(struct cpufreq_policy *policy,
                                target_freq, relation, &newstate))
                return -EINVAL;
 
-       powernow_k6_set_state(policy, newstate);
+       powernow_k6_set_state(newstate);
 
        return 0;
 }
@@ -182,7 +182,7 @@ static int powernow_k6_cpu_exit(struct cpufreq_policy *policy)
        unsigned int i;
        for (i = 0; i < 8; i++) {
                if (i == max_multiplier)
-                       powernow_k6_set_state(policy, i);
+                       powernow_k6_set_state(i);
        }
        cpufreq_frequency_table_put_attr(policy->cpu);
        return 0;
index 53888da..334cc2f 100644 (file)
@@ -248,7 +248,7 @@ static void change_VID(int vid)
 }
 
 
-static void change_speed(struct cpufreq_policy *policy, unsigned int index)
+static void change_speed(unsigned int index)
 {
        u8 fid, vid;
        struct cpufreq_freqs freqs;
@@ -263,13 +263,15 @@ static void change_speed(struct cpufreq_policy *policy, unsigned int index)
        fid = powernow_table[index].index & 0xFF;
        vid = (powernow_table[index].index & 0xFF00) >> 8;
 
+       freqs.cpu = 0;
+
        rdmsrl(MSR_K7_FID_VID_STATUS, fidvidstatus.val);
        cfid = fidvidstatus.bits.CFID;
        freqs.old = fsb * fid_codes[cfid] / 10;
 
        freqs.new = powernow_table[index].frequency;
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        /* Now do the magic poking into the MSRs.  */
 
@@ -290,7 +292,7 @@ static void change_speed(struct cpufreq_policy *policy, unsigned int index)
        if (have_a0 == 1)
                local_irq_enable();
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 }
 
 
@@ -544,7 +546,7 @@ static int powernow_target(struct cpufreq_policy *policy,
                                relation, &newstate))
                return -EINVAL;
 
-       change_speed(policy, newstate);
+       change_speed(newstate);
 
        return 0;
 }
index b828efe..b75521d 100644 (file)
@@ -928,10 +928,9 @@ static int get_transition_latency(struct powernow_k8_data *data)
 static int transition_frequency_fidvid(struct powernow_k8_data *data,
                unsigned int index)
 {
-       struct cpufreq_policy *policy;
        u32 fid = 0;
        u32 vid = 0;
-       int res;
+       int res, i;
        struct cpufreq_freqs freqs;
 
        pr_debug("cpu %d transition to index %u\n", smp_processor_id(), index);
@@ -960,10 +959,10 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data,
        freqs.old = find_khz_freq_from_fid(data->currfid);
        freqs.new = find_khz_freq_from_fid(fid);
 
-       policy = cpufreq_cpu_get(smp_processor_id());
-       cpufreq_cpu_put(policy);
-
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       for_each_cpu(i, data->available_cores) {
+               freqs.cpu = i;
+               cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+       }
 
        res = transition_fid_vid(data, fid, vid);
        if (res)
@@ -971,7 +970,10 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data,
 
        freqs.new = find_khz_freq_from_fid(data->currfid);
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       for_each_cpu(i, data->available_cores) {
+               freqs.cpu = i;
+               cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+       }
        return res;
 }
 
index e577a1d..9ba58d4 100644 (file)
@@ -157,9 +157,10 @@ static int cbe_cpufreq_target(struct cpufreq_policy *policy,
 
        freqs.old = policy->cur;
        freqs.new = cbe_freqs[cbe_pmode_new].frequency;
+       freqs.cpu = policy->cpu;
 
        mutex_lock(&cbe_switch_mutex);
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        pr_debug("setting frequency for cpu %d to %d kHz, " \
                 "1/%d of max frequency\n",
@@ -169,7 +170,7 @@ static int cbe_cpufreq_target(struct cpufreq_policy *policy,
 
        rc = set_pmode(policy->cpu, cbe_pmode_new);
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
        mutex_unlock(&cbe_switch_mutex);
 
        return rc;
index 9e5bc8e..e9a979c 100644 (file)
@@ -310,6 +310,7 @@ static int pxa_set_target(struct cpufreq_policy *policy,
        new_freq_mem = pxa_freq_settings[idx].membus;
        freqs.old = policy->cur;
        freqs.new = new_freq_cpu;
+       freqs.cpu = policy->cpu;
 
        if (freq_debug)
                pr_debug("Changing CPU frequency to %d Mhz, (SDRAM %d Mhz)\n",
@@ -325,7 +326,7 @@ static int pxa_set_target(struct cpufreq_policy *policy,
         * you should add a notify client with any platform specific
         * Vcc changing capability
         */
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        /* Calculate the next MDREFR.  If we're slowing down the SDRAM clock
         * we need to preset the smaller DRI before the change.  If we're
@@ -380,7 +381,7 @@ static int pxa_set_target(struct cpufreq_policy *policy,
         * you should add a notify client with any platform specific
         * SDRAM refresh timer adjustments
         */
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        /*
         * Even if voltage setting fails, we don't report it, as the frequency
index 15d60f8..b70ae94 100644 (file)
@@ -181,6 +181,7 @@ static int pxa3xx_cpufreq_set(struct cpufreq_policy *policy,
 
        freqs.old = policy->cur;
        freqs.new = next->cpufreq_mhz * 1000;
+       freqs.cpu = policy->cpu;
 
        pr_debug("CPU frequency from %d MHz to %d MHz%s\n",
                        freqs.old / 1000, freqs.new / 1000,
@@ -189,14 +190,14 @@ static int pxa3xx_cpufreq_set(struct cpufreq_policy *policy,
        if (freqs.old == target_freq)
                return 0;
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        local_irq_save(flags);
        __update_core_freq(next);
        __update_bus_freq(next);
        local_irq_restore(flags);
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        return 0;
 }
index 4f1881e..bcc053b 100644 (file)
@@ -256,6 +256,7 @@ static int s3c2416_cpufreq_set_target(struct cpufreq_policy *policy,
                goto out;
        }
 
+       freqs.cpu = 0;
        freqs.flags = 0;
        freqs.old = s3c_freq->is_dvs ? FREQ_DVS
                                     : clk_get_rate(s3c_freq->armclk) / 1000;
@@ -273,7 +274,7 @@ static int s3c2416_cpufreq_set_target(struct cpufreq_policy *policy,
        if (!to_dvs && freqs.old == freqs.new)
                goto out;
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        if (to_dvs) {
                pr_debug("cpufreq: enter dvs\n");
@@ -286,7 +287,7 @@ static int s3c2416_cpufreq_set_target(struct cpufreq_policy *policy,
                ret = s3c2416_cpufreq_set_armdiv(s3c_freq, freqs.new);
        }
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
 out:
        mutex_unlock(&cpufreq_lock);
index 27cacb5..6f9490b 100644 (file)
@@ -84,6 +84,7 @@ static int s3c64xx_cpufreq_set_target(struct cpufreq_policy *policy,
        if (ret != 0)
                return ret;
 
+       freqs.cpu = 0;
        freqs.old = clk_get_rate(armclk) / 1000;
        freqs.new = s3c64xx_freq_table[i].frequency;
        freqs.flags = 0;
@@ -94,7 +95,7 @@ static int s3c64xx_cpufreq_set_target(struct cpufreq_policy *policy,
 
        pr_debug("Transition %d-%dkHz\n", freqs.old, freqs.new);
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
 #ifdef CONFIG_REGULATOR
        if (vddarm && freqs.new > freqs.old) {
@@ -116,7 +117,7 @@ static int s3c64xx_cpufreq_set_target(struct cpufreq_policy *policy,
                goto err;
        }
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
 #ifdef CONFIG_REGULATOR
        if (vddarm && freqs.new < freqs.old) {
@@ -140,7 +141,7 @@ err_clk:
        if (clk_set_rate(armclk, freqs.old * 1000) < 0)
                pr_err("Failed to restore original clock rate\n");
 err:
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        return ret;
 }
index 5c77570..a484aae 100644 (file)
@@ -229,6 +229,7 @@ static int s5pv210_target(struct cpufreq_policy *policy,
        }
 
        freqs.new = s5pv210_freq_table[index].frequency;
+       freqs.cpu = 0;
 
        if (freqs.new == freqs.old)
                goto exit;
@@ -255,7 +256,7 @@ static int s5pv210_target(struct cpufreq_policy *policy,
                        goto exit;
        }
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        /* Check if there need to change PLL */
        if ((index == L0) || (priv_index == L0))
@@ -467,7 +468,7 @@ static int s5pv210_target(struct cpufreq_policy *policy,
                }
        }
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        if (freqs.new < freqs.old) {
                regulator_set_voltage(int_regulator,
index cff18e8..ab2f0f7 100644 (file)
@@ -200,8 +200,9 @@ static int sa1100_target(struct cpufreq_policy *policy,
 
        freqs.old = cur;
        freqs.new = sa11x0_ppcr_to_freq(new_ppcr);
+       freqs.cpu = 0;
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        if (freqs.new > cur)
                sa1100_update_dram_timings(cur, freqs.new);
@@ -211,7 +212,7 @@ static int sa1100_target(struct cpufreq_policy *policy,
        if (freqs.new < cur)
                sa1100_update_dram_timings(cur, freqs.new);
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        return 0;
 }
index 39c90b6..234eef8 100644 (file)
@@ -257,6 +257,7 @@ static int sa1110_target(struct cpufreq_policy *policy,
 
        freqs.old = sa11x0_getspeed(0);
        freqs.new = sa11x0_ppcr_to_freq(ppcr);
+       freqs.cpu = 0;
 
        sdram_calculate_timing(&sd, freqs.new, sdram);
 
@@ -277,7 +278,7 @@ static int sa1110_target(struct cpufreq_policy *policy,
        sd.mdcas[2] = 0xaaaaaaaa;
 #endif
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        /*
         * The clock could be going away for some time.  Set the SDRAMs
@@ -325,7 +326,7 @@ static int sa1110_target(struct cpufreq_policy *policy,
         */
        sdram_update_refresh(freqs.new, sdram);
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        return 0;
 }
index f740b13..e42e073 100644 (file)
@@ -53,8 +53,7 @@ static unsigned int sc520_freq_get_cpu_frequency(unsigned int cpu)
        }
 }
 
-static void sc520_freq_set_cpu_state(struct cpufreq_policy *policy,
-               unsigned int state)
+static void sc520_freq_set_cpu_state(unsigned int state)
 {
 
        struct cpufreq_freqs    freqs;
@@ -62,8 +61,9 @@ static void sc520_freq_set_cpu_state(struct cpufreq_policy *policy,
 
        freqs.old = sc520_freq_get_cpu_frequency(0);
        freqs.new = sc520_freq_table[state].frequency;
+       freqs.cpu = 0; /* AMD Elan is UP */
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        pr_debug("attempting to set frequency to %i kHz\n",
                        sc520_freq_table[state].frequency);
@@ -75,7 +75,7 @@ static void sc520_freq_set_cpu_state(struct cpufreq_policy *policy,
 
        local_irq_enable();
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 };
 
 static int sc520_freq_verify(struct cpufreq_policy *policy)
@@ -93,7 +93,7 @@ static int sc520_freq_target(struct cpufreq_policy *policy,
                                target_freq, relation, &newstate))
                return -EINVAL;
 
-       sc520_freq_set_cpu_state(policy, newstate);
+       sc520_freq_set_cpu_state(newstate);
 
        return 0;
 }
index 73adb64..e8aea09 100644 (file)
@@ -64,14 +64,15 @@ static int sh_cpufreq_target(struct cpufreq_policy *policy,
 
        dev_dbg(dev, "requested frequency %u Hz\n", target_freq * 1000);
 
+       freqs.cpu       = cpu;
        freqs.old       = sh_cpufreq_get(cpu);
        freqs.new       = (freq + 500) / 1000;
        freqs.flags     = 0;
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
        set_cpus_allowed_ptr(current, &cpus_allowed);
        clk_set_rate(cpuclk, freq);
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        dev_dbg(dev, "set frequency %lu Hz\n", freq);
 
index 306ae46..f857439 100644 (file)
@@ -245,10 +245,8 @@ static unsigned int us2e_freq_get(unsigned int cpu)
        return clock_tick / estar_to_divisor(estar);
 }
 
-static void us2e_set_cpu_divider_index(struct cpufreq_policy *policy,
-               unsigned int index)
+static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index)
 {
-       unsigned int cpu = policy->cpu;
        unsigned long new_bits, new_freq;
        unsigned long clock_tick, divisor, old_divisor, estar;
        cpumask_t cpus_allowed;
@@ -268,13 +266,14 @@ static void us2e_set_cpu_divider_index(struct cpufreq_policy *policy,
 
        freqs.old = clock_tick / old_divisor;
        freqs.new = new_freq;
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       freqs.cpu = cpu;
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        if (old_divisor != divisor)
                us2e_transition(estar, new_bits, clock_tick * 1000,
                                old_divisor, divisor);
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        set_cpus_allowed_ptr(current, &cpus_allowed);
 }
@@ -290,7 +289,7 @@ static int us2e_freq_target(struct cpufreq_policy *policy,
                                           target_freq, relation, &new_index))
                return -EINVAL;
 
-       us2e_set_cpu_divider_index(policy, new_index);
+       us2e_set_cpu_divider_index(policy->cpu, new_index);
 
        return 0;
 }
@@ -330,7 +329,7 @@ static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy)
 static int us2e_freq_cpu_exit(struct cpufreq_policy *policy)
 {
        if (cpufreq_us2e_driver)
-               us2e_set_cpu_divider_index(policy, 0);
+               us2e_set_cpu_divider_index(policy->cpu, 0);
 
        return 0;
 }
index c71ee14..70cc641 100644 (file)
@@ -93,10 +93,8 @@ static unsigned int us3_freq_get(unsigned int cpu)
        return ret;
 }
 
-static void us3_set_cpu_divider_index(struct cpufreq_policy *policy,
-               unsigned int index)
+static void us3_set_cpu_divider_index(unsigned int cpu, unsigned int index)
 {
-       unsigned int cpu = policy->cpu;
        unsigned long new_bits, new_freq, reg;
        cpumask_t cpus_allowed;
        struct cpufreq_freqs freqs;
@@ -127,13 +125,14 @@ static void us3_set_cpu_divider_index(struct cpufreq_policy *policy,
 
        freqs.old = get_current_freq(cpu, reg);
        freqs.new = new_freq;
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       freqs.cpu = cpu;
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        reg &= ~SAFARI_CFG_DIV_MASK;
        reg |= new_bits;
        write_safari_cfg(reg);
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        set_cpus_allowed_ptr(current, &cpus_allowed);
 }
@@ -151,7 +150,7 @@ static int us3_freq_target(struct cpufreq_policy *policy,
                                           &new_index))
                return -EINVAL;
 
-       us3_set_cpu_divider_index(policy, new_index);
+       us3_set_cpu_divider_index(policy->cpu, new_index);
 
        return 0;
 }
@@ -187,7 +186,7 @@ static int __init us3_freq_cpu_init(struct cpufreq_policy *policy)
 static int us3_freq_cpu_exit(struct cpufreq_policy *policy)
 {
        if (cpufreq_us3_driver)
-               us3_set_cpu_divider_index(policy, 0);
+               us3_set_cpu_divider_index(policy->cpu, 0);
 
        return 0;
 }
index 156829f..7e4d773 100644 (file)
@@ -121,6 +121,7 @@ static int spear_cpufreq_target(struct cpufreq_policy *policy,
                                target_freq, relation, &index))
                return -EINVAL;
 
+       freqs.cpu = policy->cpu;
        freqs.old = spear_cpufreq_get(0);
 
        newfreq = spear_cpufreq.freq_tbl[index].frequency * 1000;
@@ -157,7 +158,8 @@ static int spear_cpufreq_target(struct cpufreq_policy *policy,
        freqs.new = newfreq / 1000;
        freqs.new /= mult;
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       for_each_cpu(freqs.cpu, policy->cpus)
+               cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        if (mult == 2)
                ret = spear1340_set_cpu_rate(srcclk, newfreq);
@@ -170,7 +172,8 @@ static int spear_cpufreq_target(struct cpufreq_policy *policy,
                freqs.new = clk_get_rate(spear_cpufreq.clk) / 1000;
        }
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       for_each_cpu(freqs.cpu, policy->cpus)
+               cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
        return ret;
 }
 
index 618e6f4..2e0a3ce 100644 (file)
@@ -457,7 +457,7 @@ static int centrino_target (struct cpufreq_policy *policy,
        unsigned int    msr, oldmsr = 0, h = 0, cpu = policy->cpu;
        struct cpufreq_freqs    freqs;
        int                     retval = 0;
-       unsigned int            j, first_cpu, tmp;
+       unsigned int            j, k, first_cpu, tmp;
        cpumask_var_t covered_cpus;
 
        if (unlikely(!zalloc_cpumask_var(&covered_cpus, GFP_KERNEL)))
@@ -518,8 +518,13 @@ static int centrino_target (struct cpufreq_policy *policy,
                        pr_debug("target=%dkHz old=%d new=%d msr=%04x\n",
                                target_freq, freqs.old, freqs.new, msr);
 
-                       cpufreq_notify_transition(policy, &freqs,
+                       for_each_cpu(k, policy->cpus) {
+                               if (!cpu_online(k))
+                                       continue;
+                               freqs.cpu = k;
+                               cpufreq_notify_transition(&freqs,
                                        CPUFREQ_PRECHANGE);
+                       }
 
                        first_cpu = 0;
                        /* all but 16 LSB are reserved, treat them with care */
@@ -535,7 +540,12 @@ static int centrino_target (struct cpufreq_policy *policy,
                cpumask_set_cpu(j, covered_cpus);
        }
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       for_each_cpu(k, policy->cpus) {
+               if (!cpu_online(k))
+                       continue;
+               freqs.cpu = k;
+               cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+       }
 
        if (unlikely(retval)) {
                /*
@@ -551,8 +561,12 @@ static int centrino_target (struct cpufreq_policy *policy,
                tmp = freqs.new;
                freqs.new = freqs.old;
                freqs.old = tmp;
-               cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
-               cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+               for_each_cpu(j, policy->cpus) {
+                       if (!cpu_online(j))
+                               continue;
+                       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+                       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+               }
        }
        retval = 0;
 
index e2e5aa9..e29b59a 100644 (file)
@@ -263,6 +263,7 @@ static int speedstep_target(struct cpufreq_policy *policy,
 {
        unsigned int newstate = 0, policy_cpu;
        struct cpufreq_freqs freqs;
+       int i;
 
        if (cpufreq_frequency_table_target(policy, &speedstep_freqs[0],
                                target_freq, relation, &newstate))
@@ -271,6 +272,7 @@ static int speedstep_target(struct cpufreq_policy *policy,
        policy_cpu = cpumask_any_and(policy->cpus, cpu_online_mask);
        freqs.old = speedstep_get(policy_cpu);
        freqs.new = speedstep_freqs[newstate].frequency;
+       freqs.cpu = policy->cpu;
 
        pr_debug("transiting from %u to %u kHz\n", freqs.old, freqs.new);
 
@@ -278,12 +280,18 @@ static int speedstep_target(struct cpufreq_policy *policy,
        if (freqs.old == freqs.new)
                return 0;
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       for_each_cpu(i, policy->cpus) {
+               freqs.cpu = i;
+               cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+       }
 
        smp_call_function_single(policy_cpu, _speedstep_set_state, &newstate,
                                 true);
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       for_each_cpu(i, policy->cpus) {
+               freqs.cpu = i;
+               cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+       }
 
        return 0;
 }
index f5a6b70..6a457fc 100644 (file)
@@ -252,13 +252,14 @@ static int speedstep_target(struct cpufreq_policy *policy,
 
        freqs.old = speedstep_freqs[speedstep_get_state()].frequency;
        freqs.new = speedstep_freqs[newstate].frequency;
+       freqs.cpu = 0; /* speedstep.c is UP only driver */
 
        if (freqs.old == freqs.new)
                return 0;
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
        speedstep_set_state(newstate);
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        return 0;
 }
index 12fc904..7cc9ae2 100644 (file)
@@ -52,14 +52,15 @@ static int ucv2_target(struct cpufreq_policy *policy,
        struct cpufreq_freqs freqs;
        struct clk *mclk = clk_get(NULL, "MAIN_CLK");
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
        if (!clk_set_rate(mclk, target_freq * 1000)) {
                freqs.old = cur;
                freqs.new = target_freq;
+               freqs.cpu = 0;
        }
 
-       cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
+       cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
        return 0;
 }
index 037d36a..4bbc572 100644 (file)
@@ -278,8 +278,8 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data);
 int cpufreq_unregister_driver(struct cpufreq_driver *driver_data);
 
 
-void cpufreq_notify_transition(struct cpufreq_policy *policy,
-               struct cpufreq_freqs *freqs, unsigned int state);
+void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state);
+
 
 static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy, unsigned int min, unsigned int max)
 {