Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
PowerMac G5, thermal control [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
aguettinger
Tux's lil' helper
Tux's lil' helper


Joined: 26 Sep 2003
Posts: 84

PostPosted: Fri Nov 06, 2009 12:38 pm    Post subject: PowerMac G5, thermal control [solved] Reply with quote

I use gentoo on my amd64 box for some years now and just installed Gentoo on my PowerMac G5 Quad. Most things worked smoothly. Still I encountered some quirks. Maybe somebody knows how to get around them.

I have a problem with the windfarm driver for my G5 (windfarm_pm112). After boot most of the fans settle down but it sounds like one keeps running full speed (backside?), making the machine a lot louder than under OSX.

Edit: I get the following readout for an idle system:

from /sys/devices/platform/windfarm.0/
Fans:
Backside: 1100
CPU Front 0: 738
CPU Front 1: 738
CPU Pump 0: 1250
CPU Rear 0: 761
CPU Rear 1: 761
Drive Bay: 1000
Slots: 1560


grep -i windfarm /usr/src/linux/.config
CONFIG_WINDFARM=y
CONFIG_WINDFARM_PM81=y
CONFIG_WINDFARM_PM91=y
CONFIG_WINDFARM_PM112=y
CONFIG_WINDFARM_PM121=y

dmesg | grep windfarm
windfarm: Failed to create SMU RPM fan fan
windfarm: initializing for dual-core desktop G5
windfarm: CPUs control loops started.
windfarm: Backside control loop started.
windfarm: Slots control loop started.
windfarm: Drive bay control loop started.

cat /proc/cpuinfo
....
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

2. Gnome and X work fine, but I have a problem with the normal framebuffer. I use the default (nvidiafb). When scrolling around (e.g. in nano) the fonts get butchered and become ureadable until I move the cursor across them. Are there some options that I can use to get around that?

lspci -v

0000:0a:00.0 VGA compatible controller: nVidia Corporation NV43 [GeForce 6600] (rev a2) (prog-if 00 [VGA controller])
Subsystem: nVidia Corporation Device 0010
Flags: bus master, fast devsel, latency 0, IRQ 17
Memory at a8000000 (32-bit, non-prefetchable) [size=16M]
Memory at 90000000 (64-bit, prefetchable) [size=256M]
Memory at a9000000 (64-bit, non-prefetchable) [size=16M]
Expansion ROM at a0000000 [disabled] [size=128K]
Capabilities: [60] Power Management version 2
Capabilities: [68] Message Signalled Interrupts: Mask- 64bit+ Count=1/1 Enable-
Capabilities: [78] Express Endpoint, MSI 00
Capabilities: [100] Virtual Channel <?>
Capabilities: [128] Power Budgeting <?>
Kernel driver in use: nvidiafb

Edit: Maybe I should add that I use 32-bit userland.
uname -a
Linux orcabox 2.6.30-gentoo-r8 #9 SMP Sat Nov 7 00:52:37 CET 2009 ppc64 PPC970MP, altivec supported PowerMac11,2 GNU/Linux
_________________
regards
- andy


Last edited by aguettinger on Wed Nov 11, 2009 9:09 pm; edited 1 time in total
Back to top
View user's profile Send private message
bmaass
n00b
n00b


Joined: 15 Mar 2008
Posts: 25

PostPosted: Wed Nov 11, 2009 2:56 pm    Post subject: Re: PowerMac G5, thermal control Reply with quote

This is the problem I had, and I tracked the SMU fan error message to the platform windfarm driver in the kernel, specifically the file drivers/macintosh/windfarm_smu_controls.c, where there's no creation entry for a second pump control loop. I added one and it just works (tm).
Code:
--- windfarm_smu_controls.c     2008-04-01 20:00:08.000000000 +0200
+++ windfarm_smu_controls_dualpump.c    2008-04-01 19:59:44.000000000 +0200
@@ -202,6 +202,8 @@
                fct->ctrl.name = "cpu-front-fan-1";
        else if (!strcmp(l, "CPU A PUMP"))
                fct->ctrl.name = "cpu-pump-0";
+       else if (!strcmp(l, "CPU B PUMP"))
+               fct->ctrl.name = "cpu-pump-1";
        else if (!strcmp(l, "Slots Fan") || !strcmp(l, "Slots fan") ||
                 !strcmp(l, "EXPANSION SLOTS INTAKE"))
                fct->ctrl.name = "slots-fan";

Also, your framebuffer corruption. I had that too, and it's because nvidiafb sucks big time. I use the open driver, nouveau, and its framebuffer driver, nouveaufb. All dandy.
Back to top
View user's profile Send private message
aguettinger
Tux's lil' helper
Tux's lil' helper


Joined: 26 Sep 2003
Posts: 84

PostPosted: Wed Nov 11, 2009 8:12 pm    Post subject: Reply with quote

Thank you, that worked fine. Finally, silence. :D

Should we file a bug about this? Would be easier if this fix would make it in the kernel.
Unlikely that the if () would mess anything up on other systems.

Nouveau, I have to look into that.
_________________
regards
- andy
Back to top
View user's profile Send private message
bmaass
n00b
n00b


Joined: 15 Mar 2008
Posts: 25

PostPosted: Thu Nov 12, 2009 2:10 pm    Post subject: Reply with quote

I think one might contact Benjamin Herrenschmidt, he wrote the thing. I guess if it's two people having this problem already, it might be worth adding two lines of code, if it doesn't break anything for anybody else AND is actually a "fix" and not just masking the problem somehow (I can't claim I understood the driver when I poked around in there and stumbled on this).

Also, the file "windfarm_pm112.c" explicitly states:
Code:

/* Second pump isn't required (and isn't actually present) */

There's got to be some reason he assumed this to be true for all machines.
Back to top
View user's profile Send private message
aguettinger
Tux's lil' helper
Tux's lil' helper


Joined: 26 Sep 2003
Posts: 84

PostPosted: Sat Dec 05, 2009 2:50 pm    Post subject: PowerMac G5, thermal control [reopened] Reply with quote

bmaass wrote:
I think one might contact Benjamin Herrenschmidt, he wrote the thing. I guess if it's two people having this problem already, it might be worth adding two lines of code, if it doesn't break anything for anybody else AND is actually a "fix" and not just masking the problem somehow (I can't claim I understood the driver when I poked around in there and stumbled on this).

Also, the file "windfarm_pm112.c" explicitly states:
Code:

/* Second pump isn't required (and isn't actually present) */

There's got to be some reason he assumed this to be true for all machines.



Unfortunately, after upgrading to gentoo-sources-2.6.31-r6 and application of the same fix to windfarm_smu_controls.c I'm stuck with the old problem of one fan not being controlled and apparently also not listed in /sys/devices/platform/windfarm.0/
I checked that I correctly edited the corresponding file and that the right kernel is loaded.
Strangely there are no changes in the new kernel compared to gentoo-sources-2.6.30-r8 in windfarm_smu_controls.c or in windfarm_pm112.c. This might indicate that you were right that the fix only masked the problem somehow.

Since in both kernel versions I get similar fan speeds reported in /sys/devices/platform/windfarm.0/ for all the fans listed, but there is clearly a fan running at full speed with the newer kernel, my guess is that the windfarm controller is not correctly detecting all the fans in (at least some) of the Quad G5 machines. Furthermore, houldn't there be a cpu-pump-1 entry in /sys/devices/platform/windfarm.0/ ?
_________________
regards
- andy
Back to top
View user's profile Send private message
bmaass
n00b
n00b


Joined: 15 Mar 2008
Posts: 25

PostPosted: Sat Dec 05, 2009 3:04 pm    Post subject: Reply with quote

Nah, you did something wrong there. I'm running 2.6.32 and it's all fine here. In fact, I ran it up the chain to Ben Herrenschmidt who promised to have this patch included in the future.
Back to top
View user's profile Send private message
aguettinger
Tux's lil' helper
Tux's lil' helper


Joined: 26 Sep 2003
Posts: 84

PostPosted: Sat Dec 05, 2009 3:23 pm    Post subject: Reply with quote

Hm, what did I do wrong?

Code:
uname -a
Linux orcabox 2.6.31-gentoo-r6 #1 SMP Sat Dec 5 02:28:29 CET 2009 ppc64 PPC970MP, altivec supported PowerMac11,2 GNU/Linux



Code:
emerge --info
Portage 2.1.6.13 (default/linux/powerpc/ppc64/10.0/32bit-userland/desktop, gcc-4.3.4, glibc-2.9_p20081201-r2, 2.6.31-gentoo-r6 ppc64)
=================================================================
System uname: Linux-2.6.31-gentoo-r6-ppc64-PPC970MP,_altivec_supported-with-gentoo-1.12.13
Timestamp of tree: Fri, 04 Dec 2009 23:30:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p28
dev-java/java-config: 2.1.9-r1
dev-lang/python:     2.6.2-r1
dev-util/ccache:     2.4-r7
dev-util/cmake:      2.6.4
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.6.3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="ppc"
CBUILD="powerpc-unknown-linux-gnu"
CFLAGS="-mcpu=G5 -O2 -pipe -maltivec -mabi=altivec -fno-strict-aliasing"
CHOST="powerpc-unknown-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-mcpu=G5 -O2 -pipe -maltivec -mabi=altivec -fno-strict-aliasing"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo ftp://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo http://mirror.netcologne.de/gentoo/ ftp://mirror.leaseweb.com/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="en de"
MAKEOPTS="-j5"
PKGDIR="/opt/portage/packages/"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/x11 /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl alsa altivec apache2 avahi berkdb bluetooth branding bzip2 cairo cdr clamav cli consolekit cracklib crypt ctype cups cxx dbus dri dts dvd dvdr eds emacs emboss encode evo exif fam ffmpeg firefox flac fortran gcc64 gd gdbm gif gnome gpm gstreamer gtk hal iconv ipv6 java jpeg ldap libnotify libwww mad mikmod modules mp3 mp4 mpeg mplayer mudflap mysql ncurses nls nptl nptlonly ogg opengl openmp pam pcre pdf perl php png ppc ppds pppd python qt3support qt4 quicktime readline reflection sdl session spell spl sqlite ssl startup-notification svg sysfs tcpd thunar tiff truetype unicode usb vorbis x264 xml xorg xulrunner xv xvid zlib" ALSA_CARDS="snd-aoa usb-audio" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en de" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nv nouveau"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


Code:
grep -i pump /usr/src/linux/drivers/macintosh/windfarm_smu_controls.c
   else if (!strcmp(l, "CPU A PUMP"))
      fct->ctrl.name = "cpu-pump-0";
   else if (!strcmp(l, "CPU B PUMP"))
      fct->ctrl.name = "cpu-pump-1";


Code:
ls -l /usr/src/
total 8
lrwxrwxrwx  1 root root   22 2009-12-05 01:49 linux -> linux-2.6.31-gentoo-r6
drwxr-xr-x 23 root root 4096 2009-12-05 12:48 linux-2.6.30-gentoo-r8
drwxr-xr-x 24 root root 4096 2009-12-05 14:11 linux-2.6.31-gentoo-r6


Code:
dmesg | grep windfarm
windfarm: Failed to create SMU RPM fan fan
windfarm: initializing for dual-core desktop G5
windfarm: CPUs control loops started.
windfarm: Backside control loop started.
windfarm: Slots control loop started.
windfarm: Drive bay control loop started.


Code:
dmesg | grep gentoo
Linux version 2.6.31-gentoo-r6 (root@orcabox) (gcc version 4.1.2 (Gentoo 4.1.2 p1.0.1)) #1 SMP Sat Dec 5 02:28:29 CET 2009


Already compiled several times, copied to /boot and ybin -y.
So I don't know what I did wrong.
Furthermore, it bothers me that the fan readings in /sys/devices/platform/windfarm.0/ are identical, but clearly one fan doesn't run at the same speed. So one fan is either not being reported or something is broken.
_________________
regards
- andy
Back to top
View user's profile Send private message
aguettinger
Tux's lil' helper
Tux's lil' helper


Joined: 26 Sep 2003
Posts: 84

PostPosted: Sat Dec 05, 2009 3:33 pm    Post subject: Reply with quote

bmaass wrote:
Nah, you did something wrong there. I'm running 2.6.32 and it's all fine here. In fact, I ran it up the chain to Ben Herrenschmidt who promised to have this patch included in the future.


Can you give me the exact kernel revision you use from unstable then I will try that.
_________________
regards
- andy
Back to top
View user's profile Send private message
bmaass
n00b
n00b


Joined: 15 Mar 2008
Posts: 25

PostPosted: Sat Dec 05, 2009 3:42 pm    Post subject: Reply with quote

aguettinger wrote:
Can you give me the exact kernel revision you use from unstable then I will try that.
Uh, I'm just using 2.6.32-gentoo from portage. I did nothing different with this version, and it works like it always did. I just sync, eselect new kernel, patch source, build, copy to /boot, update /etc/yaboot.conf, ybin -v and eventually reboot...
Back to top
View user's profile Send private message
aguettinger
Tux's lil' helper
Tux's lil' helper


Joined: 26 Sep 2003
Posts: 84

PostPosted: Sat Dec 05, 2009 6:26 pm    Post subject: Reply with quote

Hold the horses, I found the problem. You were right, I did something wrong even so I did nothing wrong.
After an unsuccessful try with kernel-2.6.32-gentoo I reinstalled gentoo-sources-2.6.30-r8, applied the patch again and voila, I didn't work. 8O
Now I had two identical kernels with exactly the same size and one worked and the other not. :?
After some hair-pulling I looked at the edited file in scite editor by chance and it looked like that:

Code:

   else if (!strcmp(l, "CPU A PUMP"))
      fct->ctrl.name = "cpu-pump-0";
   else if (!strcmp(l, "CPU B PUMP"))
      fct->ctrl.name = "cpu-pump-1";


Turned out that the special characters apparently were inserted when I did SHIFT-SPACE (holding SHIFT and SPACE) and are not shown in the console (cat, nano or vim).
I still have to find out what causes this. :oops:
But after correctly editing the files in scite and compiling all works fine again with whatever kernel. Thanks.
_________________
regards
- andy
Back to top
View user's profile Send private message
bmaass
n00b
n00b


Joined: 15 Mar 2008
Posts: 25

PostPosted: Tue Jan 05, 2010 1:07 pm    Post subject: Reply with quote

Quick info: the patch seems to have made it to the stable kernel and is in gentoo-2.6.32-r1. You no longer will have to patch it yourself.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum