Skip to contentSkip to conversation

New: warning in cpufreq.c on E450

Bug 11139 [email protected] 1 participant 7 messages Jul 21, 2008 – Jul 23, 2008

lore
Share & tools
lore
#0 lore raw

http://bugzilla.kernel.org/show_bug.cgi?id=11139

Summary: warning in cpufreq.c on E450
Product: Power Management
Version: 2.5
KernelVersion: 2.6.26
Platform: All
OS/Version: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: cpufreq
AssignedTo: [email protected]
ReportedBy: [email protected]

Latest working kernel version: 2.6.24.2 Earliest failing kernel version: 2.6.26
Distribution: Debian Sid
Hardware Environment: Sun E450/2x CPU 400Mhz/1GB Ram Software Environment: Sid
Problem Description:
After I compile 2.6.26 an boots I get this:

------------[ cut here ]------------                                            
WARNING: at drivers/cpufreq/cpufreq.c:1391
cpufreq_register_notifier+0x50/0x60()
Modules linked in:                                                              
Call Trace:                                                                     
 [0000000000605270] cpufreq_register_notifier+0x58/0x60                         
 [00000000007708e0] start_kernel+0x1f0/0x324                                    
 [0000000000680e08] auxio_probe+0x0/0xe8                                        
 [0000000000000000] 0x8                                                         
---[ end trace 139ce121c98e96c9 ]---

Steps to reproduce:
Compile kernel with cpufreq enabled and boot.

Signature · 3 lines
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
#1 lore raw

[Bug 11139] warning in cpufreq.c on E450

http://bugzilla.kernel.org/show_bug.cgi?id=11139

[email protected] changed:

What |Removed |Added
----------------------------------------------------------------------------

                 CC|                            |[email protected]
         Regression|0                           |1
Signature · 3 lines
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
#2 lore raw

[Bug 11139] warning in cpufreq.c on E450

In reply to [email protected]

http://bugzilla.kernel.org/show_bug.cgi?id=11139

------- Comment #1 from [email protected] 2008-07-22 16:45 ------- This looks strange.

The warning is because init_cpufreq_transition_notifier_list_called is not set to true (yet). However, that should have been done in pure_initcall stage which is waaaaay before auxio_probe, which is at fs_initcall stage. Any experts on the ordering of initcalls, and why this is messed up here?

Signature · 3 lines
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
#3 lore raw

[Bug 11139] warning in cpufreq.c on E450

In reply to [email protected]

http://bugzilla.kernel.org/show_bug.cgi?id=11139

------- Comment #2 from [email protected] 2008-07-22 17:38 ------- There's another auxio_probe, at arch/sparc/kernel/auxio.c, which seems to be called deep within setup_arch() if I followed the code paths correctly. The one called at fs_initcall is the one at arch/sparc64/kernel/auxio.c.

This is probably not a regression; the warning was added after 2.6.25 (see commit 74212ca432982903d0fc6a0f282b199e000ad8b1). The bug probably was there all the time.

Signature · 3 lines
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
#4 lore raw

[Bug 11139] warning in cpufreq.c on E450

In reply to [email protected]

http://bugzilla.kernel.org/show_bug.cgi?id=11139

------- Comment #3 from [email protected] 2008-07-23 02:04 ------- (In reply to comment #1)

Quoted 6 lines

This looks strange.

The warning is because init_cpufreq_transition_notifier_list_called is not set to true (yet). However, that should have been done in pure_initcall stage which is waaaaay before auxio_probe, which is at fs_initcall stage. Any experts on the ordering of initcalls, and why this is messed up here?

cpufreq_register_notifier() is called by arch/sparc64/kernel/time.c:time_init() which runs before the normal initcalls.

Signature · 3 lines
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
#5 lore raw

[Bug 11139] warning in cpufreq.c on E450

In reply to [email protected]

http://bugzilla.kernel.org/show_bug.cgi?id=11139

------- Comment #4 from [email protected] 2008-07-23 03:54 ------- (In reply to comment #3)

Quoted 11 lines

(In reply to comment #1)

Quoted 6 lines

This looks strange.

The warning is because init_cpufreq_transition_notifier_list_called is not set to true (yet). However, that should have been done in pure_initcall stage which is waaaaay before auxio_probe, which is at fs_initcall stage. Any experts on the ordering of initcalls, and why this is messed up here?

cpufreq_register_notifier() is called by arch/sparc64/kernel/time.c:time_init() which runs before the normal initcalls.

So, it's time again. I made the patch to add that warning because I made the same mistake on my s3c2410 cpufreq work (trying to register a transition notifier in the time setup code). The way I solved it was to move the cpufreq notifier registration for the time code to a separate function on the same file, which is called as a initcall. Since cpufreq doesn't actually do anything until late in the initcall sequence (or even later) because it needs the cpufreq cpu driver (which is usually a very late initcall or even a module), it causes no problem (except that now the notifier actually runs, which could expose untested code paths).

Signature · 3 lines
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
#6 lore raw

[Bug 11139] warning in cpufreq.c on E450

In reply to [email protected]

http://bugzilla.kernel.org/show_bug.cgi?id=11139

------- Comment #5 from [email protected] 2008-07-23 11:58 ------- Created an attachment (id=16954)
--> (http://bugzilla.kernel.org/attachment.cgi?id=16954&action=view)
bugfix -- register cpufreq notifier later

cpufreq notifiers may only be registered after pure_initcall.

Signature · 3 lines
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.