Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Undervolting with kernel 2.6 [Done!]
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64
View previous topic :: View next topic  
Author Message
Berniyh
l33t
l33t


Joined: 07 Jun 2006
Posts: 677

PostPosted: Thu Feb 07, 2008 9:44 am    Post subject: Reply with quote

new_nOOb wrote:
but i am to stupid to add this as boot parameter

kernel /bzimage2 root=/dev/md0 ro quiet splash powernow-k8.freq_list=1800,1000 powernow-k8.vcore_list=1100,900

not working ;/

What do you mean "not working"? You have to be a bit more specific. ;)
Did you compile it as a module?

BTW: It's not "my" patch, I just ported it to 2.6.24, it was made by someone else, originally for kernel 2.6.16. ;)
Back to top
View user's profile Send private message
new_nOOb
Apprentice
Apprentice


Joined: 05 Mar 2004
Posts: 280

PostPosted: Thu Feb 07, 2008 9:48 am    Post subject: Reply with quote

ok now work. thanks. i have make a modul that don´t work with boot parameter ;)
but in kernel all ok
Back to top
View user's profile Send private message
Berniyh
l33t
l33t


Joined: 07 Jun 2006
Posts: 677

PostPosted: Thu Feb 07, 2008 10:43 am    Post subject: Reply with quote

new_nOOb wrote:
ok now work. thanks. i have make a modul that don´t work with boot parameter ;)
but in kernel all ok

When you're using a kernel module you have to give the parameters to modprobe.
Code:
modprobe powernow-k8 freq_list=1800,1000 vcore_list=1100,900
Back to top
View user's profile Send private message
Nemrood
n00b
n00b


Joined: 23 Mar 2008
Posts: 1

PostPosted: Sun Mar 23, 2008 2:05 pm    Post subject: Reply with quote

Code:
% sudo modprobe powernow-k8 freq_list=1800,1000 vcore_list=1100,900
Password:
FATAL: Error inserting powernow_k8 (/lib/modules/2.6.24-ARCH/kernel/arch/x86/kernel/cpu/cpufreq/powernow-k8.ko): Unknown symbol in module, or unknown parameter (see dmesg)


from dmesg:
Code:
powernow_k8: Unknown parameter `freq_list'


powernow-k8 and cpufreq was working for me until I overclocked my cpu (also changed voltage).

any1 could help ??

----------------------------------------------------------
Athlon64 3000+ Venice 1800MHz => 2565MHz
vcore 1.4V => 1.475
Back to top
View user's profile Send private message
Berniyh
l33t
l33t


Joined: 07 Jun 2006
Posts: 677

PostPosted: Sun Mar 23, 2008 3:51 pm    Post subject: Reply with quote

Nemrood wrote:
Code:
% sudo modprobe powernow-k8 freq_list=1800,1000 vcore_list=1100,900
Password:
FATAL: Error inserting powernow_k8 (/lib/modules/2.6.24-ARCH/kernel/arch/x86/kernel/cpu/cpufreq/powernow-k8.ko): Unknown symbol in module, or unknown parameter (see dmesg)


from dmesg:
Code:
powernow_k8: Unknown parameter `freq_list'


powernow-k8 and cpufreq was working for me until I overclocked my cpu (also changed voltage).

any1 could help ??

----------------------------------------------------------
Athlon64 3000+ Venice 1800MHz => 2565MHz
vcore 1.4V => 1.475

Are you sure, that you added the patch?

It works fine here (with 2.6.24 and 2.6.25-rc6).
Back to top
View user's profile Send private message
pussi
l33t
l33t


Joined: 08 May 2004
Posts: 727
Location: Finland

PostPosted: Sun Mar 23, 2008 4:01 pm    Post subject: Reply with quote

Berniyh wrote:
Are you sure, that you added the patch?

And that you applied the correct patch. There's been two patches in this thread, other has only the vcore_list parameter and the other one has both.
Back to top
View user's profile Send private message
Berniyh
l33t
l33t


Joined: 07 Jun 2006
Posts: 677

PostPosted: Sun Mar 23, 2008 4:26 pm    Post subject: Reply with quote

pussi wrote:
Berniyh wrote:
Are you sure, that you added the patch?

And that you applied the correct patch. There's been two patches in this thread, other has only the vcore_list parameter and the other one has both.

There is only one for 2.6.24, afaik.
Back to top
View user's profile Send private message
1500
n00b
n00b


Joined: 16 Jul 2005
Posts: 24

PostPosted: Sat May 24, 2008 9:20 pm    Post subject: Reply with quote

The patch seems to be disappeared. Could somebody post a new link for it? Is there any known version for the newest kernels?
Thank you very much !
Back to top
View user's profile Send private message
Berniyh
l33t
l33t


Joined: 07 Jun 2006
Posts: 677

PostPosted: Sat May 24, 2008 9:22 pm    Post subject: Reply with quote

1500 wrote:
The patch seems to be disappeared. Could somebody post a new link for it? Is there any known version for the newest kernels?
Thank you very much !

I'm doing a server migration, should be back online, soon.
Just have to upload the data again.

Edit and that patch works still, so no need to post a new version yet.
Back to top
View user's profile Send private message
1500
n00b
n00b


Joined: 16 Jul 2005
Posts: 24

PostPosted: Sat May 24, 2008 9:29 pm    Post subject: Reply with quote

Thank you very much! I was a little surprised by your quick answer. Please let us know, when and where the patch will be available again.
Back to top
View user's profile Send private message
Berniyh
l33t
l33t


Joined: 07 Jun 2006
Posts: 677

PostPosted: Sat May 24, 2008 9:48 pm    Post subject: Reply with quote

1500 wrote:
Thank you very much! I was a little surprised by your quick answer. Please let us know, when and where the patch will be available again.

It's there already. Since it's only a tiny bit, I uploaded it first. ;)
Back to top
View user's profile Send private message
Berniyh
l33t
l33t


Joined: 07 Jun 2006
Posts: 677

PostPosted: Tue Aug 19, 2008 10:14 pm    Post subject: Reply with quote

Hm, using kernel 2.6.26 (basically vanilla), I've got the feeling, that the patch doesn't work anymore.
Can anyone confirm this?

(It shows, that it sets the voltages etc, there are no error messages, but the cpu temperature is at the default vid value (which is pretty hot on this subnotebook) and the fan blows like hell.)
Back to top
View user's profile Send private message
Devport
Guru
Guru


Joined: 15 Dec 2004
Posts: 361

PostPosted: Tue Aug 19, 2008 11:35 pm    Post subject: Reply with quote

Berniyh wrote:
Hm, using kernel 2.6.26 (basically vanilla), I've got the feeling, that the patch doesn't work anymore.
Can anyone confirm this?

(It shows, that it sets the voltages etc, there are no error messages, but the cpu temperature is at the default vid value (which is pretty hot on this subnotebook) and the fan blows like hell.)

On my system ( Socket 939, AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ ) the patch works fine with sys-kernel/gentoo-sources-2.6.26 and powernow-k8-vcore_list-2.6.24-git-v3.patch. xsensors shows correct, reduced voltage.

What cpu do you have - is powersave / ondemand governor enabled ?
Back to top
View user's profile Send private message
Berniyh
l33t
l33t


Joined: 07 Jun 2006
Posts: 677

PostPosted: Wed Aug 20, 2008 12:25 am    Post subject: Reply with quote

Devport wrote:
Berniyh wrote:
Hm, using kernel 2.6.26 (basically vanilla), I've got the feeling, that the patch doesn't work anymore.
Can anyone confirm this?

(It shows, that it sets the voltages etc, there are no error messages, but the cpu temperature is at the default vid value (which is pretty hot on this subnotebook) and the fan blows like hell.)

On my system ( Socket 939, AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ ) the patch works fine with sys-kernel/gentoo-sources-2.6.26 and powernow-k8-vcore_list-2.6.24-git-v3.patch. xsensors shows correct, reduced voltage.

What cpu do you have - is powersave / ondemand governor enabled ?

Turion X2 TL50 (1,6Ghz)
The governor is irrelevant, because you can't change the voltage of the lowest fid on that cpu (it is already at the lowest setting, 800mV).
The highest fid (there are only two for that cpu) is normally 1100mV, which gives me up to 90°C at full cpu usage.
(I will clean the fans and renew the thermal paste soon, that should drop the temperature a bit.)
I have been able to stable (not "QMC-stable", but "Spinhedge-stable") undervolt it at 925mV, which is also what I've set now and that gives me about 70-75°C at full cpu usage.
It shows, that it sets that:
Code:
powernow-k8: Found 1 AMD Turion(tm) 64 X2 Mobile Technology TL-50 processors (2 cpu cores) (version 2.20.00)
powernow-k8: Requested 1600MHz with 925mV
powernow-k8: Requested 800MHz with 800mV
powernow-k8:    0 : fid 0x8 (1600 MHz), vid 0x19
powernow-k8:    1 : fid 0x0 (800 MHz), vid 0x1e

But the temps are much too high for that to be real (it goes up to 90°C, so it's pretty much at default voltage).

Edit:
Afaik, there is a voltage sensor in the Notebook (MSI S271), but lm_sensor doesn't find it and so I can't read out the voltage.
Back to top
View user's profile Send private message
Berniyh
l33t
l33t


Joined: 07 Jun 2006
Posts: 677

PostPosted: Wed Aug 20, 2008 11:25 am    Post subject: Reply with quote

Tried cpupowerd, but with the same results.
No errors, but no change at all, regarding the temperature.
BTW, here is a diff between 2.6.25 and 2.6.26 for the powernow-k8 files:
Code:
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
index c99d59d..206791e 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
@@ -478,12 +478,12 @@ static int core_voltage_post_transition(struct powernow_k8_data *data, u32 reqvi
 
 static int check_supported_cpu(unsigned int cpu)
 {
-   cpumask_t oldmask = CPU_MASK_ALL;
+   cpumask_t oldmask;
    u32 eax, ebx, ecx, edx;
    unsigned int rc = 0;
 
    oldmask = current->cpus_allowed;
-   set_cpus_allowed(current, cpumask_of_cpu(cpu));
+   set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
 
    if (smp_processor_id() != cpu) {
       printk(KERN_ERR PFX "limiting to cpu %u failed\n", cpu);
@@ -528,7 +528,7 @@ static int check_supported_cpu(unsigned int cpu)
    rc = 1;
 
 out:
-   set_cpus_allowed(current, oldmask);
+   set_cpus_allowed_ptr(current, &oldmask);
    return rc;
 }
 
@@ -1015,7 +1015,7 @@ static int transition_frequency_pstate(struct powernow_k8_data *data, unsigned i
 /* Driver entry point to switch to the target frequency */
 static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsigned relation)
 {
-   cpumask_t oldmask = CPU_MASK_ALL;
+   cpumask_t oldmask;
    struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu);
    u32 checkfid;
    u32 checkvid;
@@ -1030,7 +1030,7 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
 
    /* only run on specific CPU from here on */
    oldmask = current->cpus_allowed;
-   set_cpus_allowed(current, cpumask_of_cpu(pol->cpu));
+   set_cpus_allowed_ptr(current, &cpumask_of_cpu(pol->cpu));
 
    if (smp_processor_id() != pol->cpu) {
       printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu);
@@ -1085,7 +1085,7 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
    ret = 0;
 
 err_out:
-   set_cpus_allowed(current, oldmask);
+   set_cpus_allowed_ptr(current, &oldmask);
    return ret;
 }
 
@@ -1104,7 +1104,7 @@ static int powernowk8_verify(struct cpufreq_policy *pol)
 static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
 {
    struct powernow_k8_data *data;
-   cpumask_t oldmask = CPU_MASK_ALL;
+   cpumask_t oldmask;
    int rc;
 
    if (!cpu_online(pol->cpu))
@@ -1127,12 +1127,23 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
        * an UP version, and is deprecated by AMD.
        */
       if (num_online_cpus() != 1) {
-         printk(KERN_ERR PFX "MP systems not supported by PSB BIOS structure\n");
+#ifndef CONFIG_ACPI_PROCESSOR
+         printk(KERN_ERR PFX "ACPI Processor support is required "
+                "for SMP systems but is absent. Please load the "
+                "ACPI Processor module before starting this "
+                "driver.\n");
+#else
+         printk(KERN_ERR PFX "Your BIOS does not provide ACPI "
+                "_PSS objects in a way that Linux understands. "
+                "Please report this to the Linux ACPI maintainers"
+                " and complain to your BIOS vendor.\n");
+#endif
          kfree(data);
          return -ENODEV;
       }
       if (pol->cpu != 0) {
-         printk(KERN_ERR PFX "No _PSS objects for CPU other than CPU0\n");
+         printk(KERN_ERR PFX "No ACPI _PSS objects for CPU other than "
+                "CPU0. Complain to your BIOS vendor.\n");
          kfree(data);
          return -ENODEV;
       }
@@ -1145,7 +1156,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
 
    /* only run on specific CPU from here on */
    oldmask = current->cpus_allowed;
-   set_cpus_allowed(current, cpumask_of_cpu(pol->cpu));
+   set_cpus_allowed_ptr(current, &cpumask_of_cpu(pol->cpu));
 
    if (smp_processor_id() != pol->cpu) {
       printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu);
@@ -1164,7 +1175,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
       fidvid_msr_init();
 
    /* run on any CPU again */
-   set_cpus_allowed(current, oldmask);
+   set_cpus_allowed_ptr(current, &oldmask);
 
    if (cpu_family == CPU_HW_PSTATE)
       pol->cpus = cpumask_of_cpu(pol->cpu);
@@ -1205,7 +1216,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
    return 0;
 
 err_out:
-   set_cpus_allowed(current, oldmask);
+   set_cpus_allowed_ptr(current, &oldmask);
    powernow_k8_cpu_exit_acpi(data);
 
    kfree(data);
@@ -1242,10 +1253,11 @@ static unsigned int powernowk8_get (unsigned int cpu)
    if (!data)
       return -EINVAL;
 
-   set_cpus_allowed(current, cpumask_of_cpu(cpu));
+   set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
    if (smp_processor_id() != cpu) {
-      printk(KERN_ERR PFX "limiting to CPU %d failed in powernowk8_get\n", cpu);
-      set_cpus_allowed(current, oldmask);
+      printk(KERN_ERR PFX
+         "limiting to CPU %d failed in powernowk8_get\n", cpu);
+      set_cpus_allowed_ptr(current, &oldmask);
       return 0;
    }
 
@@ -1253,13 +1265,14 @@ static unsigned int powernowk8_get (unsigned int cpu)
       goto out;
 
    if (cpu_family == CPU_HW_PSTATE)
-      khz = find_khz_freq_from_pstate(data->powernow_table, data->currpstate);
+      khz = find_khz_freq_from_pstate(data->powernow_table,
+                  data->currpstate);
    else
       khz = find_khz_freq_from_fid(data->currfid);
 
 
 out:
-   set_cpus_allowed(current, oldmask);
+   set_cpus_allowed_ptr(current, &oldmask);
    return khz;
 }
Back to top
View user's profile Send private message
new_nOOb
Apprentice
Apprentice


Joined: 05 Mar 2004
Posts: 280

PostPosted: Tue Jun 16, 2009 11:12 am    Post subject: Reply with quote

are some patch for new 2.6.30 kernel available . i still use the powernow-k8-vcore_list-2.6.24-git-v3.patch
and with 2.6.29 it´s work but not with .30
Back to top
View user's profile Send private message
TwoMinds
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jul 2004
Posts: 146
Location: Italy

PostPosted: Thu Jun 18, 2009 12:03 pm    Post subject: Reply with quote

...I worked out the patch for 2.6.30... check if it works...
Code:
--- arch/x86/kernel/cpu/cpufreq/powernow-k8.c.orig   2009-06-17 13:15:29.277039209 +0200
+++ arch/x86/kernel/cpu/cpufreq/powernow-k8.c   2009-06-17 13:45:31.576586714 +0200
@@ -27,6 +27,7 @@
 #include <linux/kernel.h>
 #include <linux/smp.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/cpufreq.h>
 #include <linux/slab.h>
@@ -46,6 +47,15 @@
 #define VERSION "version 2.20.00"
 #include "powernow-k8.h"
 
+static int vcore_list[16] = { 0 };
+static int vcore_list_count = 0;
+module_param_array(vcore_list, int, &vcore_list_count, 0644);
+MODULE_PARM_DESC(vcore_list, "List of new voltages to use, order must match freq_list");
+
+static int freq_list[16] = { 0 };
+static int freq_list_count = 0;
+module_param_array(freq_list, int, &freq_list_count, 0644);
+MODULE_PARM_DESC(freq_list, "List of new frequencies to use, order must match vcore_list");
 /* serialize freq changes  */
 static DEFINE_MUTEX(fidvid_mutex);
 
@@ -66,6 +76,12 @@
    return 800 + (fid * 100);
 }
 
+/* Return fid from a frequency in MHz */
+static u32 find_fid_from_freq(u32 freq)
+{
+   return (freq - 800) / 100;
+}
+
 /* Return a frequency in KHz, given an input fid */
 static u32 find_khz_freq_from_fid(u32 fid)
 {
@@ -78,6 +94,12 @@
    return data[pstate].frequency;
 }
 
+/* Return a vid from a voltage in mV */
+static u32 find_vid_from_millivolts(u32 vcore)
+{
+   return (1550-vcore)/25;
+}
+
 /* Return the vco fid for an input fid
  *
  * Each "low" fid has corresponding "high" fid, and you can get to "low" fids
@@ -666,6 +688,7 @@
 static int fill_powernow_table(struct powernow_k8_data *data,
       struct pst_s *pst, u8 maxvid)
 {
+   printk(KERN_INFO PFX "fill_powernow_table() entry");
    struct cpufreq_frequency_table *powernow_table;
    unsigned int j;
 
@@ -692,13 +715,17 @@
    if (check_pst_table(data, pst, maxvid))
       return -EINVAL;
 
-   powernow_table = kmalloc((sizeof(struct cpufreq_frequency_table)
-      * (data->numps + 1)), GFP_KERNEL);
+   if ( freq_list_count > data->numps )
+      data->numps = freq_list_count;
+   
+      powernow_table = kmalloc((sizeof(struct cpufreq_frequency_table) * (data->numps + 1)), GFP_KERNEL);
+
    if (!powernow_table) {
       printk(KERN_ERR PFX "powernow_table memory alloc failure\n");
       return -ENOMEM;
    }
 
+   if ( ( vcore_list_count <= 1 ) || ( freq_list_count <= 1 ) ) {
    for (j = 0; j < data->numps; j++) {
       int freq;
       powernow_table[j].index = pst[j].fid; /* lower 8 bits */
@@ -708,13 +735,34 @@
    }
    powernow_table[data->numps].frequency = CPUFREQ_TABLE_END;
    powernow_table[data->numps].index = 0;
+      printk(KERN_INFO PFX "Wrong fucking side of things vcore:%d, freq:%d.\n",
+            vcore_list_count,
+            freq_list_count);      
+   }
+   else {
+                for (j = 0; j < freq_list_count ; j++) {
+                   printk(KERN_INFO PFX "PTL: Requested %dMHz with %dmV\n",
+                                 freq_list[j],
+                                 vcore_list[j]);
+         powernow_table[j].index = find_fid_from_freq(freq_list[j]);
+         powernow_table[j].index |= (find_vid_from_millivolts(vcore_list[j]) << 8);
+         powernow_table[j].frequency = find_khz_freq_from_fid(find_fid_from_freq(freq_list[j]));
+            
+   
+      } /* for ( freq_list_count )*/
+         printk(KERN_INFO PFX "PTL: Performed required adjustments.\n");
+         powernow_table[freq_list_count].frequency = CPUFREQ_TABLE_END;
+         powernow_table[freq_list_count].index = 0;
+   }
+
+
 
    if (query_current_values_with_pending_wait(data)) {
       kfree(powernow_table);
       return -EIO;
    }
 
-   dprintk("cfid 0x%x, cvid 0x%x\n", data->currfid, data->currvid);
+   printk(KERN_INFO PFX "cfid 0x%x, cvid 0x%x\n", data->currfid, data->currvid);
    data->powernow_table = powernow_table;
    if (cpumask_first(cpu_core_mask(data->cpu)) == data->cpu)
       print_basics(data);
@@ -724,7 +772,7 @@
           (pst[j].vid == data->currvid))
          return 0;
 
-   dprintk("currfid/vid do not match PST, ignoring\n");
+   printk(KERN_INFO PFX "currfid/vid do not match PST, ignoring\n");
    return 0;
 }
 
@@ -859,8 +907,11 @@
    }
 
    /* fill in data->powernow_table */
-   powernow_table = kmalloc((sizeof(struct cpufreq_frequency_table)
-      * (data->acpi_data.state_count + 1)), GFP_KERNEL);
+   if ( freq_list_count >  data->acpi_data.state_count )
+      data->acpi_data.state_count =  freq_list_count;
+
+      powernow_table = kmalloc((sizeof(struct cpufreq_frequency_table) * (data->acpi_data.state_count + 1)), GFP_KERNEL);
+
    if (!powernow_table) {
       dprintk("powernow_table memory alloc failure\n");
       goto err_out;
@@ -973,12 +1024,17 @@
 
       dprintk("   %d : fid 0x%x, vid 0x%x\n", i, fid, vid);
 
-      index = fid | (vid<<8);
-      powernow_table[i].index = index;
-
-      freq = find_khz_freq_from_fid(fid);
+      /* powernow_table[i].index = fid;  lower 8 bits
+         powernow_table[i].index |= (vid << 8);  upper 8 bits
+         powernow_table[i].frequency = find_khz_freq_from_fid(fid);*/
+      printk(KERN_INFO PFX "Requested %dMHz with %dmV\n",
+             freq_list[i],
+             vcore_list[i]);
+      index = (find_fid_from_freq(freq_list[i])) | (find_vid_from_millivolts(vcore_list[i]) << 8);
+      powernow_table[i].index = index;
+      freq = find_khz_freq_from_fid(find_fid_from_freq(freq_list[i]));
       powernow_table[i].frequency = freq;
-
+      
       /* verify frequency is OK */
       if ((freq > (MAX_FREQ * 1000)) || (freq < (MIN_FREQ * 1000))) {
          dprintk("invalid freq %u kHz, ignoring\n", freq);
@@ -1021,7 +1077,8 @@
             (unsigned int)
             (data->acpi_data.states[i].core_frequency
              * 1000));
-         invalidate_entry(data, i);
+         if ( ( freq_list_count <= 1 ) || ( !freq_list_count ) )
+           invalidate_entry(data, i);
          continue;
       }
    }
Back to top
View user's profile Send private message
abulak
n00b
n00b


Joined: 12 Dec 2008
Posts: 29

PostPosted: Mon Jul 27, 2009 11:11 am    Post subject: Reply with quote

ok, I saved it as powernow-k8.diff, but then patching
Code:
cd /usr/src/linux
patch -p0 <powernow-k8.diff


gives me

Code:
patching file arch/x86/kernel/cpu/cpufreq/powernow-k8.c
Hunk #1 FAILED at 27.
Hunk #2 FAILED at 47.
Hunk #3 FAILED at 76.
Hunk #4 FAILED at 94.
Hunk #5 FAILED at 688.
Hunk #6 FAILED at 715.
Hunk #7 FAILED at 735.
Hunk #8 FAILED at 772.
Hunk #9 FAILED at 907.
Hunk #10 FAILED at 1024.
Hunk #11 FAILED at 1077.
11 out of 11 hunks FAILED -- saving rejects to file arch/x86/kernel/cpu/cpufreq/powernow-k8.c.rej


it's 2.6.30-r4 tuxonice-sources, but i don't think tuxonice has anything to it?

anyone tried it, and succeeded?
Back to top
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2588
Location: Near Toronto

PostPosted: Mon Jul 27, 2009 11:30 am    Post subject: Reply with quote

I don't know but will this help:
http://www.linux-phc.org/forum/viewtopic.php?f=13&t=2

the phc *intel* module works fine on my old intel processor ...
_________________
.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)
Back to top
View user's profile Send private message
abulak
n00b
n00b


Joined: 12 Dec 2008
Posts: 29

PostPosted: Mon Jul 27, 2009 11:41 am    Post subject: Reply with quote

yeah, i already know about phc, but on my turnion it doesn't work well, and (what is more important) i don't want another small app loading everytime i boot, doing sth could be done without it...

this patch worked for me till 2.6.29...now, i'm running hotter ;-) 800Mhz ->+5C at full load, i even don't want to check at 1900Mhz ;P
Back to top
View user's profile Send private message
new_nOOb
Apprentice
Apprentice


Joined: 05 Mar 2004
Posts: 280

PostPosted: Fri Jul 31, 2009 8:51 am    Post subject: Reply with quote

patch from TwoMinds don´t work at me with kernel linux-2.6.30.4
and phc don´t run with amd system ;(

patching file arch/x86/kernel/cpu/cpufreq/powernow-k8.c
Hunk #3 succeeded at 76 with fuzz 1.
Hunk #4 succeeded at 94 with fuzz 1.
Hunk #5 FAILED at 688.
Hunk #6 FAILED at 715.
Hunk #7 FAILED at 735.
Hunk #8 FAILED at 772.
Hunk #9 FAILED at 907.
Hunk #10 FAILED at 1024.
Hunk #11 FAILED at 1077.
Back to top
View user's profile Send private message
grafrotz
n00b
n00b


Joined: 27 Aug 2006
Posts: 38
Location: Frankfurt, Germany

PostPosted: Sun Aug 02, 2009 1:47 pm    Post subject: patch for 2.6.30.3 Reply with quote

(should also work for 2.6.30.4)

the lilo.conf syntax is now like the following (i compiled powernow-k8 NOT as a module!):
Code:

append="powernow-k8.freq_list=2900,2800,2600,2400,2200,2000,1000 powernow-k8.vcore_list=1230,1230,1230,1230,1180,1130,1100"


the powernow-patch-2.6.30.3.patch:

Code:

--- powernow-k8.c-ORIGINAL   2009-08-02 15:39:33.989135271 +0200
+++ powernow-k8.c   2009-08-02 15:37:50.853136905 +0200
@@ -1,4 +1,4 @@
-/*
+/*  GRAFROTZ
  *   (c) 2003-2006 Advanced Micro Devices, Inc.
  *  Your use of this code is subject to the terms and conditions of the
  *  GNU general public license version 2. See "COPYING" or
@@ -27,6 +27,7 @@
 #include <linux/kernel.h>
 #include <linux/smp.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/cpufreq.h>
 #include <linux/slab.h>
@@ -46,6 +47,16 @@
 #define VERSION "version 2.20.00"
 #include "powernow-k8.h"
 
+static int vcore_list[16] = { 0 };
+static int vcore_list_count = 0;
+module_param_array(vcore_list, int, &vcore_list_count, 0644);
+MODULE_PARM_DESC(vcore_list, "List of new voltages to use, order must match freq_list");
+
+static int freq_list[16] = { 0 };
+static int freq_list_count = 0;
+module_param_array(freq_list, int, &freq_list_count, 0644);
+MODULE_PARM_DESC(freq_list, "List of new frequencies to use, order must match vcore_list");
+
 /* serialize freq changes  */
 static DEFINE_MUTEX(fidvid_mutex);
 
@@ -66,6 +77,12 @@
    return 800 + (fid * 100);
 }
 
+/* Return fid from a frequency in MHz */
+static u32 find_fid_from_freq(u32 freq)
+{
+   return (freq - 800) / 100;
+}
+
 /* Return a frequency in KHz, given an input fid */
 static u32 find_khz_freq_from_fid(u32 fid)
 {
@@ -78,6 +95,12 @@
    return data[pstate].frequency;
 }
 
+/* Return a vid from a voltage in mV */
+static u32 find_vid_from_millivolts(u32 vcore)
+{
+   return (1550-vcore)/25;
+}
+
 /* Return the vco fid for an input fid
  *
  * Each "low" fid has corresponding "high" fid, and you can get to "low" fids
@@ -666,6 +689,7 @@
 static int fill_powernow_table(struct powernow_k8_data *data,
       struct pst_s *pst, u8 maxvid)
 {
+   printk(KERN_INFO PFX "fill_powernow_table() entry");
    struct cpufreq_frequency_table *powernow_table;
    unsigned int j;
 
@@ -692,13 +716,17 @@
    if (check_pst_table(data, pst, maxvid))
       return -EINVAL;
 
-   powernow_table = kmalloc((sizeof(struct cpufreq_frequency_table)
-      * (data->numps + 1)), GFP_KERNEL);
+   if ( freq_list_count > data->numps )
+      data->numps = freq_list_count;
+
+      powernow_table = kmalloc((sizeof(struct cpufreq_frequency_table) * (data->numps + 1)), GFP_KERNEL);
+
    if (!powernow_table) {
       printk(KERN_ERR PFX "powernow_table memory alloc failure\n");
       return -ENOMEM;
    }
 
+   if ( ( vcore_list_count <= 1 ) || ( freq_list_count <= 1 ) ) {
    for (j = 0; j < data->numps; j++) {
       int freq;
       powernow_table[j].index = pst[j].fid; /* lower 8 bits */
@@ -708,13 +736,32 @@
    }
    powernow_table[data->numps].frequency = CPUFREQ_TABLE_END;
    powernow_table[data->numps].index = 0;
+      printk(KERN_INFO PFX "Wrong fucking side of things vcore:%d, freq:%d.\n",
+            vcore_list_count,
+            freq_list_count);     
+   }
+   else {
+                for (j = 0; j < freq_list_count ; j++) {
+                   printk(KERN_INFO PFX "PTL: Requested %dMHz with %dmV\n",
+                                 freq_list[j],
+                                 vcore_list[j]);
+         powernow_table[j].index = find_fid_from_freq(freq_list[j]);
+         powernow_table[j].index |= (find_vid_from_millivolts(vcore_list[j]) << 8);
+         powernow_table[j].frequency = find_khz_freq_from_fid(find_fid_from_freq(freq_list[j]));
+           
+   
+      } /* for ( freq_list_count )*/
+         printk(KERN_INFO PFX "PTL: Performed required adjustments.\n");
+         powernow_table[freq_list_count].frequency = CPUFREQ_TABLE_END;
+         powernow_table[freq_list_count].index = 0;
+   }
 
    if (query_current_values_with_pending_wait(data)) {
       kfree(powernow_table);
       return -EIO;
    }
 
-   dprintk("cfid 0x%x, cvid 0x%x\n", data->currfid, data->currvid);
+   printk(KERN_INFO PFX "cfid 0x%x, cvid 0x%x\n", data->currfid, data->currvid);
    data->powernow_table = powernow_table;
    if (cpumask_first(cpu_core_mask(data->cpu)) == data->cpu)
       print_basics(data);
@@ -724,7 +771,7 @@
           (pst[j].vid == data->currvid))
          return 0;
 
-   dprintk("currfid/vid do not match PST, ignoring\n");
+   printk(KERN_INFO PFX "currfid/vid do not match PST, ignoring\n");
    return 0;
 }
 
@@ -859,8 +906,11 @@
    }
 
    /* fill in data->powernow_table */
-   powernow_table = kmalloc((sizeof(struct cpufreq_frequency_table)
-      * (data->acpi_data.state_count + 1)), GFP_KERNEL);
+       if ( freq_list_count >  data->acpi_data.state_count )
+           data->acpi_data.state_count =  freq_list_count;
+
+       powernow_table = kmalloc((sizeof(struct cpufreq_frequency_table) * (data->acpi_data.state_count + 1)), GFP_KERNEL);
+
    if (!powernow_table) {
       dprintk("powernow_table memory alloc failure\n");
       goto err_out;
@@ -973,10 +1023,20 @@
 
       dprintk("   %d : fid 0x%x, vid 0x%x\n", i, fid, vid);
 
-      index = fid | (vid<<8);
+/*      index = fid | (vid<<8);
       powernow_table[i].index = index;
 
-      freq = find_khz_freq_from_fid(fid);
+      freq = find_khz_freq_from_fid(fid);*/
+      /* powernow_table[i].index = fid;  lower 8 bits
+         powernow_table[i].index |= (vid << 8);  upper 8 bits
+         powernow_table[i].frequency = find_khz_freq_from_fid(fid);*/
+      printk(KERN_INFO PFX "Requested %dMHz with %dmV\n",
+             freq_list[i],
+             vcore_list[i]);
+      index = (find_fid_from_freq(freq_list[i])) | (find_vid_from_millivolts(vcore_list[i]) << 8);
+      powernow_table[i].index = index;
+      freq = find_khz_freq_from_fid(find_fid_from_freq(freq_list[i]));
+
       powernow_table[i].frequency = freq;
 
       /* verify frequency is OK */
@@ -1021,7 +1081,9 @@
             (unsigned int)
             (data->acpi_data.states[i].core_frequency
              * 1000));
-         invalidate_entry(data, i);
+         /*invalidate_entry(data, i);*/
+         if ( ( freq_list_count <= 1 ) || ( !freq_list_count ) )
+           invalidate_entry(data, i);
          continue;
       }
    }
Back to top
View user's profile Send private message
new_nOOb
Apprentice
Apprentice


Joined: 05 Mar 2004
Posts: 280

PostPosted: Mon Aug 03, 2009 7:31 am    Post subject: Reply with quote

it´s doesn't work.

root@ubuntu:/usr/src/linux-2.6.30.3# patch -p1 < powernow-patch-2.6.30.3.patch (or -p0)
missing header for unified diff at line 3 of patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- powernow-k8.c-ORIGINAL 2009-08-02 15:39:33.989135271 +0200
|+++ powernow-k8.c 2009-08-02 15:37:50.853136905 +0200
--------------------------
File to patch:


when i go to the directory then


root@ubuntu:/usr/src/linux-2.6.30.3/arch/x86/kernel/cpu/cpufreq# patch -p0 <powernow-patch-2.6.30.3.patch
patching file powernow-k8.c
Hunk #4 succeeded at 77 with fuzz 1.
Hunk #5 succeeded at 95 with fuzz 1.
Hunk #6 FAILED at 689.
Hunk #7 FAILED at 716.
Hunk #8 FAILED at 736.
Hunk #9 FAILED at 771.
Hunk #10 FAILED at 906.
Hunk #11 FAILED at 1023.
Hunk #12 FAILED at 1081.
7 out of 12 hunks FAILED -- saving rejects to file powernow-k8.c.rej
Back to top
View user's profile Send private message
grafrotz
n00b
n00b


Joined: 27 Aug 2006
Posts: 38
Location: Frankfurt, Germany

PostPosted: Mon Aug 03, 2009 8:54 am    Post subject: patching Reply with quote

i did the diff in the directory of powernow-k8.c.

i used:
Code:

diff -Naur


So try this:
Code:

cd /usr/src/linux/arch/x86/kernel/cpu/cpufreq
patch -p0 <powernow-patch-2.6.30.3.patch
Back to top
View user's profile Send private message
new_nOOb
Apprentice
Apprentice


Joined: 05 Mar 2004
Posts: 280

PostPosted: Mon Aug 03, 2009 8:57 am    Post subject: Reply with quote

i try cd /usr/src/linux/arch/x86/kernel/cpu/cpufreq
patch -p0 <powernow-patch-2.6.30.3.patch

and get

Hunk #4 succeeded at 77 with fuzz 1.
Hunk #5 succeeded at 95 with fuzz 1.
Hunk #6 FAILED at 689.
Hunk #7 FAILED at 716.
Hunk #8 FAILED at 736.
Hunk #9 FAILED at 771.
Hunk #10 FAILED at 906.
Hunk #11 FAILED at 1023.
Hunk #12 FAILED at 1081.
7 out of 12 hunks FAILED -- saving rejects to file powernow-k8.c.rej
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64 All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
Page 6 of 8

 
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