Skip to content

Commit 8dca15e

Browse files
rustyrussellDave Jones
authored andcommitted
[CPUFREQ] speedstep-ich: fix error caused by 394122a
"[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>
1 parent e77b89f commit 8dca15e

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

‎arch/x86/kernel/cpu/cpufreq/speedstep-ich.c‎

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -232,28 +232,23 @@ static unsigned int speedstep_detect_chipset(void)
232232
return 0;
233233
}
234234

235-
struct get_freq_data {
236-
unsigned int speed;
237-
unsigned int processor;
238-
};
239-
240-
static void get_freq_data(void *_data)
235+
static void get_freq_data(void *_speed)
241236
{
242-
struct get_freq_data *data = _data;
237+
unsigned int *speed = _speed;
243238

244-
data->speed = speedstep_get_frequency(data->processor);
239+
*speed = speedstep_get_frequency(speedstep_processor);
245240
}
246241

247242
static unsigned int speedstep_get(unsigned int cpu)
248243
{
249-
struct get_freq_data data = { .processor = cpu };
244+
unsigned int speed;
250245

251246
/* You're supposed to ensure CPU is online. */
252-
if (smp_call_function_single(cpu, get_freq_data, &data, 1) != 0)
247+
if (smp_call_function_single(cpu, get_freq_data, &speed, 1) != 0)
253248
BUG();
254249

255-
dprintk("detected %u kHz as current frequency\n", data.speed);
256-
return data.speed;
250+
dprintk("detected %u kHz as current frequency\n", speed);
251+
return speed;
257252
}
258253

259254
/**

0 commit comments

Comments
 (0)