Windfarm/modules trouble

Markus Demleitner msdemlei at cl.uni-heidelberg.de
Sat Dec 3 02:30:50 EST 2005


Hi,

I've been trying out the windfarm system in 2.6.15-rc3 on a iMac G5
today.  I like the general architecture a lot, but of course with
abstraction comes a somewhat steep learning curve, in particular if
you (like me) aren't really a kernel guy.  So, sorry for not sending
useful patches.

First off, compiling the stuff statically works, but the fans are
more active than they are in OS X or with my hacked simpleTemp.  I
wanted to find out why, and to save me some rebooting, I tried to
compile windfarm as modules.

Minor trouble: windfarm_pid.c is missing 

MODULE_AUTHOR("Benjamin Herrenschmidt <benh at kernel.crashing.org>");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("PID algorithm for thermal control");

at its end, so you get "kernel tainted" messages.

What is worse, the control loop doesn't run after you say
modprobe windfarm_pm81.  To get some idea why, I sprinkled
windfarm_core with DBG-statements.  wf_notify says "No notifiers" if
the notifier chain is empty and otherwise prints the list head and
next.  Here's what happens:

Dec  2 15:59:10 miller kernel: windfarm: Initializing for iMacG5 model ID 5
Dec  2 15:59:10 miller kernel: Windfarm compatible, init: 0
Dec  2 15:59:10 miller kernel: wf: Registered control system-fan
Dec  2 15:59:10 miller kernel: No notifiers! 
Dec  2 15:59:10 miller kernel: wf: Registered control cpu-fan
Dec  2 15:59:10 miller kernel: wf: Registered sensor cpu-temp
Dec  2 15:59:10 miller kernel: wf: Registered sensor cpu-current
Dec  2 15:59:10 miller kernel: wf: Registered sensor cpu-voltage
Dec  2 15:59:10 miller kernel: wf: Registered sensor cpu-power
Dec  2 15:59:10 miller kernel: wf: Registered sensor hd-temp
(up to here, No notifiers continued, but I've clipped it)

Dec  2 15:59:10 miller kernel: Driver register.
Dec  2 15:59:10 miller kernel: wf... PROBE....register called...
(these are my DBGs from windfarm_pm81:wf_smu_probe and wf_register_client,
so that one works, so there's now one function in the notifier
chain, wf_smu_notify:)
Dec  2 15:59:10 miller kernel: Current chain head: 103638
Dec  2 15:59:10 miller kernel: Current chain next: 0
(these continue throughout, but I've clipped them again)
Dec  2 15:59:10 miller kernel: wf: new control cpu-fan detected
Dec  2 15:59:10 miller kernel: wf: new control system-fan detected
Dec  2 15:59:10 miller kernel: wf: new sensor hd-temp detected
Dec  2 15:59:10 miller kernel: wf: new sensor cpu-power detected
Dec  2 15:59:10 miller kernel: wf: new sensor cpu-voltage detected
Dec  2 15:59:10 miller kernel: wf: new sensor cpu-current detected
Dec  2 15:59:10 miller kernel: wf: new sensor cpu-temp detected
Dec  2 15:59:10 miller kernel: wf: thread started
Dec  2 15:59:10 miller kernel: wf: notify called
(this guy comes from wf_thread_func, after time_after_eq)

Dec  2 15:59:10 miller kernel: register failed...
(and this one now from wf_register_client, after the bail: label.  I
guess that's where the trouble starts, but I have no idea why this
fails)

Well, that's it, afterwards one sees the the thread running and call
wf_smu_probe, but no pid.  Hints, anyone?

Other issues (I haven't really looked into any of them yet):

(1) You cannot unload the windfarm_core once it's loaded because there
still remain references into windfarm_smu_sensors:

miller$ sudo modprobe windfarm_pm81
miller$ lsmod
Module                  Size  Used by
windfarm_lm75_sensor     8872  1 
windfarm_smu_sensors    10864  4 
windfarm_smu_controls     8608  2 
windfarm_pm81          18216  0 
windfarm_core          20824  4 windfarm_lm75_sensor,windfarm_smu_sensors,windfarm_smu_controls,windfarm_pm81
windfarm_pid            4984  1 windfarm_pm81
[crap clipped]
miller$ sudo rmmod windfarm_pm81  windfarm_pid  windfarm_smu_controls windfarm_lm75_sensor
miller$ lsmod
Module                  Size  Used by
windfarm_smu_sensors    10864  2 
windfarm_core          20824  1 windfarm_smu_sensors

Of course, kwindfarm still runs.

(2) After that, modprobing windfarm_pm81 again results in an Oops:

Unable to handle kernel paging request for data at address 0x17f03280302b8b91  
Faulting instruction address: 0xc00000000019b098  
Oops: Kernel access of bad area, sig: 11 [#1]  
PREEMPT SMP NR_CPUS=2 POWERMAC   
Modules linked in: windfarm_lm75_sensor windfarm_smu_controls windfarm_pm81 windfarm_pid windfarm_smu_sensors windfarm_core cpufreq_powersave cpufreq_conservative cpufreq_ondemand usb_storage  
NIP: C00000000019B098 LR: C00000000032FF90 CTR: C00000000028E250  
REGS: c00000001b233680 TRAP: 0300   Not tainted  (2.6.15-rc3)  
MSR: 9000000000009032 <EE,ME,IR,DR>  CR: 24002488  XER: 20000000  
DAR: 17F03280302B8B91, DSISR: 0000000040000000  
TASK = c00000001b19e040[1551] 'modprobe' THREAD: c00000001b230000 CPU: 0  
GPR00: C00000000032FFCC C00000001B233900 C0000000004BD4C0 17F03280302B8B91   
GPR04: C0000000004B53B8 C000000000EE0568 FFFFFFFFFFFFFFED C000000000408D38   
GPR08: C0000000004F1C00 C000000000430DA8 0000000000000000 0000000000000000   
GPR12: 0000000024002442 C0000000003F7C00 00000000100170B8 0000000000000000
GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000   
GPR20: 0000000000000000 00000000100013A4 000000001001DF18 000000001001DC98   
GPR24: 0000000000000000 0000000000000000 0000000000000000 0000000000000000   
GPR28: D00000000010ACE0 17F03280302B8B79 C00000001B233A80 17F03280302B8B81   
NIP [C00000000019B098] .kref_get+0x0/0x24  
Call Trace:  
[C00000001B233990] [C00000000022541C] .next_device+0x10/0x38  
[C00000001B233A10] [C0000000002254CC] .bus_for_each_dev+0x88/0xcc  
[C00000001B233AC0] [C00000000022666C] .driver_attach+0x28/0x40  
[C00000001B233B40] [C000000000225C54] .bus_add_driver+0xc8/0x1dc  
[C00000001B233BF0] [C000000000226D0C] .driver_register+0x58/0x74  
[C00000001B233C80] [C00000000028E9C8] .i2c_add_driver+0x78/0x188  
[C00000001B233D10] [D000000000109588] .wf_lm75_sensor_init+0x1c/0x40 [windfarm_lm75_sensor]  
[C00000001B233D90] [C0000000000667AC] .sys_init_module+0x2a0/0x4f8  
[C00000001B233E30] [C000000000008600] syscall_exit+0x0/0x18  
Instruction dump:  
7d635b78 e8010010 eba1ffe8 ebc1fff0 ebe1fff8 7c0803a6 4e800020 7c0c0378   
4bffff88 38000001 90030000 4e800020 <80030000> 21200000 7c090114 0b000000   
 <6>note: modprobe[1551] exited with preempt_count 1

Cheers,

        Markus




More information about the Linuxppc64-dev mailing list