mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-08 14:13:53 +00:00
[CPUFREQ] speedstep-ich: fix error caused by 394122ab14
"[CPUFREQ] cpumask: avoid playing with cpus_allowed in speedstep-ich.c" changed the code to mistakenly pass the current cpu as the "processor" argument of speedstep_get_frequency(), whereas it should be the type of the processor. Addresses http://bugzilla.kernel.org/show_bug.cgi?id=14340 Based on a patch by Dave Mueller. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Acked-by: Dominik Brodowski <linux@brodo.de> Reported-by: Dave Mueller <dave.mueller@gmx.ch> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Jones <davej@redhat.com>
This commit is contained in:
parent
e77b89f13a
commit
8dca15e408
@ -232,28 +232,23 @@ static unsigned int speedstep_detect_chipset(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct get_freq_data {
|
static void get_freq_data(void *_speed)
|
||||||
unsigned int speed;
|
|
||||||
unsigned int processor;
|
|
||||||
};
|
|
||||||
|
|
||||||
static void get_freq_data(void *_data)
|
|
||||||
{
|
{
|
||||||
struct get_freq_data *data = _data;
|
unsigned int *speed = _speed;
|
||||||
|
|
||||||
data->speed = speedstep_get_frequency(data->processor);
|
*speed = speedstep_get_frequency(speedstep_processor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int speedstep_get(unsigned int cpu)
|
static unsigned int speedstep_get(unsigned int cpu)
|
||||||
{
|
{
|
||||||
struct get_freq_data data = { .processor = cpu };
|
unsigned int speed;
|
||||||
|
|
||||||
/* You're supposed to ensure CPU is online. */
|
/* You're supposed to ensure CPU is online. */
|
||||||
if (smp_call_function_single(cpu, get_freq_data, &data, 1) != 0)
|
if (smp_call_function_single(cpu, get_freq_data, &speed, 1) != 0)
|
||||||
BUG();
|
BUG();
|
||||||
|
|
||||||
dprintk("detected %u kHz as current frequency\n", data.speed);
|
dprintk("detected %u kHz as current frequency\n", speed);
|
||||||
return data.speed;
|
return speed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user