Skip to contentSkip to conversation

powernow-k8: don't crash system at boot

PATCH Applied Pavel Machek 2 participants 3 messages Oct 5, 2003 – Oct 7, 2003

lore
Share & tools
lore
#0 lore raw

Hi!

powernow-k8 module fails to initialize government on boot, leading to nasty crash at boot.

This fixes it. Plus find_closest_find really wants to be static. Fix it, too.
Pavel

Index: arch/i386/kernel/cpu/cpufreq/powernow-k8.c
===================================================================
RCS file: /home/pavel/sf/bitbucket/bkcvs/linux-2.5/arch/i386/kernel/cpu/cpufreq/powernow-k8.c,v retrieving revision 1.2

i386/kernel/cpu/cpufreq/powernow-k8.c +2 -1
diff -u -u -r1.2 powernow-k8.c
@@ -718,7 +718,7 @@
 
 /* Converts a frequency (that might not necessarily be a multiple of 200) */
 /* to a fid.                                                              */
-u32
+static u32
 find_closest_fid(u32 freq, int searchup)
 {
 	if (searchup == SEARCH_UP)
@@ -971,6 +971,7 @@
 	pol->cpuinfo.max_freq = 1000 * find_freq_from_fid(ppst[numps-1].fid);
 	pol->min = 1000 * find_freq_from_fid(ppst[0].fid);
 	pol->max = 1000 * find_freq_from_fid(ppst[batps - 1].fid);
+	pol->governor = CPUFREQ_DEFAULT_GOVERNOR;
 
 	printk(KERN_INFO PFX "cpu_init done, current fid 0x%x, vid 0x%x\n",
 	       currfid, currvid);
Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
Applied
#1 lore raw

On Sun, Oct 05, 2003 at 09:00:57PM +0200, Pavel Machek wrote:

<Please don't send these to Rusty, such changes are far from trivial.
Not that I don't trust Rusty to pass on them, but it's one less thing he has to worry about..>

Quoted 2 lines

powernow-k8 module fails to initialize government on boot, leading to nasty crash at boot.

See below.

Quoted 2 lines

This fixes it. Plus find_closest_find really wants to be static. Fix it, too.

Applied. Thanks.

i386/kernel/cpu/cpufreq/powernow-k8.c line 977

Quoted 8 lines
i386/kernel/cpu/cpufreq/powernow-k8.c +1 -0
@@ -971,6 +971,7 @@
 	pol->cpuinfo.max_freq = 1000 * find_freq_from_fid(ppst[numps-1].fid);
 	pol->min = 1000 * find_freq_from_fid(ppst[0].fid);
 	pol->max = 1000 * find_freq_from_fid(ppst[batps - 1].fid);
+	pol->governor = CPUFREQ_DEFAULT_GOVERNOR;
 
 	printk(KERN_INFO PFX "cpu_init done, current fid 0x%x, vid 0x%x\n",
 	       currfid, currvid);

Already fixed differently. Dominik's patch also nuked the setting of ->policy a few lines above.

Dave

Signature · 1 line
 Dave Jones     http://www.codemonkey.org.uk
#2 lore raw

Hi!

Quoted 3 lines

<Please don't send these to Rusty, such changes are far from trivial.
Not that I don't trust Rusty to pass on them, but it's one less thing he has to worry about..>

Okay, next time only static's and like go to the rusty.

Quoted 9 lines
Quoted 2 lines

powernow-k8 module fails to initialize government on boot, leading to nasty crash at boot.

See below.

Quoted 2 lines

This fixes it. Plus find_closest_find really wants to be static. Fix it, too.

Applied. Thanks.

Thanks.
Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]