Skip to content

Commit

Permalink
[CPUFREQ] pcc-cpufreq: don't load driver if get_freq fails during init.
Browse files Browse the repository at this point in the history
Return 0 on failure. This will cause the initialization of the driver
to fail and prevent the driver from loading if the BIOS cannot handle
the PCC interface command to "get frequency". Otherwise, the driver
will load and display a very high value like "4294967274" (which is
actually -EINVAL) for frequency:

# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
4294967274

Signed-off-by: Naga Chumbalkar <nagananda.chumbalkar@hp.com>
CC: stable@kernel.org
Signed-off-by: Dave Jones <davej@redhat.com>
  • Loading branch information
Naga Chumbalkar authored and Dave Jones committed Mar 9, 2011
1 parent a5abba9 commit 1f858ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ static unsigned int pcc_get_freq(unsigned int cpu)
cmd_incomplete:
iowrite16(0, &pcch_hdr->status);
spin_unlock(&pcc_lock);
return -EINVAL;
return 0;
}

static int pcc_cpufreq_target(struct cpufreq_policy *policy,
Expand Down

0 comments on commit 1f858ef

Please sign in to comment.