linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* temp.c and cputable.c issues
@ 2004-01-14 19:39 valvoline
  2004-01-14 22:10 ` Tom Rini
  0 siblings, 1 reply; 14+ messages in thread
From: valvoline @ 2004-01-14 19:39 UTC (permalink / raw)
  To: linuxppc-dev


hi folks!,

i'm running the last stable kernel tree with benh r1 patches (2.6.1-r1 under gentoo).

i've enabled TAU and CPUFREQ, and compiled everything...all seems to go well,
but looking into a dmesg from kernel i'm receiving this message:

...
Thermal assist unit not available
...

looking into /usr/src/linux/arch/ppc/kernel/cputable.c i've noticed that all
7455 based machine, have the CPU_FTR_TAU feature disabled, so i've patched the
file as in the included patch...now all seems to works fine!.

cputemperature is shown in /proc/cpuinfo, and all the infos seems to be
good calibrated and really near to real-world values.

Actually, i'm writing a dockapp for wm, and i've noticed some troubles in temperature;
after put my cpu to low-power with an:

'echo -n "0:600000:600000:performance" > /proc/cpufreq'

the value temperature in /proc/cpuinfo start to grow-up with NOSENSE...seems
that every 1sec-tick, the temperature value (both high and low) increment of
1 unit...at 68°-69° stop is race and the value remain at this point with
further changes; no matter if the cpuload is 0% or 100%...the value is
completely stalled.

If i restore the cpu to high-power with an:

'echo -n "0:900000:900000:performance" > /proc/cpufreq'

the temperature in /proc/cpuinfo start to grow down, and the values returns
to be correctly and with a real-life attinency.

Looking into sources under /usr/src/linux/arch/ppc/kernel/temp.c, i've
investigated around the lines concerning the TAU_update, and seems that
the double-if above:

...
        if((thrm = mfspr(SPRN_THRM2)) & THRM1_TIV){ /* is valid? */
	                if(thrm & THRM1_TIN){ /* crossed high threshold */
...

after switching down the cpu-freq, is every true!

I think that the problem is in interrupts enabling/disabling during the
'cpu_set_speed' function into pmac_cpufreq.c, but i've no ideas on howto check
it...perhaps some guru, can give a more comprensive answer.


any suggests/comments, are welcome,

regards
--
[ valvoline :: VRL Team :: s0ftpj :: freaknet Medialab :: GPG key available  ]
[ key fingerprint :: - :: B7E2 48BC 705F AE8F 9ABE  E422 076A 2561 1D67 B4DD ]
[ GPG key available on keyserver :: pgp.mit.edu :: with keyID :: 1D67B4DD :: ]

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: temp.c and cputable.c issues
  2004-01-14 22:10 ` Tom Rini
@ 2004-01-14 20:11   ` valvoline
  2004-01-14 22:38     ` Tom Rini
  2004-01-15  8:19     ` Colin Leroy
  0 siblings, 2 replies; 14+ messages in thread
From: valvoline @ 2004-01-14 20:11 UTC (permalink / raw)
  To: Tom Rini; +Cc: linuxppc-dev


On Wed, Jan 14, 2004 at 03:10:18PM -0700, Tom Rini wrote:

> There are errata documents from Motorola that tell you not to use the
> TAU on any 745x CPU.  The omission of this flag is intentional.

what's about this documents ?, if TAU is disabled what's the right way
to fetch thermal infos for 745x based CPUs ?, any workaround or suggested
url to start from ?

regards

--
[ valvoline :: VRL Team :: s0ftpj :: freaknet Medialab :: GPG key available  ]
[ key fingerprint :: - :: B7E2 48BC 705F AE8F 9ABE  E422 076A 2561 1D67 B4DD ]
[ GPG key available on keyserver :: pgp.mit.edu :: with keyID :: 1D67B4DD :: ]

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: temp.c and cputable.c issues
  2004-01-14 19:39 temp.c and cputable.c issues valvoline
@ 2004-01-14 22:10 ` Tom Rini
  2004-01-14 20:11   ` valvoline
  0 siblings, 1 reply; 14+ messages in thread
From: Tom Rini @ 2004-01-14 22:10 UTC (permalink / raw)
  To: valvoline; +Cc: linuxppc-dev


On Wed, Jan 14, 2004 at 08:39:10PM +0100, valvoline wrote:

> i've enabled TAU and CPUFREQ, and compiled everything...all seems to go well,
> but looking into a dmesg from kernel i'm receiving this message:
>
> ...
> Thermal assist unit not available
> ...
>
> looking into /usr/src/linux/arch/ppc/kernel/cputable.c i've noticed that all
> 7455 based machine, have the CPU_FTR_TAU feature disabled, so i've patched the
> file as in the included patch...now all seems to works fine!.

There are errata documents from Motorola that tell you not to use the
TAU on any 745x CPU.  The omission of this flag is intentional.

--
Tom Rini
http://gate.crashing.org/~trini/

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: temp.c and cputable.c issues
  2004-01-14 20:11   ` valvoline
@ 2004-01-14 22:38     ` Tom Rini
  2004-01-15  8:19     ` Colin Leroy
  1 sibling, 0 replies; 14+ messages in thread
From: Tom Rini @ 2004-01-14 22:38 UTC (permalink / raw)
  To: valvoline; +Cc: linuxppc-dev


On Wed, Jan 14, 2004 at 09:11:53PM +0100, valvoline wrote:
> On Wed, Jan 14, 2004 at 03:10:18PM -0700, Tom Rini wrote:
>
> > There are errata documents from Motorola that tell you not to use the
> > TAU on any 745x CPU.  The omission of this flag is intentional.
>
> what's about this documents ?, if TAU is disabled what's the right way
> to fetch thermal infos for 745x based CPUs ?, any workaround or suggested
> url to start from ?

There are no workarounds or planned fixes for this errata (it varries
slightly in number from 7450/1 to 7455 to 7457 documents I think).  All
errata can be gotten from Motorolas website.
7450:
http://e-www.motorola.com/webapp/sps/site/prod_summary.jsp?code=MPC7450_ARCHIVED
7451:
http://e-www.motorola.com/webapp/sps/site/prod_summary.jsp?code=MPC7451
7455:
http://e-www.motorola.com/webapp/sps/site/prod_summary.jsp?code=MPC7455
7457:
http://e-www.motorola.com/webapp/sps/site/prod_summary.jsp?code=MPC7457

--
Tom Rini
http://gate.crashing.org/~trini/

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: temp.c and cputable.c issues
  2004-01-15  8:19     ` Colin Leroy
@ 2004-01-15  7:03       ` valvoline
  2004-01-15  7:16       ` valvoline
  2004-01-15  7:20       ` valvoline
  2 siblings, 0 replies; 14+ messages in thread
From: valvoline @ 2004-01-15  7:03 UTC (permalink / raw)
  To: Colin Leroy


On Thu, Jan 15, 2004 at 09:19:37AM +0100, Colin Leroy wrote:

> What's your computer model ?
> You can try to do a
> `find /proc/device-tree -name fan|grep -v aliases`

i've an ibook G4/12". it's branded as PowerMac6,3. It should be
the lastest model available from apple.

> You may have an external chipset used to check temperatures and control
> the fan.

sure. there's an external chipset for temperature and fan control.
Under Macos X, i've set and get values from it several times...but
what about linux ?

--
[ valvoline :: VRL Team :: s0ftpj :: freaknet Medialab :: GPG key available  ]
[ key fingerprint :: - :: B7E2 48BC 705F AE8F 9ABE  E422 076A 2561 1D67 B4DD ]
[ GPG key available on keyserver :: pgp.mit.edu :: with keyID :: 1D67B4DD :: ]

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: temp.c and cputable.c issues
  2004-01-15  8:19     ` Colin Leroy
  2004-01-15  7:03       ` valvoline
@ 2004-01-15  7:16       ` valvoline
  2004-01-15  9:32         ` Colin Leroy
  2004-01-15  7:20       ` valvoline
  2 siblings, 1 reply; 14+ messages in thread
From: valvoline @ 2004-01-15  7:16 UTC (permalink / raw)
  To: Colin Leroy; +Cc: linuxppc-dev


On Thu, Jan 15, 2004 at 09:19:37AM +0100, Colin Leroy wrote:

> You may have an external chipset used to check temperatures and control
> the fan.

to be exact, there's an i2c thermostat named adt7467:

http://www.analog.com/UploadedFiles/Data_Sheets/115254175ADT7467_pra.pdf

i've tried to use it, but the module is not compatible with i2c_west and
soundcard, so the system hangs with no further response! (=

without the soundcards, the module load correctly, but i can't see
any new special device under /dev nor /proc...perhaps, the support is
stille experimental, or i've done some mistake in loading.

--
[ valvoline :: VRL Team :: s0ftpj :: freaknet Medialab :: GPG key available  ]
[ key fingerprint :: - :: B7E2 48BC 705F AE8F 9ABE  E422 076A 2561 1D67 B4DD ]
[ GPG key available on keyserver :: pgp.mit.edu :: with keyID :: 1D67B4DD :: ]

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: temp.c and cputable.c issues
  2004-01-15  8:19     ` Colin Leroy
  2004-01-15  7:03       ` valvoline
  2004-01-15  7:16       ` valvoline
@ 2004-01-15  7:20       ` valvoline
  2 siblings, 0 replies; 14+ messages in thread
From: valvoline @ 2004-01-15  7:20 UTC (permalink / raw)
  To: linuxppc-dev


On Thu, Jan 15, 2004 at 09:19:37AM +0100, Colin Leroy wrote:

> What's your computer model ?
> You can try to do a
> `find /proc/device-tree -name fan|grep -v aliases`

i've an iBook G4/12"/firewire. it's branded as PowerMac6,3 and it should
be the lastest available from apple.

--
[ valvoline :: VRL Team :: s0ftpj :: freaknet Medialab :: GPG key available  ]
[ key fingerprint :: - :: B7E2 48BC 705F AE8F 9ABE  E422 076A 2561 1D67 B4DD ]
[ GPG key available on keyserver :: pgp.mit.edu :: with keyID :: 1D67B4DD :: ]

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: temp.c and cputable.c issues
  2004-01-14 20:11   ` valvoline
  2004-01-14 22:38     ` Tom Rini
@ 2004-01-15  8:19     ` Colin Leroy
  2004-01-15  7:03       ` valvoline
                         ` (2 more replies)
  1 sibling, 3 replies; 14+ messages in thread
From: Colin Leroy @ 2004-01-15  8:19 UTC (permalink / raw)
  To: linuxppc-dev


> On Wed, Jan 14, 2004 at 03:10:18PM -0700, Tom Rini wrote:
>
> > There are errata documents from Motorola that tell you not to use the
> > TAU on any 745x CPU.  The omission of this flag is intentional.
>
> what's about this documents ?, if TAU is disabled what's the right way
> to fetch thermal infos for 745x based CPUs ?, any workaround or
suggested
> url to start from ?

What's your computer model ?
You can try to do a
`find /proc/device-tree -name fan|grep -v aliases`

You may have an external chipset used to check temperatures and control
the fan.

--
Colin
Ne disez pas disez, mais disez dites


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: temp.c and cputable.c issues
  2004-01-15  7:16       ` valvoline
@ 2004-01-15  9:32         ` Colin Leroy
  2004-01-16  7:02           ` valvoline
  0 siblings, 1 reply; 14+ messages in thread
From: Colin Leroy @ 2004-01-15  9:32 UTC (permalink / raw)
  To: valvoline; +Cc: linuxppc-dev


Hi again,

> i've tried to use it, but the module is not compatible with i2c_west and
> soundcard, so the system hangs with no further response! (=

It works fine for me. What modules do you have ?

For me it is
therm_adt7467           9924  0
snd_pcm_oss            69188  0
snd_mixer_oss          22464  2 snd_pcm_oss
i2c_keywest            13320  0
snd_powermac           46020  1
snd_pcm               122708  2 snd_pcm_oss,snd_powermac
snd_page_alloc         13956  1 snd_pcm
snd_timer              28608  1 snd_pcm
snd                    61476  5
snd_pcm_oss,snd_mixer_oss,snd_powermac,snd_pcm,snd_timer
soundcore              11232  2 snd
i2c_core               29540  3 therm_adt7467,i2c_keywest,snd_powermac

They're loaded in this order:
snd-powermac
snd-pcm-oss
therm_adt7467

But the other way works too.

--
Colin
Ne disez pas disez, mais disez dites


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: temp.c and cputable.c issues
@ 2004-01-15  9:38 Colin Leroy
  0 siblings, 0 replies; 14+ messages in thread
From: Colin Leroy @ 2004-01-15  9:38 UTC (permalink / raw)
  To: linuxppc-dev


> i've an ibook G4/12". it's branded as PowerMac6,3. It should be
> the lastest model available from apple.
>
> > You may have an external chipset used to check temperatures and
control
> > the fan.
>
> sure. there's an external chipset for temperature and fan control.
> Under Macos X, i've set and get values from it several times...but
> what about linux ?


Well, under 2.6 kernel, you can use the therm_adt7467 module
(CONFIG_THERM_IBOOKG4 configuration option, under Drivers/Macintosh).
It'll create some entries in /sys:
/sys/devices/temperatures/cpu_temperature
/sys/devices/temperatures/gpu_temperature
/sys/devices/temperatures/fan_speed
These display the informations you want.

/sys/devices/temperatures/cpu_limit
/sys/devices/temperatures/gpu_limit
These display the maximum temperatures before fan starts.

--
Colin
Ne disez pas disez, mais disez dites

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: temp.c and cputable.c issues
  2004-01-15  9:32         ` Colin Leroy
@ 2004-01-16  7:02           ` valvoline
  2004-01-16 10:21             ` Colin Leroy
  0 siblings, 1 reply; 14+ messages in thread
From: valvoline @ 2004-01-16  7:02 UTC (permalink / raw)
  To: Colin Leroy; +Cc: linuxppc-dev


On Thu, Jan 15, 2004 at 10:32:20AM +0100, Colin Leroy wrote:

> They're loaded in this order:
> snd-powermac
> snd-pcm-oss
> therm_adt7467

i gotta it! :)
for some strange reason i need to modprobe manually the i2c_west,
first of all...next if i modprobe:

snd-powermac
snd-pcm-oss
therm_adt7467

all works fine!. again, if therm_adt7467 is loaded first all the
system hangs with no further response if i try to modprobe something
related to i2c_west...maybe some kind of lock ?

under /var/log/everything.log, now, i can read the reports about
temperatures but no /dev/ devices is created; of course, i've modprobed
i2c_dev, but without any success...

regards.
--
[ valvoline :: VRL Team :: s0ftpj :: freaknet Medialab :: GPG key available  ]
[ key fingerprint :: - :: B7E2 48BC 705F AE8F 9ABE  E422 076A 2561 1D67 B4DD ]
[ GPG key available on keyserver :: pgp.mit.edu :: with keyID :: 1D67B4DD :: ]

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: temp.c and cputable.c issues
  2004-01-16  7:02           ` valvoline
@ 2004-01-16 10:21             ` Colin Leroy
  2004-01-16 11:10               ` Geert Uytterhoeven
  0 siblings, 1 reply; 14+ messages in thread
From: Colin Leroy @ 2004-01-16 10:21 UTC (permalink / raw)
  To: valvoline; +Cc: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 362 bytes --]

> i gotta it! :)
> for some strange reason i need to modprobe manually the i2c_west,
> first of all...next if i modprobe:


Can you try the attached patch (apply against
drivers/macintosh/therm_adt7467.c).
Then, try to modprobe therm_adt7467 without i2c-core and i2c-keywest
loaded.

Tell me if this works.

Thanks,
--
Colin
Ne disez pas disez, mais disez dites

[-- Attachment #2: therm_adt7467.diff --]
[-- Type: application/octet-stream, Size: 527 bytes --]

--- therm_adt7467.c.orig	2004-01-16 11:10:49.000000000 +0100
+++ therm_adt7467.c	2004-01-16 11:14:38.000000000 +0100
@@ -27,6 +27,7 @@
 #include <asm/system.h>
 #include <asm/sections.h>
 #include <asm/of_device.h>
+#include <linux/kmod.h>
 
 #undef DEBUG
 
@@ -421,6 +422,9 @@
 	device_create_file(&of_dev->dev, &dev_attr_gpu_limit);
 	device_create_file(&of_dev->dev, &dev_attr_fan_speed);
 	
+#ifdef CONFIG_KMOD	
+	request_module("i2c-keywest");
+#endif
 	return i2c_add_driver(&thermostat_driver);
 }
 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: temp.c and cputable.c issues
  2004-01-16 10:21             ` Colin Leroy
@ 2004-01-16 11:10               ` Geert Uytterhoeven
  2004-01-16 11:26                 ` Colin Leroy
  0 siblings, 1 reply; 14+ messages in thread
From: Geert Uytterhoeven @ 2004-01-16 11:10 UTC (permalink / raw)
  To: Colin Leroy; +Cc: valvoline, Linux/PPC Development


On Fri, 16 Jan 2004, Colin Leroy wrote:
> > i gotta it! :)
> > for some strange reason i need to modprobe manually the i2c_west,
> > first of all...next if i modprobe:
>
> Can you try the attached patch (apply against
> drivers/macintosh/therm_adt7467.c).
> Then, try to modprobe therm_adt7467 without i2c-core and i2c-keywest
> loaded.
>
> Tell me if this works.

If you look at <linux/kmod.h>, you'll notice your patch won't work, since
request_module() is a dummy if CONFIG_KMOD is not set.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: temp.c and cputable.c issues
  2004-01-16 11:10               ` Geert Uytterhoeven
@ 2004-01-16 11:26                 ` Colin Leroy
  0 siblings, 0 replies; 14+ messages in thread
From: Colin Leroy @ 2004-01-16 11:26 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: valvoline, Linux/PPC Development


On 16 Jan 2004 at 12h01, Geert Uytterhoeven wrote:

Hi,

> If you look at <linux/kmod.h>, you'll notice your patch won't work, since
> request_module() is a dummy if CONFIG_KMOD is not set.

Well, it'll work for the majority and we can't do much if Kernel Module Loader isn't enabled...

--
Colin

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2004-01-16 11:26 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-14 19:39 temp.c and cputable.c issues valvoline
2004-01-14 22:10 ` Tom Rini
2004-01-14 20:11   ` valvoline
2004-01-14 22:38     ` Tom Rini
2004-01-15  8:19     ` Colin Leroy
2004-01-15  7:03       ` valvoline
2004-01-15  7:16       ` valvoline
2004-01-15  9:32         ` Colin Leroy
2004-01-16  7:02           ` valvoline
2004-01-16 10:21             ` Colin Leroy
2004-01-16 11:10               ` Geert Uytterhoeven
2004-01-16 11:26                 ` Colin Leroy
2004-01-15  7:20       ` valvoline
  -- strict thread matches above, loose matches on Subject: below --
2004-01-15  9:38 Colin Leroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).