LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices


Reply
  Search this Thread
Old 10-31-2003, 01:42 AM   #1
adamis
Member
 
Registered: Oct 2003
Posts: 81

Rep: Reputation: 15
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.
 
Old 01-31-2004, 08:51 PM   #2
pechaman
LQ Newbie
 
Registered: Jan 2004
Posts: 9

Rep: Reputation: 0
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.
 
Old 02-02-2004, 02:35 PM   #3
adamis
Member
 
Registered: Oct 2003
Posts: 81

Original Poster
Rep: Reputation: 15
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);
 
Old 02-03-2004, 06:10 PM   #4
pechaman
LQ Newbie
 
Registered: Jan 2004
Posts: 9

Rep: Reputation: 0
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.
 
Old 02-04-2004, 01:35 AM   #5
adamis
Member
 
Registered: Oct 2003
Posts: 81

Original Poster
Rep: Reputation: 15
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.
 
Old 02-04-2004, 02:03 AM   #6
pechaman
LQ Newbie
 
Registered: Jan 2004
Posts: 9

Rep: Reputation: 0
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.
 
Old 02-05-2004, 09:55 PM   #7
pechaman
LQ Newbie
 
Registered: Jan 2004
Posts: 9

Rep: Reputation: 0
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!
 
Old 02-06-2004, 02:08 AM   #8
adamis
Member
 
Registered: Oct 2003
Posts: 81

Original Poster
Rep: Reputation: 15
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.
 
Old 02-13-2004, 02:31 AM   #9
pechaman
LQ Newbie
 
Registered: Jan 2004
Posts: 9

Rep: Reputation: 0
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.
 
Old 02-13-2004, 01:55 PM   #10
adamis
Member
 
Registered: Oct 2003
Posts: 81

Original Poster
Rep: Reputation: 15
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.
 
Old 02-14-2004, 02:55 AM   #11
pechaman
LQ Newbie
 
Registered: Jan 2004
Posts: 9

Rep: Reputation: 0
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Emachines M5310 Suspen jhawk Linux - Laptop and Netbook 4 05-01-2004 09:44 AM
Emachines M5310 CPU Freq Control, ACPI, Poor Video, Volume Buttons johnandrhona Linux - Laptop and Netbook 2 03-14-2004 11:54 PM
eMachines M5310 vivekiyer Linux - Laptop and Netbook 31 11-12-2003 03:18 PM
emachines m5310, Redhat 9 & ACPI SgtBhaji Linux - Laptop and Netbook 0 11-11-2003 01:55 PM
emachines m5310 and linux acascianelli Linux - Laptop and Netbook 20 11-01-2003 08:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 08:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration