Skip to content

Commit

Permalink
[CPUFREQ] powernow-k8: Let cpufreq driver handle affected CPUs
Browse files Browse the repository at this point in the history
powernow-k8: Let cpufreq driver handle affected CPUs

Let the cpufreq driver manage AMD Dual-Core CPUs being tied together.

Since cpufreq driver's affected CPUs data, cpufreq_policy->cpus, already
knows about which cores are tied together, powernow driver does not have
keep its internal data for every core.  (even a pointer.. it will never
be called on)  Telling cpufreq driver about cpu_core_map at init time is
sufficient.

Signed-off-by: Jacob Shin <jacob.shin@amd.com>
Signed-off-by: Dave Jones <davej@redhat.com>
  • Loading branch information
Dave Jones committed Mar 5, 2006
1 parent 32ee8c3 commit 2a1c1c8
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions arch/i386/kernel/cpu/cpufreq/powernow-k8.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

#define PFX "powernow-k8: "
#define BFX PFX "BIOS error: "
#define VERSION "version 1.60.0"
#define VERSION "version 1.60.1"
#include "powernow-k8.h"

/* serialize freq changes */
Expand Down Expand Up @@ -908,7 +908,6 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
u32 checkvid = data->currvid;
unsigned int newstate;
int ret = -EIO;
int i;

/* only run on specific CPU from here on */
oldmask = current->cpus_allowed;
Expand Down Expand Up @@ -954,12 +953,6 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
up(&fidvid_sem);
goto err_out;
}

/* Update all the fid/vids of our siblings */
for_each_cpu_mask(i, cpu_core_map[pol->cpu]) {
powernow_data[i]->currvid = data->currvid;
powernow_data[i]->currfid = data->currfid;
}
up(&fidvid_sem);

pol->cur = find_khz_freq_from_fid(data->currfid);
Expand All @@ -983,7 +976,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
{
struct powernow_k8_data *data;
cpumask_t oldmask = CPU_MASK_ALL;
int rc, i;
int rc;

if (!cpu_online(pol->cpu))
return -ENODEV;
Expand Down Expand Up @@ -1069,9 +1062,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
printk("cpu_init done, current fid 0x%x, vid 0x%x\n",
data->currfid, data->currvid);

for_each_cpu_mask(i, cpu_core_map[pol->cpu]) {
powernow_data[i] = data;
}
powernow_data[pol->cpu] = data;

return 0;

Expand Down

0 comments on commit 2a1c1c8

Please sign in to comment.