Commit b8176b8c authored by Dave Jones's avatar Dave Jones Committed by Dave Jones

[CPUFREQ] fix HT oops on speedstep-ich system

Bugfix for #3012 @ http://bugme.osdl.org/show_bug.cgi?id=3012

The speedstep-ich driver only registers for CPU0 (which is a sane thing to
do). However, cpufreq_notify_transition() currently assumes the CPU
specified in the freqs.cpu parameter has actually been registered with the
CPUfreq core. This is obviously not the case for HT speedstep-ich CPUs,
causing an OOPS. The long-term solution will be to merge the "cpufreq
CPU group awareness patches" already RFC'ed to this list; but they still
need a bit of polishing and testing.

Thanks to Boris Fersing for reporting the bug and testing this fix.
Signed-off-by: default avatarDominik Brodowski <linux@brodo.de>
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent 3162d424
......@@ -153,7 +153,8 @@ void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state)
* is not equal to what the cpufreq core thinks is "old frequency".
*/
if (!(cpufreq_driver->flags & CPUFREQ_CONST_LOOPS)) {
if ((likely(cpufreq_cpu_data[freqs->cpu]->cur)) &&
if ((likely(cpufreq_cpu_data[freqs->cpu])) &&
(likely(cpufreq_cpu_data[freqs->cpu]->cur)) &&
(unlikely(freqs->old != cpufreq_cpu_data[freqs->cpu]->cur)))
{
if (cpufreq_driver->flags & CPUFREQ_PANIC_OUTOFSYNC)
......@@ -170,6 +171,7 @@ void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state)
case CPUFREQ_POSTCHANGE:
adjust_jiffies(CPUFREQ_POSTCHANGE, freqs);
notifier_call_chain(&cpufreq_transition_notifier_list, CPUFREQ_POSTCHANGE, freqs);
if (likely(cpufreq_cpu_data[freqs->cpu]))
cpufreq_cpu_data[freqs->cpu]->cur = freqs->new;
break;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment