LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Laptop and Netbook (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/)
-   -   What's the deal with ACPI, cpufreq, and powernow-k7 on Emachines m5310 (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/whats-the-deal-with-acpi-cpufreq-and-powernow-k7-on-emachines-m5310-110695/)

adamis 10-31-2003 12:42 AM

What's the deal with ACPI, cpufreq, and powernow-k7 on Emachines m5310
 
I have been trying to get my E-machines m5310 laptop (Mandrake 9.2 RC2) to run cooler for the past three weeks without any luck. So far I've recompiled the 2.4 kernel and ensured that ACPI and cpufreq where enabled.

Now when ever I go to find some info from the ACPI

cat /proc/acpi/processor/CPU0/info

I get the following:
processor id: 0
acpi id: 0
bus mastering control: yes
power management: yes
throttling control: no
performance management: no

The CPU info is:
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 10
model name : Mobile AMD Athlon(tm) XP 2400+
stepping : 0
cpu MHz : 1788.924
cache size : 512 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mp mmxext 3dnowext 3dnow
bogomips : 3565.15
limit interface: no

Cpufreq shows :
minimum CPU frequency - maximum CPU frequency - policy


There is nothing else from cpufreq so I'm guessing it doesn't see my processor. So why does ACPI not detect performance managment? CPUfreq doesn't seem to even see my processor. If I do a lsmod I can see the powernow-k7 but it says (unused) next to it. So I can't tell what it's status is.

One weird thing is I unplug the laptop from the AC it actually does run nice and cool. The weird thing is the cpuinfo still shows the same 1788mhz. Perhaps the kernel just doesn't detect my system right, any ideas?

I really can't wait for the 2.6 kernel because this is just way to hard to get this stuff to work.

pechaman 01-31-2004 07:51 PM

I also have an eMachines model M5312. I tried to install Linux and I have the same problem that you do, the fan doesn't stop spinning and the computer gets really hot. Were you able to find a solution to the problem??
Thank you.

adamis 02-02-2004 01:35 PM

Yup, I have the solution for this problem. It's a little trickey but not to bad once you get it figured out. The problem is the cpufreq driver doesn't reckognize the processor. To get around this you have to patch the cpufreq driver with a couple of lines of code. Below is the patch, what you really need to do is add the following lines to the powernow-k7.c file in the kernel source code directory.

If you open up a search for the powernow-k7.c file in your kernel source (assuming you have the kernel source installed) then you can do a search for these lines in the file:

etuple |= (c->x86_model<<4)|(c->x86_mask);

The lines of code that need to be added below this line (look at the whole patch below, you should see what I'm talking about):

if (etuple == 0x7a0) { etuple = 0x781; }

Once you have the file patched you can save it and then compile the kernel. You might want to type "make oldconfig" if you just downloaded the source so that everything is setup like your old system. Then type "make xconfig" and look in under powermanagement and finally cpu frequency scaling options. Check to make sure that cpufreq is selected as well as the userspace cpufreq (you'll know it when you see it) and finally the Athlon cpufreq driver (agaqin, you'll know it when you see it).

Now compile the kernel and you are half way there. Now you need a userspace program that will throttle the frequency for you. I found "cpuspeed" by carl thompson to be a great program that has worked great for me with little problems. The installation is pretty simple as well.

This isn't that complicated if you have done it a few times but on your first go around (especially if you haven't compiled a kernel before) this can be a daunting task. Never the less it is possible so stick with it.

This is the whole patch that will be added to the powernow-k7.c file, you can look at it to figure out where the above sources of code should be inserted into your powernow-k7.c file. Good luck.

diff -Naur linux-clean/arch/i386/kernel/powernow-k7.c linux/arch/i386/kernel/powernow-k7.c
--- linux-clean/arch/i386/kernel/powernow-k7.c 2003-09-28 00:47:23.000000000 +0100
+++ linux/arch/i386/kernel/powernow-k7.c 2003-09-26 00:48:54.000000000 +0100
@@ -294,6 +294,8 @@
etuple &= 0xf00;
etuple |= (c->x86_model<<4)|(c->x86_mask);

+ if (etuple == 0x7a0) { etuple = 0x781; }
+
for (i=0xC0000; i < 0xffff0 ; i+=16) {

p = phys_to_virt(i);

pechaman 02-03-2004 05:10 PM

Thanks for your reply Adamis, I'll try to do what you told me and hope it works. I have a few more questions.
1) I have Debian installed, is the process going to be the same for this?
2) What version of the kernel do you have? and,
3) Where do you get the userspace program?("cpuspeed")
This is the first time I'm going to compile a Kernel, and I know things might go wrong, but I will keep on trying.
Thanks again.

adamis 02-04-2004 12:35 AM

I use kernel 2.6.1 with mandrake. I started off with the 2.4 kernel that came with mandrake 9.2 and slowly got the 2.6.1 to work.

The userpsace program cpuspeed is written by carl thompson. Google it and you'll find it.

When you compile the kernel leave your old one and just add the new one as a bootup option so you can always go back if you have to.

Good luck.

pechaman 02-04-2004 01:03 AM

Hello Adamis,
I just want to say thank you for your help. I've been trying to migrate to the linux system and now I believe I have the basics to do it.
Cheers.

pechaman 02-05-2004 08:55 PM

Hello Adamis, I need some more help configuring my eMachines. I hope you can give me some more hints.

I tried to do what you told me about editing the powernow-k7.c file. On your help you mentioned that you assume I have the kernel source installed. By this, do you mean the 2.6.2 kernel installed?? I ask this because I still have the original kernel and I can't find the file you told me. By the way, how can I see what kernel I have installed? Where is it stored?
I believe I also need to use ACPI to fix my processor from burning up, but I don't know how to activate this. Do I need to compile the new kernel (6.2)to have ACPI?? It seems that right now my computer is set up with APM.
I downloaded CPUspeed, but I haven't installed it because I'm waiting to set up ACPI, although it might not be a requirement.
I know this is another topic but I just need to ask you, did you get the wirless card to work?

This is my first time with Linux and there are so many things to learn that it is overwhelming. If I could only stop the processor from spinning I'd be happy.

Thanks! :)

adamis 02-06-2004 01:08 AM

Okay, the kernel source 2.6.2 which if you downloaded is in some compressed file format. Extract this file into a folder and then move it to /usr/src/linux-2.6.2 (note the linux-2.6.2 would be the name of the folder that you move). Now, the file you want to edit will be at:

/usr/src/linux-2.6.2/arch/i386/kernel/powernow-k7.c

again, note that "linux-2.6.2" should be replaced with whatever folder name you extracted the kernel to. So this should give you an idea of where that file is.

Now, ACPI for some reason does not work 100% on this laptop. If it did then you wouldn't have to enable cpufreq in the kernel. ACPI in the kernel will report battery status as well as perform some other options but it will not slow down your processor (unless they fixed this in the latest kernel) and this is what will keep your laptop running to hot to handle. So note, that the cpufreq is what is keeping your processor from burning up, ACPI for some reason doesn't work on these processors.

When you compile the kernel enable ACPI and make sure that APM is disabled, this will allow you to get battery status and such. Also, make sure that cpufreq is enabled along with userspace and finally the powernow driver for the athlon. (note, you want to patch the driver before you start configuring the kernel. ) You can enable these as modules or have them built directly into the kernel. I would probably just have them built into the kernel so you don't have to worry about the modules being loaded on bootup. As you get things figured out you can then build them as modules if you want.

There are also a lot of other things that need to be configured to get things working. If you are using Mandrake 9.2 I could probably send you my kernel config file to give you a head start on the other stuff. IM me sometime and I'll help you out more. (Check my profile for this information...)

This should at least get you started in getting your getting your laptop to run cooler.

pechaman 02-13-2004 01:31 AM

Hello Adamis,
I tried to IM before but maybe the messages didn't reach you.
I installed Mandrake 9.2 on my laptop and I was able to fix the fan problem by compiling the new kernel with the patched AMD drive. But as you mentioned there are still things that I haven't been able to configure......
Do you think you could send me the kernel .config file? I would very much appreciate it.
Thank you.

adamis 02-13-2004 12:55 PM

If you IM me you should use aim as Gaim is having a problem with Yahoo right now. I will send you my config file over AIM. I am using the 2.6.2 kernel with the mm patch installed so you should update to that kernel source if you wan't to use my config file.

Also, does your CPU fan run all the time in Linux? My laptop fan doesn't run when first turned on but if I leave it on the laptop on the cpu fan will eventually turn on and stay on. My fan is really noisey right now, so much that I called e-machines and am having it RMA'd. I'm returning the laptop to e-machines this weekend to have it worked on because the cpufan is really noisey now and the laptop turns off if a program like glxgears causes the cpu to run at full speed for a period of time. Hopefully they will replace the noisey fan and the processor that doesn't like to run at it's rated speed.

Anyway, if you don't see me online in the next couple of day's it's because my laptop is in the shop. Try catching me online late tonight through AIM as I won't be sending the laptop in probably till Monday.

pechaman 02-14-2004 01:55 AM

Sorry to hear your fan is getting noisy and you have to send it for repair. I know this takes time and can be frustrating at times.
Right now I'm using windows to connect to the internet and I only have yahoo messenger and msn messenger. I haven't been able to set up my wireless card on linux and this is the only way I can connect to the internet. (I live on campus residences). I did download the new 2.6.2 kernel and installed it on my computer.
Answering to your question, my fan seems to work fine under Linux, but I haven't reallly worked that long on linux to test the computer on the long run, so I don't know if I would have the same problem as you do............but I will keep in touch to let you know.........
Well, I hope you get your computer back soon.


All times are GMT -5. The time now is 08:28 AM.