Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 143104
b: refs/heads/master
c: 01599fc
h: refs/heads/master
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Apr 13, 2009
1 parent 4075168 commit 19a0b4d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8371f87c9994d9942af5984309835aeb948ba579
refs/heads/master: 01599fca6758d2cd133e78f87426fc851c9ea725
24 changes: 9 additions & 15 deletions trunk/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ struct drv_cmd {
u32 val;
};

static long do_drv_read(void *_cmd)
/* Called via smp_call_function_single(), on the target CPU */
static void do_drv_read(void *_cmd)
{
struct drv_cmd *cmd = _cmd;
u32 h;
Expand All @@ -170,10 +171,10 @@ static long do_drv_read(void *_cmd)
default:
break;
}
return 0;
}

static long do_drv_write(void *_cmd)
/* Called via smp_call_function_many(), on the target CPUs */
static void do_drv_write(void *_cmd)
{
struct drv_cmd *cmd = _cmd;
u32 lo, hi;
Expand All @@ -192,23 +193,18 @@ static long do_drv_write(void *_cmd)
default:
break;
}
return 0;
}

static void drv_read(struct drv_cmd *cmd)
{
cmd->val = 0;

work_on_cpu(cpumask_any(cmd->mask), do_drv_read, cmd);
smp_call_function_single(cpumask_any(cmd->mask), do_drv_read, cmd, 1);
}

static void drv_write(struct drv_cmd *cmd)
{
unsigned int i;

for_each_cpu(i, cmd->mask) {
work_on_cpu(i, do_drv_write, cmd);
}
smp_call_function_many(cmd->mask, do_drv_write, cmd, 1);
}

static u32 get_cur_val(const struct cpumask *mask)
Expand Down Expand Up @@ -252,15 +248,13 @@ struct perf_pair {
} aperf, mperf;
};


static long read_measured_perf_ctrs(void *_cur)
/* Called via smp_call_function_single(), on the target CPU */
static void read_measured_perf_ctrs(void *_cur)
{
struct perf_pair *cur = _cur;

rdmsr(MSR_IA32_APERF, cur->aperf.split.lo, cur->aperf.split.hi);
rdmsr(MSR_IA32_MPERF, cur->mperf.split.lo, cur->mperf.split.hi);

return 0;
}

/*
Expand All @@ -283,7 +277,7 @@ static unsigned int get_measured_perf(struct cpufreq_policy *policy,
unsigned int perf_percent;
unsigned int retval;

if (!work_on_cpu(cpu, read_measured_perf_ctrs, &readin))
if (smp_call_function_single(cpu, read_measured_perf_ctrs, &cur, 1))
return 0;

cur.aperf.whole = readin.aperf.whole -
Expand Down

0 comments on commit 19a0b4d

Please sign in to comment.