Now, the question is: Why? What has changed between 4.16 and 4.17 that makes
this necessary? And, is it a bug or a feature?
To finally get back to you about this "windfarm" business I can tell you
that an out-of-the-box build of the latest stable kernel results in all
the expected windfarm modules and functions :
nix:~# uname -r
4.18.5-genunix
nix# cd /lib/modules/`uname -r`/kernel/drivers/macintosh/
nix# ls -lap windfarm*
-rw-r--r-- 1 root root 344600 Aug 26 01:07 windfarm_ad7417_sensor.ko
-rw-r--r-- 1 root root 365640 Aug 26 01:07 windfarm_core.ko
-rw-r--r-- 1 root root 243776 Aug 26 01:07 windfarm_cpufreq_clamp.ko
-rw-r--r-- 1 root root 381440 Aug 26 01:07 windfarm_fcu_controls.ko
-rw-r--r-- 1 root root 326608 Aug 26 01:07 windfarm_lm75_sensor.ko
-rw-r--r-- 1 root root 326792 Aug 26 01:07 windfarm_lm87_sensor.ko
-rw-r--r-- 1 root root 250144 Aug 26 01:07 windfarm_max6690_sensor.ko
-rw-r--r-- 1 root root 202544 Aug 26 01:07 windfarm_pid.ko
-rw-r--r-- 1 root root 280760 Aug 26 01:07 windfarm_pm112.ko
-rw-r--r-- 1 root root 366920 Aug 26 01:07 windfarm_pm121.ko
-rw-r--r-- 1 root root 296856 Aug 26 01:07 windfarm_pm72.ko
-rw-r--r-- 1 root root 348776 Aug 26 01:07 windfarm_pm81.ko
-rw-r--r-- 1 root root 347064 Aug 26 01:07 windfarm_pm91.ko
-rw-r--r-- 1 root root 286944 Aug 26 01:07 windfarm_rm31.ko
-rw-r--r-- 1 root root 338512 Aug 26 01:07 windfarm_smu_controls.ko
-rw-r--r-- 1 root root 282864 Aug 26 01:07 windfarm_smu_sat.ko
-rw-r--r-- 1 root root 345704 Aug 26 01:07 windfarm_smu_sensors.ko
nix#
Why pm112 or lm75 as opposed to pm121 or lm87 would require some digging
around. Also not really all that interested.
The windfarm module seems to arrive at around five seconds into the boot
process :
[ 5.246559] windfarm: initializing for dual-core desktop G5
[ 5.552845] windfarm: CPUs control loops started.
Then seven secs later we see :
[ 12.616633] windfarm: Backside control loop started.
[ 12.669413] windfarm: Slots control loop started.
[ 12.774329] windfarm: Drive bay control loop started.
So clearly doing "something".
root@nix:~# lsmod | grep -i "wind"
windfarm_cpufreq_clamp 3725 1
windfarm_max6690_sensor 4463 1
windfarm_lm75_sensor 4957 1
windfarm_smu_sensors 7991 1
windfarm_smu_controls 8646 8
windfarm_pm112 15016 0
windfarm_smu_sat 8232 9 windfarm_pm112
windfarm_pid 3379 1 windfarm_pm112
windfarm_core 11943 7
windfarm_cpufreq_clamp,windfarm_smu_controls,windfarm_max6690_sensor,windfarm_smu_sat,windfarm_smu_sensors,windfarm_lm75_sensor,windfarm_pm112
root@nix:~#
root@nix:~# ls -la /sys/devices/platform/windfarm.0/
total 0
drwxr-xr-x 3 root root 0 Aug 26 20:10 .
drwxr-xr-x 13 root root 0 Aug 26 19:57 ..
-rw-r--r-- 1 root root 4096 Aug 26 20:10 backside-fan
-r--r--r-- 1 root root 4096 Aug 26 20:10 backside-temp
-r--r--r-- 1 root root 4096 Aug 26 20:10 cpu-current-0
-r--r--r-- 1 root root 4096 Aug 26 20:10 cpu-current-1
-r--r--r-- 1 root root 4096 Aug 26 20:10 cpu-current-2
-r--r--r-- 1 root root 4096 Aug 26 20:10 cpu-current-3
-rw-r--r-- 1 root root 4096 Aug 26 20:10 cpufreq-clamp
-rw-r--r-- 1 root root 4096 Aug 26 20:10 cpu-front-fan-0
-rw-r--r-- 1 root root 4096 Aug 26 20:10 cpu-front-fan-1
-r--r--r-- 1 root root 4096 Aug 26 20:10 cpu-power-0
-r--r--r-- 1 root root 4096 Aug 26 20:10 cpu-power-1
-r--r--r-- 1 root root 4096 Aug 26 20:10 cpu-power-2
-r--r--r-- 1 root root 4096 Aug 26 20:10 cpu-power-3
-rw-r--r-- 1 root root 4096 Aug 26 20:10 cpu-pump-0
-rw-r--r-- 1 root root 4096 Aug 26 20:10 cpu-rear-fan-0
-rw-r--r-- 1 root root 4096 Aug 26 20:10 cpu-rear-fan-1
-r--r--r-- 1 root root 4096 Aug 26 20:10 cpu-temp-0
-r--r--r-- 1 root root 4096 Aug 26 20:10 cpu-temp-1
-r--r--r-- 1 root root 4096 Aug 26 20:10 cpu-temp-2
-r--r--r-- 1 root root 4096 Aug 26 20:10 cpu-temp-3
-r--r--r-- 1 root root 4096 Aug 26 20:10 cpu-voltage-0
-r--r--r-- 1 root root 4096 Aug 26 20:10 cpu-voltage-1
-r--r--r-- 1 root root 4096 Aug 26 20:10 cpu-voltage-2
-r--r--r-- 1 root root 4096 Aug 26 20:10 cpu-voltage-3
-rw-r--r-- 1 root root 4096 Aug 26 20:10 drive-bay-fan
lrwxrwxrwx 1 root root 0 Aug 26 20:10 driver ->
../../../bus/platform/drivers/windfarm
-rw-r--r-- 1 root root 4096 Aug 26 20:10 driver_override
-r--r--r-- 1 root root 4096 Aug 26 20:10 hd-temp
-r--r--r-- 1 root root 4096 Aug 26 20:10 modalias
drwxr-xr-x 2 root root 0 Aug 26 20:10 power
-rw-r--r-- 1 root root 4096 Aug 26 20:10 slots-fan
-r--r--r-- 1 root root 4096 Aug 26 20:10 slots-power
lrwxrwxrwx 1 root root 0 Aug 26 19:57 subsystem -> ../../../bus/platform
-rw-r--r-- 1 root root 4096 Aug 26 19:57 uevent
root@nix:~#
nix# modinfo -d windfarm_lm75_sensor
LM75 sensor objects for PowerMacs thermal control
nix# modinfo -d windfarm_pm112
Thermal control for PowerMac11,2
nix# modinfo -d windfarm_smu_controls
SMU control objects for PowerMacs thermal control
Where there ya go ... seems to be hardware version stuff.
nix# cd /sys/devices/platform/
nix# ls
alarmtimer i2c-powermac.1 i2c-powermac.3 power serial8250
uevent
i2c-powermac.0 i2c-powermac.2 i2c-powermac.4 rtc-generic smu
windfarm.0
nix#
I have no idea if any of the data from those various windfarm elements
is accurate or even if the hardware exists and makes sense :
windfarm.0/backside-fan 1100 RPM
windfarm.0/backside-temp 63.000
windfarm.0/cpu-current-0 6.835
windfarm.0/cpu-current-1 7.812
windfarm.0/cpu-current-2 9.152
windfarm.0/cpu-current-3 9.031
windfarm.0/cpufreq-clamp 0
windfarm.0/cpu-front-fan-0 771 RPM
windfarm.0/cpu-front-fan-1 771 RPM
windfarm.0/cpu-power-0 8.912
windfarm.0/cpu-power-1 9.899
windfarm.0/cpu-power-2 11.909
windfarm.0/cpu-power-3 12.347
windfarm.0/cpu-pump-0 1250 RPM
windfarm.0/cpu-rear-fan-0 796 RPM
windfarm.0/cpu-rear-fan-1 796 RPM
windfarm.0/cpu-temp-0 44.031
windfarm.0/cpu-temp-1 45.890
windfarm.0/cpu-temp-2 41.140
windfarm.0/cpu-temp-3 43.062
windfarm.0/cpu-voltage-0 1.303
windfarm.0/cpu-voltage-1 1.267
windfarm.0/cpu-voltage-2 1.301
windfarm.0/cpu-voltage-3 1.367
windfarm.0/drive-bay-fan 1000 RPM
windfarm.0/driver_override (null)
windfarm.0/hd-temp 33.500
windfarm.0/modalias platform:windfarm
windfarm.0/slots-fan 1560 RPM
windfarm.0/slots-power 18.618
the last little ascii file contains :
windfarm.0/uevent
DRIVER=windfarm
MODALIAS=platform:windfarm
So "windfarm" bits seem to be in good shape in the latest kernel release
and seem to work fine. Not sure I accept that the backside of a G5 is at
the rather hot level of 63C. I had a Fluke infrared thermometer laying
around at one point but can't find it at the moment. My available and
poorly calibrated finger test tells me there is no way the backside of
that box is anywhere near 60C or even 40C.
I attached compressed output txt from dmesg.
Would you be so kind as to run the following code snippit for me ?
#define _XOPEN_SOURCE 600
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <errno.h>
#include <unistd.h>
#include <limits.h>
#include <locale.h>
#include <sys/sysinfo.h>
#include <sys/utsname.h>
int main(int argc, char *argv[])
{
int errno, pgsz, procs, avprocs;
long int phys, avphys;
long int sysconf_phys, sysconf_avphys, sysconf_pgsz;
long int sysconf_procs, sysconf_avprocs;
struct utsname uname_data;
setlocale( LC_MESSAGES, "C" );
if ( uname( &uname_data ) < 0 ) {
fprintf ( stderr,
"WARNING : Could not attain system uname data.\n" );
perror ( "uname" );
} else {
printf ( "-------------------------------" );
printf ( "------------------------------\n" );
printf ( " system name = %s\n", uname_data.sysname );
printf ( " node name = %s\n", uname_data.nodename );
printf ( " release = %s\n", uname_data.release );
printf ( " version = %s\n", uname_data.version );
printf ( " machine = %s\n", uname_data.machine );
printf ( "-------------------------------" );
printf ( "------------------------------" );
}
printf ("\n");
sysconf_phys = sysconf(_SC_PHYS_PAGES);
if (sysconf_phys<0){
fprintf(stderr,
"WARNING : Could not attain sysconf(_SC_PHYS_PAGES).\n");
perror("sysconf(_SC_PHYS_PAGES)");
errno = 0;
}else{
printf(" sysconf_phys = %i\n", sysconf_phys);
}
sysconf_avphys = sysconf(_SC_AVPHYS_PAGES);
if (sysconf_avphys<0){
fprintf(stderr,
"WARNING : Could not attain sysconf(_SC_PHYS_PAGES).\n");
perror("sysconf(_SC_AVPHYS_PAGES)");
errno = 0;
}else{
printf(" sysconf_avphys = %i\n", sysconf_avphys);
}
pgsz = getpagesize();
if (pgsz<0){
fprintf(stderr,
"WARNING : Could not attain getpagesize().\n");
perror("getpagesize()");
errno = 0;
}else{
printf(" pgsz = %i\n", pgsz);
}
phys = get_phys_pages();
if (phys<0){
fprintf(stderr,
"WARNING : Could not attain get_phys_pages().\n");
perror("get_phys_pages()");
errno = 0;
}else{
printf(" phys = %i\n", phys);
}
avphys = get_avphys_pages();
if (avphys<0){
fprintf(stderr,
"WARNING : Could not attain get_avphys_pages().\n");
perror("get_avphys_pages()");
errno = 0;
}else{
printf(" avphys = %i\n", avphys);
}
/* may as well guess at the available and physical memory */
printf("Total physical memory may be %12ld bytes.\n",
sysconf_phys * (long int)pgsz );
printf(" Available memory may be %12ld bytes.\n",
sysconf_avphys * (long int)pgsz );
/* would be nice to get swap amount but I have no idea on that */
avprocs = get_nprocs();
printf("get_nprocs() claims %i processors are available.\n",
avprocs );
procs = get_nprocs_conf();
printf("get_nprocs_conf() claims %i processors are configured.\n",
procs );
sysconf_avprocs = sysconf(_SC_NPROCESSORS_ONLN);
if (sysconf_avprocs<0){
fprintf(stderr,
"WARNING : Could not attain sysconf(_SC_NPROCESSORS_ONLN).\n");
perror("sysconf(_SC_NPROCESSORS_ONLN)");
errno = 0;
}else{
printf("sysconf(_SC_NPROCESSORS_ONLN) reports %i",
sysconf_avprocs );
printf(" processors are available.\n");
}
sysconf_procs = sysconf(_SC_NPROCESSORS_CONF);
if (sysconf_procs<0){
fprintf(stderr,
"WARNING : Could not attain sysconf(_SC_NPROCESSORS_CONF).\n");
perror("sysconf(_SC_NPROCESSORS_CONF)");
errno = 0;
}else{
printf("sysconf(_SC_NPROCESSORS_CONF) reports %i",
sysconf_procs );
printf(" processors are configured.\n");
}
return EXIT_SUCCESS;
}
I see :
nix$ ./pagesize
-------------------------------------------------------------
system name = Linux
node name = nix
release = 4.18.5-genunix
version = #1 SMP Sat Aug 25 16:18:55 GMT 2018
machine = ppc64
-------------------------------------------------------------
sysconf_phys = 2023314
sysconf_avphys = 1888014
pgsz = 4096
phys = 2023314
avphys = 1888014
Total physical memory may be 8287494144 bytes.
Available memory may be 7733305344 bytes.
get_nprocs() claims 3 processors are available.
get_nprocs_conf() claims 4 processors are configured.
sysconf(_SC_NPROCESSORS_ONLN) reports 3 processors are available.
sysconf(_SC_NPROCESSORS_CONF) reports 4 processors are configured.
nix$
I took a cpu offline with :
nix:~# echo "0" > /sys/devices/system/cpu/cpu2/online
Even though I took cpu 2 offline the windfarm bits still report the same
sort of data as before :
nix$ cd /sys/devices/platform
nix$ cat /proc/cpuinfo
processor : 0
cpu : PPC970MP, altivec supported
clock : 2500.000000MHz
revision : 1.1 (pvr 0044 0101)
processor : 1
cpu : PPC970MP, altivec supported
clock : 2500.000000MHz
revision : 1.1 (pvr 0044 0101)
processor : 3
cpu : PPC970MP, altivec supported
clock : 2500.000000MHz
revision : 1.1 (pvr 0044 0101)
timebase : 33333333
platform : PowerMac
model : PowerMac11,2
machine : PowerMac11,2
motherboard : PowerMac11,2 MacRISC4 Power Macintosh
detected as : 337 (PowerMac G5 Dual Core)
pmac flags : 00000000
L2 cache : 1024K unified
pmac-generation : NewWorld
nix$
nix$ cd /sys/devices/platform
nix$ cat windfarm.0/cpu-current-2 windfarm.0/cpu-power-2
windfarm.0/cpu-temp-2 windfarm.0/cpu-voltage-2
7.566
9.845
40.687
1.301
nix$
So .. makes me wonder what those numbers mean.
I could look in the sources.
Dennis