<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.linux.kernel.cpufreq">
    <title>gmane.linux.kernel.cpufreq</title>
    <link>http://blog.gmane.org/gmane.linux.kernel.cpufreq</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8129"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8128"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8126"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8124"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8106"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8104"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8103"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8101"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8099"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8092"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8091"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8088"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8086"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8084"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8080"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8079"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8063"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8059"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8058"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8049"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8129">
    <title>(unknown)</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.cpufreq/8129</link>
    <description>&lt;pre&gt;
 i am robothroli, Purchase manager from roli Merchant Ltd. We are
Import/export Company based in taiwan. We are interested in purchasing
your product and I would like to make an inquiry. Please inform me on:

Sample availability and price
Minimum order quantity
FOB Prices

Sincerely
Purchase Manager
robothroli



--
To unsubscribe from this list: send the line "unsubscribe cpufreq" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>robothroli company</dc:creator>
    <dc:date>2012-05-25T13:09:02</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8128">
    <title>Problems with scaling with Core i7 2670QM</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.cpufreq/8128</link>
    <description>&lt;pre&gt;Hello, I'm using Ubuntu 12.04 and I noticed a strange behaviour when I compile a kernel from sou rce. I tried kernel 3.3.7 and made a make oldconfig of my stock kernel from ubuntu and defaulted all the new options, so I was guarateeing that all th e configs of the stock kernel were being imported to the newly compiled and that scaling would work as it should. The problem is the scaling frequency reported by cpuinfo_cur_freq and scaling_cur_freq as shown below, I compar ed those from compiled and stock kernels. What am I missing? Or it's a kind of bug?

/proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cp u family : 6
model : 42
model name : Intel( R) Core(TM) i7-2670QM CPU &amp;lt; at &amp;gt; 2.20GHz
stepping : 7
microco de : 0C39723
cpu MHz : 800.000
cache size  : 6144 KB
physical id : 0
siblings : 8
core id : 0
cpu cores : 4
apicid : 0
init ial apicid : 0
fpu : yes
fpu_exception : yes
 cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm co nstant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf p ni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm id a arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpidbogomips : 4390.25
clflush size : 64
cache_alignm ent : 64
address sizes : 36 bits physical, 48 bits virtual
po wer management:

WITH COMPILED KERNEL:
What I detected is this. I have two different readings for the same pro cessor but one comes from cpuinfo_cur_freq and the other one comes from  scaling_cur_freq as seen below:

sudo cat scaling_cur_freq; sud o cat cpuinfo_cur_freq
800000
1800000


What's the true reading? Why with stock kernel it doesn't  happen the frequencies match!


cat scaling_driver; cat scaling_governor
acpi-cpufreq
ondemand

cat time_in_state
2201000 57624
2200000 2875
2 000000 2297
1900000 631
1800000 620
1700000 709
160 0000 659
1500000 789
1400000 793
1300000 822
120000 0 801
1100000 977
1000000 1142
900000 705
800000 84 2189


WITH STOCK KERNEL:

With stock kernel, just for comparison, as you can see it's more logical a nd the readings match, even the one that shows the time_in_state.
 

sudo cat scaling_cur_freq; sudo cat cpuinfo_cur_freq
800000
800000


cat scaling_driver;  cat scaling_governor
acpi-cpufreq
ondemand


cat time_in_state
2201000 22259
2200000 50
200000 0 28
1900000 57
1800000 42
1700000 53
1600000 551500000 112
1400000 241
1300000 280
1200000 355
 1100000 296
1000000 403
900000 1642
800000 145615
 

Leandro Scott

--
To unsubscribe from this list: send the line "unsubscribe cpufreq" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Leandro Scott R.Z. Jacques</dc:creator>
    <dc:date>2012-05-24T13:41:05</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8126">
    <title>cpufreq regression + link to patch</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.cpufreq/8126</link>
    <description>&lt;pre&gt;Hi, this is to report a cpufreq regression in kernel:
$ uname -r
3.2.0-2-amd64

The bug has been reported at least twice and a patch has been proposed:
http://permalink.gmane.org/gmane.linux.kernel.cpufreq/4190
http://permalink.gmane.org/gmane.linux.mandrake.bugs/143027

More information:
$ sudo cpufreq-info
cpufrequtils 007: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq&amp;lt; at &amp;gt;vger.kernel.org, please.
analyzing CPU 0:
   no or unknown cpufreq driver is active on this CPU
   maximum transition latency: 4294.55 ms.
analyzing CPU 1:
   no or unknown cpufreq driver is active on this CPU
   maximum transition latency: 4294.55 ms.

$ sudo modprobe -l |grep cpufreq
kernel/drivers/cpufreq/cpufreq_stats.ko
kernel/drivers/cpufreq/cpufreq_powersave.ko
kernel/drivers/cpufreq/cpufreq_userspace.ko
kernel/drivers/cpufreq/cpufreq_conservative.ko
kernel/drivers/cpufreq/powernow-k8.ko
kernel/drivers/cpufreq/mperf.ko
kernel/drivers/cpufreq/acpi-cpufreq.ko
kernel/drivers/cpufreq/pcc-cpufreq.ko
kernel/drivers/cpufreq/speedstep-lib.ko
kernel/drivers/cpufreq/speedstep-centrino.ko
kernel/drivers/cpufreq/p4-clockmod.ko

$ cat /proc/cpuinfo
processor    : 0
vendor_id    : GenuineIntel
cpu family    : 15
model        : 6
model name    : Intel(R) Pentium(R) D CPU 3.00GHz
stepping    : 2
microcode    : 0xf
cpu MHz        : 2992.660
cache size    : 2048 KB
physical id    : 0
siblings    : 2
core id        : 0
cpu cores    : 2
apicid        : 0
initial apicid    : 0
fpu        : yes
fpu_exception    : yes
cpuid level    : 6
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca 
cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall 
nx lm constant_tsc pebs bts nopl pni dtes64 monitor ds_cpl vmx cid cx16 
xtpr pdcm lahf_lm tpr_shadow
bogomips    : 5985.32
clflush size    : 64
cache_alignment    : 128
address sizes    : 36 bits physical, 48 bits virtual
power management:

processor    : 1
vendor_id    : GenuineIntel
cpu family    : 15
model        : 6
model name    : Intel(R) Pentium(R) D CPU 3.00GHz
stepping    : 2
microcode    : 0xf
cpu MHz        : 2992.660
cache size    : 2048 KB
physical id    : 0
siblings    : 2
core id        : 1
cpu cores    : 2
apicid        : 1
initial apicid    : 1
fpu        : yes
fpu_exception    : yes
cpuid level    : 6
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca 
cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall 
nx lm constant_tsc pebs bts nopl pni dtes64 monitor ds_cpl vmx cid cx16 
xtpr pdcm lahf_lm tpr_shadow
bogomips    : 5985.83
clflush size    : 64
cache_alignment    : 128
address sizes    : 36 bits physical, 48 bits virtual
power management:

motherboard: GA-8i945PM(-RH)
--
To unsubscribe from this list: send the line "unsubscribe cpufreq" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Serge Stroobandt</dc:creator>
    <dc:date>2012-05-21T08:13:49</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8124">
    <title>Celeron and cpufreq</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.cpufreq/8124</link>
    <description>&lt;pre&gt;Good morning,


I am trying to run cpufrequtils on a netbook with Celeron.
Unfortunately, it seems to do not run.

Why doesn't it run, please ? Is Celeron unable to handle cpufreq ?

Thanks a lot



this have been posted in French here:
http://forums.archlinux.fr/post94289.html#p94289

$ sudo cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Veuillez rapportez les erreurs et les bogues à cpufreq&amp;lt; at &amp;gt;vger.kernel.org,
s'il vous plait. analyse du CPU 0 :
  pas de pilotes cpufreq reconnu pour ce CPU
  maximum transition latency: 4294.55 ms.

$ sudo rc.d start cpufreq
:: Setting cpufreq governing
rules
[BUSY]
grep: /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_governors:
No such file or directory , cpu 0wrong, unknown or unhandled CPU? Error
setting new values. Common errors:
- Do you have proper administration rights? (super-user?)
- Is the governor you requested available and modprobed?
- Trying to set an invalid policy?
- Trying to set a specific frequency, but userspace governor is not
available, for example because of hardware which cannot be set to a
specific frequency or because the userspace governor isn't loaded?


$  sudo ls /lib/modules/$(uname -r)/kernel/drivers/cpufreq/
acpi-cpufreq.ko.gz          cpufreq_powersave.ko.gz
cpufreq_userspace.ko.gz  p4-clockmod.ko.gz  powernow-k8.ko.gz
cpufreq_conservative.ko.gz  cpufreq_stats.ko.gz
mperf.ko.gz              pcc-cpufreq.ko.gz  speedstep-lib.ko.gz


$ sudo modprobe p4-clockmod
ERROR: could not insert 'p4_clockmod': No such device


$ sudo cat /proc/cpuinfo
processor   : 0
vendor_id   : GenuineIntel
cpu family   : 6
model      : 23
model name   : Intel(R) Celeron(R) CPU          723  &amp;lt; at &amp;gt; 1.20GHz

stepping   : 10
microcode   : 0xa0b
cpu MHz      : 1197.098
cache size   : 1024 KB
fpu      : yes
fpu_exception   : yes
cpuid level   : 13
wp      : yes
flags      : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss tm pbe syscall nx
lm constant_tsc up arch_perfmon pebs bts rep_good nopl aperfmperf pni
dtes64 monitor ds_cpl tm2 ssse3 cx16 xtpr pdcm xsave lahf_lm dts
bogomips   : 2395.95 clflush size   : 64 cache_alignment   : 64 address
sizes   : 36 bits physical, 48 bits virtual power management:


NOTE: vitual power management is EMPTY!
--
To unsubscribe from this list: send the line "unsubscribe cpufreq" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Raphael Maville</dc:creator>
    <dc:date>2012-05-19T07:30:51</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8106">
    <title>haalloo,</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.cpufreq/8106</link>
    <description>&lt;pre&gt;haalloo,
how are you doing,i hope you are fine,my name is miss abi okom i got your
contact and want us to be a good friend,
please try and write back to me so that i will give you my pictures and tell
you more about me,
--
To unsubscribe from this list: send the line "unsubscribe cpufreq" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>abi</dc:creator>
    <dc:date>2012-05-12T16:57:06</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8104">
    <title>[PATCH] X86 acpi_cpufreq: Do not use request_module for autoloading</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.cpufreq/8104</link>
    <description>&lt;pre&gt;X86 acpi_cpufreq: Do not use request_module for autoloading

The idea to check for needed cpufreq functions in ACPI processor object is
a good (perfect) one, but using request_module in processor.ko
has bad side-effects:
It opens a hidden dependency: acpi-cpufreq.ko must be accessable when
processor.ko is loaded (which is not the case if the latter gets loaded
in initrd where the other one might not be present).
Also I guess calling modprobe userspace from inside the kernel
(comments indicate that is what happens), is considered an ugly workaround
if nothing else works.

Therefore try to load acpi-cpufreq on all CPUs with EST (Enhanced Speed Step)
cpu feature flag.
This may result in trying to load acpi-cpufreq on some machines which do
not have cpufreq ACPI functions (which should be a BIOS bug then), but this
does not hurt. acpi-cpufreq should always be the preferred cpufreq driver
for EST capable CPUs.
I am not 100% sure about VIA machines also exposing ACPI cpufreq functions.
I could imagine they also have this CPU id feature set and everything is fine.
In fact I have such a CPU at home, but trying it out is time intensive.
As autoloading is a new feature, there cannot be regressions and if a non
Intel CPU shows up that needs this driver as well, it can easily be added by
another matching X86 model/family/feature line.

References: https://bugzilla.novell.com/show_bug.cgi?id=756085

Signed-off-by: Thomas Renninger &amp;lt;trenn&amp;lt; at &amp;gt;suse.de&amp;gt;
Tested-by: tittiatcoke&amp;lt; at &amp;gt;gmail.com

---
 drivers/acpi/processor_driver.c  |    1 -
 drivers/acpi/processor_perflib.c |   22 ----------------------
 drivers/cpufreq/acpi-cpufreq.c   |    7 +++++++
 include/acpi/processor.h         |    1 -
 4 files changed, 7 insertions(+), 24 deletions(-)

diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index 0734086..9863bc2 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -474,7 +474,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static __ref int acpi_processor_start(struct acpi_processor *pr)
 
 #ifdef CONFIG_CPU_FREQ
 acpi_processor_ppc_has_changed(pr, 0);
-acpi_processor_load_module(pr);
 #endif
 acpi_processor_get_throttling_info(pr);
 acpi_processor_get_limit_in.git/patches/acpi_cpufreq_autoload/x86_acpi_cpufreq_autoload.patchfo(pr);
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index 0af48a8..85b3237 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -240,28 +240,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void acpi_processor_ppc_exit(void)
 acpi_processor_ppc_status &amp;amp;= ~PPC_REGISTERED;
 }
 
-/*
- * Do a quick check if the systems looks like it should use ACPI
- * cpufreq. We look at a _PCT method being available, but don't
- * do a whole lot of sanity checks.
- */
-void acpi_processor_load_module(struct acpi_processor *pr)
-{
-static int requested;
-acpi_status status = 0;
-struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
-
-if (!arch_has_acpi_pdc() || requested)
-return;
-status = acpi_evaluate_object(pr-&amp;gt;handle, "_PCT", NULL, &amp;amp;buffer);
-if (!ACPI_FAILURE(status)) {
-printk(KERN_INFO PREFIX "Requesting acpi_cpufreq\n");
-request_module_nowait("acpi_cpufreq");
-requested = 1;
-}
-kfree(buffer.pointer);
-}
-
 static int acpi_processor_get_performance_control(struct acpi_processor *pr)
 {
 int result = 0;
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index 56c6c6b..c7b8174 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -66,6 +66,13 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; struct acpi_cpufreq_data {
 unsigned int cpu_feature;
 };
 
+static const struct x86_cpu_id acpi_cpufreq_ids[] = {
+/* Enhanced Speed Step */
+X86_FEATURE_MATCH(X86_FEATURE_EST),
+{}
+};
+MODULE_DEVICE_TABLE(x86cpu, acpi_cpufreq_ids);
+
 static DEFINE_PER_CPU(struct acpi_cpufreq_data *, acfreq_data);
 
 /* acpi_perf_data is a pointer to percpu data. */
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index 9d65047..8cf7e98 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -225,7 +225,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; struct acpi_processor_errata {
 } piix4;
 };
 
-extern void acpi_processor_load_module(struct acpi_processor *pr);
 extern int acpi_processor_preregister_performance(struct
   acpi_processor_performance
   __percpu *performance);
--
To unsubscribe from this list: send the line "unsubscribe cpufreq" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Thomas Renninger</dc:creator>
    <dc:date>2012-05-11T15:52:24</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8103">
    <title>[PATCH] cpufreq: interface for setting governor for a cpu</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.cpufreq/8103</link>
    <description>&lt;pre&gt;From: Puneet Saxena &amp;lt;puneets&amp;lt; at &amp;gt;nvidia.com&amp;gt;

This implementation sets governor for a cpu using existing
cpufreq interfaces.

Signed-off-by: Puneet Saxena &amp;lt;puneets&amp;lt; at &amp;gt;nvidia.com&amp;gt;
---

This is applicable for the usecase where user wants to change
the governor inside kernel. Earlier if driver wants to change
cpu governor, it needs to write in userspace sysfs "store"
entry, which calls "store_scaling_governor()", a kernel interface.
The implementation avoids the unwanted flow from KENREL--&amp;gt;
USER--&amp;gt;KERNEL.

 drivers/cpufreq/cpufreq.c |   50 +++++++++++++++++++++++++++++++++++++++++++++
 include/linux/cpufreq.h   |    1 +
 2 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 3acc428..5bbe8c3 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1785,6 +1785,56 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; no_policy:
 }
 EXPORT_SYMBOL(cpufreq_update_policy);
 
+/*
+ *cpufreq_set_gov - set governor for a cpu
+ *&amp;lt; at &amp;gt;cpu: CPU whose governor needs to be changed
+ *&amp;lt; at &amp;gt;target_gov: new governor to be set
+ */
+int cpufreq_set_gov(char *target_gov, unsigned int cpu)
+{
+int ret = 0;
+struct cpufreq_policy new_policy;
+struct cpufreq_policy *cur_policy;
+
+if (target_gov == NULL)
+return -EINVAL;
+
+/* Get current governer */
+cur_policy = cpufreq_cpu_get(cpu);
+if (!cur_policy)
+return -EINVAL;
+
+new_policy = *cur_policy;
+if (!strncmp(cur_policy-&amp;gt;governor-&amp;gt;name, target_gov,
+strlen(target_gov))) {
+/* Target governer &amp;amp; current governer is same */
+ret = -EINVAL;
+goto err_out;
+} else {
+if (cpufreq_parse_governor(target_gov, &amp;amp;new_policy.policy,
+&amp;amp;new_policy.governor)) {
+ret = -EINVAL;
+goto err_out;
+}
+
+if (lock_policy_rwsem_write(cur_policy-&amp;gt;cpu) &amp;lt; 0) {
+ret = -EINVAL;
+goto err_out;
+}
+
+ret = __cpufreq_set_policy(cur_policy, &amp;amp;new_policy);
+
+cur_policy-&amp;gt;user_policy.policy = cur_policy-&amp;gt;policy;
+cur_policy-&amp;gt;user_policy.governor = cur_policy-&amp;gt;governor;
+
+unlock_policy_rwsem_write(cur_policy-&amp;gt;cpu);
+}
+err_out:
+cpufreq_cpu_put(cur_policy);
+return ret;
+}
+EXPORT_SYMBOL(cpufreq_set_gov);
+
 static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb,
 unsigned long action, void *hcpu)
 {
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index c6126b9..09b8ea9 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -310,6 +310,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; __ATTR(_name, 0644, show_##_name, store_##_name)
  *********************************************************************/
 int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu);
 int cpufreq_update_policy(unsigned int cpu);
+int cpufreq_set_gov(char *target_gov, unsigned int cpu);
 
 #ifdef CONFIG_CPU_FREQ
 /* query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it */
&lt;/pre&gt;</description>
    <dc:creator>puneets&lt; at &gt;nvidia.com</dc:creator>
    <dc:date>2012-05-11T12:50:28</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8101">
    <title>[PATCH 3/3] arm: tegra: governor: change governor using cpufreq interface</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.cpufreq/8101</link>
    <description>&lt;pre&gt;From: Puneet Saxena &amp;lt;puneets&amp;lt; at &amp;gt;nvidia.com&amp;gt;

Older code sets "conservative" governor in early-suspend
using sysfs entries.This implementation changes governor
in early-suspend using cpufreq interfaces.

bug 871958

Change-Id: I721afb6184982a063dc5f330da31f8fb88481cfd
Signed-off-by: Puneet Saxena &amp;lt;puneets&amp;lt; at &amp;gt;nvidia.com&amp;gt;
---
 arch/arm/mach-tegra/board-enterprise-panel.c |   18 ++--
 arch/arm/mach-tegra/board-kai-panel.c        |   19 +---
 arch/arm/mach-tegra/board-ventana-panel.c    |   17 +--
 arch/arm/mach-tegra/board-whistler-panel.c   |   19 ++--
 arch/arm/mach-tegra/board.h                  |   17 ++--
 arch/arm/mach-tegra/common.c                 |  134 +++++++-------------------
 6 files changed, 71 insertions(+), 153 deletions(-)

diff --git a/arch/arm/mach-tegra/board-enterprise-panel.c b/arch/arm/mach-tegra/board-enterprise-panel.c
index 8ac2e66..368d8c6 100644
--- a/arch/arm/mach-tegra/board-enterprise-panel.c
+++ b/arch/arm/mach-tegra/board-enterprise-panel.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -816,17 +816,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void enterprise_panel_early_suspend(struct early_suspend *h)
 fb_blank(registered_fb[0], FB_BLANK_POWERDOWN);
 if (num_registered_fb &amp;gt; 1)
 fb_blank(registered_fb[1], FB_BLANK_NORMAL);
-#ifdef CONFIG_TEGRA_CONVSERVATIVE_GOV_ON_EARLYSUPSEND
-cpufreq_save_default_governor();
-cpufreq_set_conservative_governor();
-cpufreq_set_conservative_governor_param("up_threshold",
-SET_CONSERVATIVE_GOVERNOR_UP_THRESHOLD);
-
-cpufreq_set_conservative_governor_param("down_threshold",
-SET_CONSERVATIVE_GOVERNOR_DOWN_THRESHOLD);
 
-cpufreq_set_conservative_governor_param("freq_step",
-SET_CONSERVATIVE_GOVERNOR_FREQ_STEP);
+#ifdef CONFIG_TEGRA_CONVSERVATIVE_GOV_ON_EARLYSUPSEND
+cpufreq_store_default_gov();
+if (cpufreq_change_gov(cpufreq_conservative_gov))
+pr_err("Early_suspend: Error changing governor to %s\n",
+cpufreq_conservative_gov);
 #endif
 }
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -835,7 +830,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void enterprise_panel_late_resume(struct early_suspend *h)
 unsigned i;
 
 #ifdef CONFIG_TEGRA_CONVSERVATIVE_GOV_ON_EARLYSUPSEND
-cpufreq_restore_default_governor();
+if (cpufreq_restore_default_gov())
+pr_err("Early_suspend: Unable to restore governor\n");
 #endif
 for (i = 0; i &amp;lt; num_registered_fb; i++)
 fb_blank(registered_fb[i], FB_BLANK_UNBLANK);
diff --git a/arch/arm/mach-tegra/board-kai-panel.c b/arch/arm/mach-tegra/board-kai-panel.c
index 53661ce..0a68387 100644
--- a/arch/arm/mach-tegra/board-kai-panel.c
+++ b/arch/arm/mach-tegra/board-kai-panel.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -620,27 +620,20 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void kai_panel_early_suspend(struct early_suspend *h)
 fb_blank(registered_fb[0], FB_BLANK_POWERDOWN);
 if (num_registered_fb &amp;gt; 1)
 fb_blank(registered_fb[1], FB_BLANK_NORMAL);
-
 #ifdef CONFIG_TEGRA_CONVSERVATIVE_GOV_ON_EARLYSUPSEND
-cpufreq_save_default_governor();
-cpufreq_set_conservative_governor();
-cpufreq_set_conservative_governor_param("up_threshold",
-SET_CONSERVATIVE_GOVERNOR_UP_THRESHOLD);
-
-cpufreq_set_conservative_governor_param("down_threshold",
-SET_CONSERVATIVE_GOVERNOR_DOWN_THRESHOLD);
-
-cpufreq_set_conservative_governor_param("freq_step",
-SET_CONSERVATIVE_GOVERNOR_FREQ_STEP);
+cpufreq_store_default_gov();
+if (cpufreq_change_gov(cpufreq_conservative_gov))
+pr_err("Early_suspend: Error changing governor to %s\n",
+cpufreq_conservative_gov);
 #endif
-
 }
 
 static void kai_panel_late_resume(struct early_suspend *h)
 {
 unsigned i;
 #ifdef CONFIG_TEGRA_CONVSERVATIVE_GOV_ON_EARLYSUPSEND
-cpufreq_restore_default_governor();
+if (cpufreq_restore_default_gov())
+pr_err("Early_suspend: Unable to restore governor\n");
 #endif
 for (i = 0; i &amp;lt; num_registered_fb; i++)
 fb_blank(registered_fb[i], FB_BLANK_UNBLANK);
diff --git a/arch/arm/mach-tegra/board-ventana-panel.c b/arch/arm/mach-tegra/board-ventana-panel.c
index 4cacd3d..84e75a4 100644
--- a/arch/arm/mach-tegra/board-ventana-panel.c
+++ b/arch/arm/mach-tegra/board-ventana-panel.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -366,16 +366,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void ventana_panel_early_suspend(struct early_suspend *h)
 if (num_registered_fb &amp;gt; 1)
 fb_blank(registered_fb[1], FB_BLANK_NORMAL);
 #ifdef CONFIG_TEGRA_CONVSERVATIVE_GOV_ON_EARLYSUPSEND
-cpufreq_save_default_governor();
-cpufreq_set_conservative_governor();
-        cpufreq_set_conservative_governor_param("up_threshold",
-SET_CONSERVATIVE_GOVERNOR_UP_THRESHOLD);
-
-cpufreq_set_conservative_governor_param("down_threshold",
-SET_CONSERVATIVE_GOVERNOR_DOWN_THRESHOLD);
-
-cpufreq_set_conservative_governor_param("freq_step",
-SET_CONSERVATIVE_GOVERNOR_FREQ_STEP);
+cpufreq_store_default_gov();
+if (cpufreq_change_gov(cpufreq_conservative_gov))
+pr_err("Early_suspend: Error changing governor to %s\n",
+cpufreq_conservative_gov);
 #endif
 }
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -383,7 +377,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void ventana_panel_late_resume(struct early_suspend *h)
 {
 unsigned i;
 #ifdef CONFIG_TEGRA_CONVSERVATIVE_GOV_ON_EARLYSUPSEND
-cpufreq_restore_default_governor();
+if (cpufreq_restore_default_gov())
+pr_err("Early_suspend: Unable to restore governor\n");
 #endif
 for (i = 0; i &amp;lt; num_registered_fb; i++)
 fb_blank(registered_fb[i], FB_BLANK_UNBLANK);
diff --git a/arch/arm/mach-tegra/board-whistler-panel.c b/arch/arm/mach-tegra/board-whistler-panel.c
index 74075d4..7582c77 100644
--- a/arch/arm/mach-tegra/board-whistler-panel.c
+++ b/arch/arm/mach-tegra/board-whistler-panel.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -318,25 +318,22 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void whistler_panel_early_suspend(struct early_suspend *h)
 fb_blank(registered_fb[1], FB_BLANK_NORMAL);
 
 #ifdef CONFIG_TEGRA_CONVSERVATIVE_GOV_ON_EARLYSUPSEND
-cpufreq_save_default_governor();
-cpufreq_set_conservative_governor();
-        cpufreq_set_conservative_governor_param("up_threshold",
-SET_CONSERVATIVE_GOVERNOR_UP_THRESHOLD);
-
-cpufreq_set_conservative_governor_param("down_threshold",
-SET_CONSERVATIVE_GOVERNOR_DOWN_THRESHOLD);
-
-cpufreq_set_conservative_governor_param("freq_step",
-SET_CONSERVATIVE_GOVERNOR_FREQ_STEP);
+cpufreq_store_default_gov();
+if (cpufreq_change_gov(cpufreq_conservative_gov))
+pr_err("Early_suspend: Error changing governor to %s\n",
+cpufreq_conservative_gov);
 #endif
 }
 
 static void whistler_panel_late_resume(struct early_suspend *h)
 {
 unsigned i;
+
 #ifdef CONFIG_TEGRA_CONVSERVATIVE_GOV_ON_EARLYSUPSEND
-cpufreq_restore_default_governor();
+if (cpufreq_restore_default_gov())
+pr_err("Early_suspend: Unable to restore governor\n");
 #endif
+
 for (i = 0; i &amp;lt; num_registered_fb; i++)
 fb_blank(registered_fb[i], FB_BLANK_UNBLANK);
 }
diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h
index c7ab065..63095ce 100644
--- a/arch/arm/mach-tegra/board.h
+++ b/arch/arm/mach-tegra/board.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -157,16 +157,17 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void tegra_get_board_info(struct board_info *);
 void tegra_get_pmu_board_info(struct board_info *bi);
 void tegra_get_display_board_info(struct board_info *bi);
 void tegra_get_camera_board_info(struct board_info *bi);
+
 #ifdef CONFIG_TEGRA_CONVSERVATIVE_GOV_ON_EARLYSUPSEND
-#define SET_CONSERVATIVE_GOVERNOR_UP_THRESHOLD 95
-#define SET_CONSERVATIVE_GOVERNOR_DOWN_THRESHOLD 50
-#define SET_CONSERVATIVE_GOVERNOR_FREQ_STEP 3
-
-void cpufreq_save_default_governor(void);
-void cpufreq_restore_default_governor(void);
-void cpufreq_set_conservative_governor(void);
-void cpufreq_set_conservative_governor_param(char *name, int value);
+#define MAX_GOV_NAME_LEN 16
+extern char cpufreq_default_gov[][MAX_GOV_NAME_LEN];
+extern char *cpufreq_conservative_gov;
+
+void cpufreq_store_default_gov(void);
+int cpufreq_restore_default_gov(void);
+int cpufreq_change_gov(char *target_gov);
 #endif
+
 int get_core_edp(void);
 enum panel_type get_panel_type(void);
 int tegra_get_modem_id(void);
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index aef4201..78bd77d 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -28,6 +28,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include &amp;lt;linux/memblock.h&amp;gt;
 #include &amp;lt;linux/bitops.h&amp;gt;
 #include &amp;lt;linux/sched.h&amp;gt;
+#include &amp;lt;linux/cpufreq.h&amp;gt;
 
 #include &amp;lt;asm/hardware/cache-l2x0.h&amp;gt;
 #include &amp;lt;asm/system.h&amp;gt;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -953,118 +954,53 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void __init tegra_release_bootloader_fb(void)
 }
 
 #ifdef CONFIG_TEGRA_CONVSERVATIVE_GOV_ON_EARLYSUPSEND
-static char cpufreq_gov_default[32];
-static char *cpufreq_gov_conservative = "conservative";
-static char *cpufreq_sysfs_place_holder="/sys/devices/system/cpu/cpu%i/cpufreq/scaling_governor";
-static char *cpufreq_gov_conservative_param="/sys/devices/system/cpu/cpufreq/conservative/%s";
+char cpufreq_default_gov[CONFIG_NR_CPUS][MAX_GOV_NAME_LEN];
+char *cpufreq_conservative_gov = "conservative";
 
-static void cpufreq_set_governor(char *governor)
+void cpufreq_store_default_gov(void)
 {
-struct file *scaling_gov = NULL;
-mm_segment_t old_fs;
-char    buf[128];
-int i = 0;
-loff_t offset = 0;
+unsigned int cpu;
+struct cpufreq_policy *policy;
 
-if (governor == NULL)
-return;
-
-/* change to KERNEL_DS address limit */
-old_fs = get_fs();
-set_fs(KERNEL_DS);
-#ifndef CONFIG_TEGRA_AUTO_HOTPLUG
-for_each_online_cpu(i)
-#endif
-{
-sprintf(buf, cpufreq_sysfs_place_holder, i);
-scaling_gov = filp_open(buf, O_RDWR, 0);
-if (scaling_gov != NULL) {
-if (scaling_gov-&amp;gt;f_op != NULL &amp;amp;&amp;amp;
-scaling_gov-&amp;gt;f_op-&amp;gt;write != NULL)
-scaling_gov-&amp;gt;f_op-&amp;gt;write(scaling_gov,
-governor,
-strlen(governor),
-&amp;amp;offset);
-else
-pr_err("f_op might be null\n");
-
-filp_close(scaling_gov, NULL);
-} else {
-pr_err("%s. Can't open %s\n", __func__, buf);
+for (cpu = 0; cpu &amp;lt; CONFIG_NR_CPUS; cpu++) {
+policy = cpufreq_cpu_get(cpu);
+if (policy) {
+sprintf(cpufreq_default_gov[cpu], "%s",
+policy-&amp;gt;governor-&amp;gt;name);
+cpufreq_cpu_put(policy);
 }
 }
-set_fs(old_fs);
 }
 
-void cpufreq_save_default_governor(void)
+int cpufreq_change_gov(char *target_gov)
 {
-struct file *scaling_gov = NULL;
-mm_segment_t old_fs;
-char    buf[128];
-loff_t offset = 0;
-
-/* change to KERNEL_DS address limit */
-old_fs = get_fs();
-set_fs(KERNEL_DS);
-
-buf[127] = 0;
-sprintf(buf, cpufreq_sysfs_place_holder,0);
-scaling_gov = filp_open(buf, O_RDONLY, 0);
-if (scaling_gov != NULL) {
-if (scaling_gov-&amp;gt;f_op != NULL &amp;amp;&amp;amp;
-scaling_gov-&amp;gt;f_op-&amp;gt;read != NULL)
-scaling_gov-&amp;gt;f_op-&amp;gt;read(scaling_gov,
-cpufreq_gov_default,
-32,
-&amp;amp;offset);
-else
-pr_err("f_op might be null\n");
-
-filp_close(scaling_gov, NULL);
-} else {
-pr_err("%s. Can't open %s\n", __func__, buf);
-}
-set_fs(old_fs);
-}
+unsigned int cpu = 0;
 
-void cpufreq_restore_default_governor(void)
-{
-cpufreq_set_governor(cpufreq_gov_default);
+#ifndef CONFIG_TEGRA_AUTO_HOTPLUG
+for_each_online_cpu(cpu)
+#endif
+return cpufreq_set_gov(target_gov, cpu);
 }
 
-void cpufreq_set_conservative_governor_param(char *name, int value)
+int cpufreq_restore_default_gov(void)
 {
-struct file *gov_param = NULL;
-mm_segment_t old_fs;
-static char buf[128], param_value[8];
-loff_t offset = 0;
-
-/* change to KERNEL_DS address limit */
-old_fs = get_fs();
-set_fs(KERNEL_DS);
-
-sprintf(param_value, "%d", value);
-sprintf(buf, cpufreq_gov_conservative_param, name);
-gov_param = filp_open(buf, O_RDWR, 0);
-if (gov_param != NULL) {
-if (gov_param-&amp;gt;f_op != NULL &amp;amp;&amp;amp;
-gov_param-&amp;gt;f_op-&amp;gt;write != NULL)
-gov_param-&amp;gt;f_op-&amp;gt;write(gov_param,
-param_value,
-strlen(param_value),
-&amp;amp;offset);
-else
-pr_err("f_op might be null\n");
+int ret = 0;
+unsigned int cpu;
 
-filp_close(gov_param, NULL);
-} else {
-pr_err("%s. Can't open %s\n", __func__, buf);
+for (cpu = 0; cpu &amp;lt; CONFIG_NR_CPUS; cpu++) {
+if (strlen((const char *)&amp;amp;cpufreq_default_gov[cpu])) {
+ret = cpufreq_set_gov(cpufreq_default_gov[cpu], cpu);
+if (ret &amp;lt; 0)
+/* Unable to restore gov for the cpu as
+ * It was online on suspend and becomes
+ * offline on resume.
+ */
+pr_info("Unable to restore gov:%s for cpu:%d,"
+, cpufreq_default_gov[cpu]
+, cpu);
+}
+cpufreq_default_gov[cpu][0] = '\0';
 }
-set_fs(old_fs);
-}
-
-void cpufreq_set_conservative_governor(void)
-{
-cpufreq_set_governor(cpufreq_gov_conservative);
+return ret;
 }
 #endif /* CONFIG_TEGRA_CONVSERVATIVE_GOV_ON_EARLYSUPSEND */
&lt;/pre&gt;</description>
    <dc:creator>puneets&lt; at &gt;nvidia.com</dc:creator>
    <dc:date>2012-05-11T12:32:36</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8099">
    <title>Question on CPU Frequency subsystem</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.cpufreq/8099</link>
    <description>&lt;pre&gt;Hi,

I had a question on CPU Frequency subsystem. As there are multiple
governors which can be set on different CPU cores. If we have 4 cores
lying under the one power domain and voltage rail and suppose governor
setting is:

cpu0: performance
cpu1: on demand
cpu2: on demand
cpu3: performance

Since All cores are lying under same power rails, as we set the cpu0
to performance governor which will set the cpu0 and cpu3 to maximum
frequency and hence sustainable voltage for that frequency but cpu1
and cpu2 are using on demand governor, suppose the load is low on cpu1
and cpu2 cores, therefore on demand governor will try to set the low
frequency and voltage based on the load. Since cpu0 is at high
frequency and cpu1 is at low frequency, which part of cpufreq system
will restrict the voltage to stay high as voltage rail is shared and
one cpu is running at low frequency and another at high frequency?

Regards
Yogesh
--
To unsubscribe from this list: send the line "unsubscribe cpufreq" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Yogesh Kumar</dc:creator>
    <dc:date>2012-05-09T15:30:08</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8092">
    <title>My Beloved in Christ</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.cpufreq/8092</link>
    <description>&lt;pre&gt;Dear Beloved in Christ,

I am Mrs. Mary Parker an aging widow suffering from long time illness. I have some funds I inherited from my late husband, the sum of 7.5 Million Pounds and I needed a very honest and God fearing Christian that will use the fund for God's work, I found your email address from the internet and decided to contact you. Please if you would be able to use the funds for the Lord's work, kindly reply me back.

Yours in the Lord, 

Mrs. Mary Parker
--
To unsubscribe from this list: send the line "unsubscribe cpufreq" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Mrs. Mary Parker</dc:creator>
    <dc:date>2012-05-04T06:15:25</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8091">
    <title>CPUFREQ maintainence.</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.cpufreq/8091</link>
    <description>&lt;pre&gt;This last few releases I've been more of a hindrance than help to getting
some of the patches merged upstream, so due to my lack of time, I'm considering
removing myself as maintainer, and having patches routed as such instead...

ARM -&amp;gt; Russell/relevant ARM subtree maintainers
x86 driver patches -&amp;gt; x86&amp;lt; at &amp;gt;vger.kernel.org
(All the other archs currently supported already go through the arch trees mips/sparc etc)

The core doesn't see a huge amount of change these days, I figure patches for
that can just go to lkml &amp;amp; Linus/Andrew like any other subsystem.

comments?

Dave
--
To unsubscribe from this list: send the line "unsubscribe cpufreq" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Dave Jones</dc:creator>
    <dc:date>2012-04-30T14:06:45</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8088">
    <title>[Bug 43179] New: VIA Nano hangs on some CPU scaling governors and at some freqs</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.cpufreq/8088</link>
    <description>&lt;pre&gt;https://bugzilla.kernel.org/show_bug.cgi?id=43179

               URL: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/8
                    05205
           Summary: VIA Nano hangs on some CPU scaling governors and at
                    some freqs
           Product: Power Management
           Version: 2.5
    Kernel Version: 3.4.0-999-generic
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: high
          Priority: P1
         Component: cpufreq
        AssignedTo: cpufreq&amp;lt; at &amp;gt;vger.kernel.org
        ReportedBy: lelandyue&amp;lt; at &amp;gt;gmail.com
        Regression: No


OVERVIEW: 
- Ubuntu 10.04 hangs when the CPU scaling governor is set to "ondemand",
"conservative", or "userspace" at 1000 MHz and 900 MHz. Other freqs don't hang.

NOTES:
- This bug also occurs on Ubuntu 11.10.
- The original bug was filed at bugs.launchpad.net:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/805205 . The original
details were written for Ubuntu 10.04. The same details apply to 11.10.
- I downloaded and tested the mainline kernel
"linux-image-3.4.0-999-generic_3.4.0-999.201204260409_amd64.deb" on Ubuntu
11.10. The hang still occurs.

HARDWARE:
Motherboard: Jetway NF77-N1G6-LF
CPU: VIA Nano processor L2200&amp;lt; at &amp;gt;1600MHz
Ubuntu installer: Ubuntu 10.04.1 64-bit alternate

TEST SETUP (disabling the ondemand script):
- In Ubuntu, there is an "ondemand" script that gets executed each time the OS
boots. This will cause the entire system hang and mess up the test setup. So we
need to disable the script before running a test.
- Install Ubuntu 10.04.1 64-bit from an alternate CD or an alternate USB stick.
- As soon as you reach the login screen, quickly press CTRL+ALT+F6 to go to a
terminal, then quickly type "sudo chmod -x /etc/init.d/ondemand". Then quickly
type "sudo reboot" to reboot the computer. This will disable the ondemand
script from changing the cpu governor on the next boot.
- On the next boot, log in normally, then update all packages from the Update
Manager, and reboot if necessary.
- Launch a Terminal window. All test cmds will be executed from this directory:
$ cd /sys/devices/system/cpu/cpu0/cpufreq
- Open a 2nd Terminal window and execute this so you can watch the CPU freq.
$ watch -n0 "cat /proc/cpuinfo"

TEST:
- Check the available and current governor, the available freqs, and the
scaling driver.
$ cat scaling_available_governors
conservative ondemand userspace powersave performance
$ cat scaling_governor
performance
$ cat scaling_available_frequencies
1600000 1400000 1300000 1200000 1100000 1000000 900000 800000
$ cat scaling_driver
acpi-cpufreq

- Try powersave. The CPU drops to 800 MHz. No hang.
$ echo -n powersave | sudo tee scaling_governor

- Try ondemand. Ubuntu hangs after I press enter.
$ echo -n ondemand | sudo tee scaling_governor

- Reboot, then try conservative. Ubuntu hangs a moment after I press enter. I
observed the CPU freq dropping to 1400 MHz, then 1300 MHz, 1200 MHz, 1100 MHz,
then hang.
$ echo -n conservative | sudo tee scaling_governor

- Reboot, then try userspace. No hang at this point. CPU freq is 1600 MHz.
$ echo -n userspace | sudo tee scaling_governor

- Manually change the CPU freq. These changes don't hang. The CPU freq is
correctly changed to the specified freq.
$ echo -n 1400000 | sudo tee scaling_setspeed
$ echo -n 1300000 | sudo tee scaling_setspeed
$ echo -n 1200000 | sudo tee scaling_setspeed
$ echo -n 1100000 | sudo tee scaling_setspeed

- Now try 1000 MHz. This hangs instantly.
$ echo -n 1000000 | sudo tee scaling_setspeed

- Reboot, try 900 MHz. This hangs instantly.
$ echo -n 900000 | sudo tee scaling_setspeed

- Reboot, try 800 MHz. CPU freq changed to 800 Mhz. No hang.
$ echo -n 800000 | sudo tee scaling_setspeed

END OF TEST

EXPECTED RESULTS:
- System does not hang.

ADDITIONAL NOTES:
- My latest test of this bug is on Ubuntu 11.10 + mainline kernel
"linux-image-3.4.0-999-generic_3.4.0-999.201204260409_amd64.deb". To confirm
that my test was conducted on the mainline kernel, I executed uname:

$ uname -srvmpio
Linux 3.4.0-999-generic #201204260409 SMP Thu Apr 26 08:10:51 UTC 2012 x86_64
x86_64 x86_64 GNU/Linux

- When the hang occurs, the entire system is frozen. Unlike a kernel panic, my
keyboard LEDs did NOT blink rapidly.
- When the hang occurs, nothing about the hang is written to the kern.log.
- I tried to capture any output from a netconsole session as described here:
https://wiki.ubuntu.com/Kernel/Netconsole?action=show&amp;amp;redirect=KernelTeam%2FNetconsole
. The "receiver" over the network is supposed to capture output from the
kernel. When the hang occurs, nothing is received by the receiver.
- For dmesg, cpuinfo, modules, and other info, see attachments on the original
bug filed at "bugs.launchpad.net".

&lt;/pre&gt;</description>
    <dc:creator>bugzilla-daemon&lt; at &gt;bugzilla.kernel.org</dc:creator>
    <dc:date>2012-04-29T20:45:41</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8086">
    <title>[RESEND PATCH 1/2] ARM: add cpufreq transiton notifier to adjust loops_per_jiffy for smp</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.cpufreq/8086</link>
    <description>&lt;pre&gt;If CONFIG_SMP, cpufreq skips loops_per_jiffy update, because different
arch has different per-cpu loops_per_jiffy definition.

Signed-off-by: Richard Zhao &amp;lt;richard.zhao&amp;lt; at &amp;gt;freescale.com&amp;gt;
Acked-by: Russell King &amp;lt;rmk+kernel&amp;lt; at &amp;gt;arm.linux.org.uk&amp;gt;
---
 arch/arm/kernel/smp.c |   54 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 54 insertions(+), 0 deletions(-)

diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index addbbe8..33af711 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -25,6 +25,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include &amp;lt;linux/percpu.h&amp;gt;
 #include &amp;lt;linux/clockchips.h&amp;gt;
 #include &amp;lt;linux/completion.h&amp;gt;
+#include &amp;lt;linux/cpufreq.h&amp;gt;
 
 #include &amp;lt;linux/atomic.h&amp;gt;
 #include &amp;lt;asm/cacheflush.h&amp;gt;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -604,3 +605,56 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int setup_profiling_timer(unsigned int multiplier)
 {
 return -EINVAL;
 }
+
+#ifdef CONFIG_CPU_FREQ
+
+static DEFINE_PER_CPU(unsigned long, l_p_j_ref);
+static DEFINE_PER_CPU(unsigned long, l_p_j_ref_freq);
+static unsigned long global_l_p_j_ref;
+static unsigned long global_l_p_j_ref_freq;
+
+static int cpufreq_callback(struct notifier_block *nb,
+unsigned long val, void *data)
+{
+struct cpufreq_freqs *freq = data;
+int cpu = freq-&amp;gt;cpu;
+
+if (freq-&amp;gt;flags &amp;amp; CPUFREQ_CONST_LOOPS)
+return NOTIFY_OK;
+
+if (!per_cpu(l_p_j_ref, cpu)) {
+per_cpu(l_p_j_ref, cpu) =
+per_cpu(cpu_data, cpu).loops_per_jiffy;
+per_cpu(l_p_j_ref_freq, cpu) = freq-&amp;gt;old;
+if (!global_l_p_j_ref) {
+global_l_p_j_ref = loops_per_jiffy;
+global_l_p_j_ref_freq = freq-&amp;gt;old;
+}
+}
+
+if ((val == CPUFREQ_PRECHANGE  &amp;amp;&amp;amp; freq-&amp;gt;old &amp;lt; freq-&amp;gt;new) ||
+    (val == CPUFREQ_POSTCHANGE &amp;amp;&amp;amp; freq-&amp;gt;old &amp;gt; freq-&amp;gt;new) ||
+    (val == CPUFREQ_RESUMECHANGE || val == CPUFREQ_SUSPENDCHANGE)) {
+loops_per_jiffy = cpufreq_scale(global_l_p_j_ref,
+global_l_p_j_ref_freq,
+freq-&amp;gt;new);
+per_cpu(cpu_data, cpu).loops_per_jiffy =
+cpufreq_scale(per_cpu(l_p_j_ref, cpu),
+per_cpu(l_p_j_ref_freq, cpu),
+freq-&amp;gt;new);
+}
+return NOTIFY_OK;
+}
+
+static struct notifier_block cpufreq_notifier = {
+.notifier_call  = cpufreq_callback,
+};
+
+static int __init register_cpufreq_notifier(void)
+{
+return cpufreq_register_notifier(&amp;amp;cpufreq_notifier,
+CPUFREQ_TRANSITION_NOTIFIER);
+}
+core_initcall(register_cpufreq_notifier);
+
+#endif
&lt;/pre&gt;</description>
    <dc:creator>Richard Zhao</dc:creator>
    <dc:date>2012-04-28T03:28:42</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8084">
    <title>[PATCH] cpufreq: OMAP: fix build errors: depends on ARCH_OMAP2PLUS</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.cpufreq/8084</link>
    <description>&lt;pre&gt;The OMAP driver needs a 'depends on ARCH_OMAP2PLUS' since it only
builds for OMAP2+ platforms.

This 'depends on' was in the original patch from Russell King, but was
erroneously removed by me when making this option user-selectable in
commit b09db45c (cpufreq: OMAP driver depends CPUfreq tables.)  This
patch remedies that.

Apologies to Russell King for breaking his originally working patch.

Also, thanks to Grazvydas Ignotas for reporting the same problem.

Cc: Russell King &amp;lt;rmk+kernel&amp;lt; at &amp;gt;arm.linux.org.uk&amp;gt;
Cc: Grazvydas Ignotas &amp;lt;notasas&amp;lt; at &amp;gt;gmail.com&amp;gt;
Signed-off-by: Kevin Hilman &amp;lt;khilman&amp;lt; at &amp;gt;ti.com&amp;gt;
---
Linus, can you apply this for v3.4-rc?  I haven't got a response from
the CPUfreq maintainers after several weeks and a couple tries, so
hopefully you can take this simple fix.   Thanks.

 drivers/cpufreq/Kconfig.arm |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
index 82f1aa9..555a57b 100644
--- a/drivers/cpufreq/Kconfig.arm
+++ b/drivers/cpufreq/Kconfig.arm
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -4,6 +4,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 
 config ARM_OMAP2PLUS_CPUFREQ
 bool "TI OMAP2+"
+depends on ARCH_OMAP2PLUS
 default ARCH_OMAP2PLUS
 select CPU_FREQ_TABLE
 
&lt;/pre&gt;</description>
    <dc:creator>Kevin Hilman</dc:creator>
    <dc:date>2012-04-13T20:32:30</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8080">
    <title> 100 kč</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.cpufreq/8080</link>
    <description>&lt;pre&gt;Opravdu zajímavý web s video-školením,
kde se krok za krokem můžeš naučit 
vydělávat propagací na internetu.

Zaregistruj se ZDARMA zde:
http://www.affilprogram.cz/#a_aid=4f7db1e15123f&amp;amp;a_bid=a328796c

a získáš ihned 100 Kč jako vstupní bonus ;)

Pokud Vám cokoli nebude jasné, kontaktujte mne emailem, . Já mám za první
den vyděláno necelých 200,- Kč a neustále to naskakuje. Těším se na
spolupráci. Richard Adamčák
 
Richard Adamčák
richardadamcak&amp;lt; at &amp;gt;seznam.cz

--
To unsubscribe from this list: send the line "unsubscribe cpufreq" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Richard Adamčák</dc:creator>
    <dc:date>2012-04-09T21:09:52</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8079">
    <title>(unknown)</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.cpufreq/8079</link>
    <description>&lt;pre&gt;


Hello There!

This is a personal email directed to you. My wife and I won an Euro
Millions Jackpot Lottery of £101m million(Pounds) on October 11, 2011 and
have
voluntarily decided to donate the sum of £1,000,000.00 Pounds to you as
part of our own charity project to improve the lot of 20 lucky
individuals all over the world.

If you have received this email then you are one of the lucky
recipients and all you have to do is get back to us so that we can
send your details to the payout bank.

You can verify this by visiting the web page below;
http://uk.news.yahoo.com/lucky-lottery-couple-reveals-what-they-will-buy-with-
%C2%A3101m.html

http://m.ibtimes.com/euromillions-euromillion-winners-euromillion-winners-
revealed-101-million-winners-101m-euromillions-229012.html

Dave and Angela Dawes
Contact my private email only:angeladawesfoundation&amp;lt; at &amp;gt;yahoo.com.hk


--
To unsubscribe from this list: send the line "unsubscribe cpufreq" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Dave and Angela Dawes</dc:creator>
    <dc:date>2012-04-07T08:29:46</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8063">
    <title>[PATCH] EXYNOS: bugfix on retrieving old_index from freqs.old</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.cpufreq/8063</link>
    <description>&lt;pre&gt;The policy might have been changed since last call of target().
Thus, using cpufreq_frequency_table_target(), which depends on
policy to find the correspoding index from a frequency, may return
inconsistent index for freqs.old. Thus, old_index should be
calculated not based on the current policy.

We have been observing such issue when scaling_min/max_freq were
updated and sometimes caused system lockups due to incorrectly
configured voltages.

Signed-off-by: MyungJoo Ham &amp;lt;myungjoo.ham&amp;lt; at &amp;gt;samsung.com&amp;gt;
---
 drivers/cpufreq/exynos-cpufreq.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c
index b243a7e..1577522 100644
--- a/drivers/cpufreq/exynos-cpufreq.c
+++ b/drivers/cpufreq/exynos-cpufreq.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -62,8 +62,17 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int exynos_target(struct cpufreq_policy *policy,
 goto out;
 }
 
-if (cpufreq_frequency_table_target(policy, freq_table,
-   freqs.old, relation, &amp;amp;old_index)) {
+/*
+ * The policy may have been changed so that we cannot get proper
+ * old_index with cpufreq_frequency_table_target(). Thus, ignore
+ * policy and get the index from the raw frequency table.
+ */
+for (old_index = 0;
+     freq_table[old_index].frequency != CPUFREQ_TABLE_END;
+     old_index++)
+if (freq_table[old_index].frequency == freqs.old)
+break;
+if (freq_table[old_index].frequency == CPUFREQ_TABLE_END) {
 ret = -EINVAL;
 goto out;
 }
&lt;/pre&gt;</description>
    <dc:creator>MyungJoo Ham</dc:creator>
    <dc:date>2012-04-04T10:23:56</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8059">
    <title>[Bug 43037] New: cpufreq often stucks in lowest frequency.</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.cpufreq/8059</link>
    <description>&lt;pre&gt;https://bugzilla.kernel.org/show_bug.cgi?id=43037

           Summary: cpufreq often stucks in lowest frequency.
           Product: Power Management
           Version: 2.5
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: high
          Priority: P1
         Component: cpufreq
        AssignedTo: cpufreq&amp;lt; at &amp;gt;vger.kernel.org
        ReportedBy: yasar11732&amp;lt; at &amp;gt;gmail.com
        Regression: No


Created an attachment (id=72798)
 --&amp;gt; (https://bugzilla.kernel.org/attachment.cgi?id=72798)
Current linux configuration file

Although it works from time to time, cpufreq often stucks in the lowest
frequency, and won't let the frequency go any higher, regardless of the
governer. There is a discussion about this in here:
https://bbs.archlinux.org/viewtopic.php?pid=1082045

As it can be seen on the above thread, when this occurs, cpufreq-info gives
this kind of output;

analyzing CPU 0:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 0 1 2 3
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 10.0 us.
  hardware limits: 1.20 GHz - 2.53 GHz
  available frequency steps: 2.53 GHz, 2.53 GHz, 2.40 GHz, 2.27 GHz, 2.13 GHz,
2.00 GHz, 1.87 GHz, 1.73 GHz, 1.60 GHz, 1.47 GHz, 1.33 GHz, 1.20 GHz
  available cpufreq governors: ondemand, performance
  current policy: frequency should be within 1.20 GHz and 1.20 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 1.20 GHz

As it can be seen, although it can see all available frequncies, but it will
only use lowest frequency.


I am on "3.2.13-1-ARCH #1 SMP PREEMPT i686 Intel(R) Pentium(R) M processor
1.86GHz GenuineIntel", however, as you can see on the thread above, it's not
the sole processor this problem happens.

Since this problem occurs from time to time (but often), I cannot provide a way
to reproduce this error. I am adding

&lt;/pre&gt;</description>
    <dc:creator>bugzilla-daemon&lt; at &gt;bugzilla.kernel.org</dc:creator>
    <dc:date>2012-04-03T15:49:28</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8058">
    <title>[PATCH] Longhaul: Check for CPU model first</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.cpufreq/8058</link>
    <description>&lt;pre&gt;This patch fixes bug 16274. This is C3 only driver, but APIC and
SMP checks are executed on any Centaur processor. Check for CPU
model first and stop produce bogus error messages on C7 and Nano
systems.

Signed-off-by: Rafal Bilski &amp;lt;rafalbilski&amp;lt; at &amp;gt;interia.pl&amp;gt;
---

Please close bug 16274 if this patch is accepted.

 drivers/cpufreq/longhaul.c |   25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c
index f47d26e..f70287e 100644
--- a/drivers/cpufreq/longhaul.c
+++ b/drivers/cpufreq/longhaul.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -959,22 +959,23 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int __init longhaul_init(void)
 if (c-&amp;gt;x86_vendor != X86_VENDOR_CENTAUR || c-&amp;gt;x86 != 6)
 return -ENODEV;
 
+switch (c-&amp;gt;x86_model) {
+case 6 ... 9:
 #ifdef CONFIG_SMP
-if (num_online_cpus() &amp;gt; 1) {
-printk(KERN_ERR PFX "More than 1 CPU detected, "
-"longhaul disabled.\n");
-return -ENODEV;
-}
+if (num_online_cpus() &amp;gt; 1) {
+printk(KERN_ERR PFX "More than 1 CPU detected, "
+"longhaul disabled.\n");
+return -ENODEV;
+}
 #endif
 #ifdef CONFIG_X86_IO_APIC
-if (cpu_has_apic) {
-printk(KERN_ERR PFX "APIC detected. Longhaul is currently "
-"broken in this configuration.\n");
-return -ENODEV;
-}
+if (cpu_has_apic) {
+printk(KERN_ERR PFX "APIC detected. Longhaul is "
+"currently broken in this "
+"configuration.\n");
+return -ENODEV;
+}
 #endif
-switch (c-&amp;gt;x86_model) {
-case 6 ... 9:
 return cpufreq_register_driver(&amp;amp;longhaul_driver);
 case 10:
 printk(KERN_ERR PFX "Use acpi-cpufreq driver for VIA C7\n");
&lt;/pre&gt;</description>
    <dc:creator>Rafal Bilski</dc:creator>
    <dc:date>2012-04-02T20:41:47</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8049">
    <title>Hello</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.cpufreq/8049</link>
    <description>&lt;pre&gt;Hello xxxxx,
 How are you doing over there? My name is Laura, Please let
me know if i got the right address so we can open
communication, here is my email address I am waiting for
your confirmation with care Laura...
--
To unsubscribe from this list: send the line "unsubscribe cpufreq" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>laurarey111&lt; at &gt;hotmail.com</dc:creator>
    <dc:date>2012-03-26T10:34:18</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.cpufreq/8048">
    <title>[PATCH] sfi based p-state driver</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.cpufreq/8048</link>
    <description>&lt;pre&gt;This is the sfi p-state driver for all the intel soc platforms.
This is based on the acpi p-state driver.This patch is generated
against linux 3.2.2.

Signed-off-by: Vishwesh M Rudramuni &amp;lt;vishwesh.m.rudramuni&amp;lt; at &amp;gt;intel.com&amp;gt;
Acked-by: Len Brown &amp;lt;len.brown&amp;lt; at &amp;gt;intel.com&amp;gt;
Reviewed-by: Hari Seshadri &amp;lt;harinarayanan.seshadri&amp;lt; at &amp;gt;intel.com&amp;gt;
Reviewed-by: Rajeev D Muralidhar &amp;lt;rajeev.d.muralidhar&amp;lt; at &amp;gt;intel.com&amp;gt;
---
 drivers/cpufreq/Kconfig.x86   |   15 ++
 drivers/cpufreq/Makefile      |    1 +
 drivers/cpufreq/sfi-cpufreq.c |  529 +++++++++++++++++++++++++++++++++++++++++
 drivers/cpufreq/sfi-cpufreq.h |   65 +++++
 4 files changed, 610 insertions(+), 0 deletions(-)
 create mode 100644 drivers/cpufreq/sfi-cpufreq.c
 create mode 100644 drivers/cpufreq/sfi-cpufreq.h

diff --git a/drivers/cpufreq/Kconfig.x86 b/drivers/cpufreq/Kconfig.x86
index 78ff7ee..7c53591 100644
--- a/drivers/cpufreq/Kconfig.x86
+++ b/drivers/cpufreq/Kconfig.x86
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -32,6 +32,21 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; config X86_ACPI_CPUFREQ
 
   If in doubt, say N.
 
+config X86_SFI_CPUFREQ
+        tristate "SFI Processor P-States driver"
+        select CPU_FREQ_TABLE
+        help
+This driver adds a CPUFreq driver which utilizes the SFI
+Processor Performance States.
+This driver also supports Intel Enhanced Speedstep.
+
+To compile this driver as a module, choose M here: the
+module will be called sfi-cpufreq.
+
+For details, take a look at &amp;lt;file:Documentation/cpu-freq/&amp;gt;.
+
+If in doubt, say N.
+
 config ELAN_CPUFREQ
 tristate "AMD Elan SC400 and SC410"
 select CPU_FREQ_TABLE
diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile
index a48bc02..43b086a 100644
--- a/drivers/cpufreq/Makefile
+++ b/drivers/cpufreq/Makefile
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -21,6 +21,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; obj-$(CONFIG_CPU_FREQ_TABLE)+= freq_table.o
 
 obj-$(CONFIG_X86_POWERNOW_K8)+= powernow-k8.o mperf.o
 obj-$(CONFIG_X86_ACPI_CPUFREQ)+= acpi-cpufreq.o mperf.o
+obj-$(CONFIG_X86_SFI_CPUFREQ)+= sfi-cpufreq.o mperf.o
 obj-$(CONFIG_X86_PCC_CPUFREQ)+= pcc-cpufreq.o
 obj-$(CONFIG_X86_POWERNOW_K6)+= powernow-k6.o
 obj-$(CONFIG_X86_POWERNOW_K7)+= powernow-k7.o
diff --git a/drivers/cpufreq/sfi-cpufreq.c b/drivers/cpufreq/sfi-cpufreq.c
new file mode 100644
index 0000000..591d41e
--- /dev/null
+++ b/drivers/cpufreq/sfi-cpufreq.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -0,0 +1,529 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
+/*
+ * sfi_cpufreq.c - sfi Processor P-States Driver
+ *
+ * (C) 2010-2011 Intel Corporation
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License.
+ *
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  General Public License for more details.
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ * Author: Vishwesh M Rudramuni
+ * Contact information: Vishwesh Rudramuni &amp;lt;vishwesh.m.rudramuni&amp;lt; at &amp;gt;intel.com&amp;gt;
+ */
+
+/*
+ * This sfi Processor P-States Driver re-uses most part of the code available
+ * in acpi cpufreq driver.
+ */
+
+#include &amp;lt;linux/kernel.h&amp;gt;
+#include &amp;lt;linux/module.h&amp;gt;
+#include &amp;lt;linux/init.h&amp;gt;
+#include &amp;lt;linux/smp.h&amp;gt;
+#include &amp;lt;linux/sched.h&amp;gt;
+#include &amp;lt;linux/cpufreq.h&amp;gt;
+#include &amp;lt;linux/compiler.h&amp;gt;
+#include &amp;lt;linux/slab.h&amp;gt;
+#include &amp;lt;linux/delay.h&amp;gt;
+#include &amp;lt;linux/uaccess.h&amp;gt;
+#include &amp;lt;linux/sfi.h&amp;gt;
+#include &amp;lt;linux/io.h&amp;gt;
+
+#include &amp;lt;asm/msr.h&amp;gt;
+#include &amp;lt;asm/processor.h&amp;gt;
+#include &amp;lt;asm/cpufeature.h&amp;gt;
+
+#include "sfi-cpufreq.h"
+#include "mperf.h"
+
+MODULE_AUTHOR("Vishwesh Rudramuni");
+MODULE_DESCRIPTION("SFI Processor P-States Driver");
+MODULE_LICENSE("GPL");
+
+DEFINE_PER_CPU(struct sfi_processor *, sfi_processors);
+
+static DEFINE_MUTEX(performance_mutex);
+static int sfi_cpufreq_num;
+static u32 sfi_cpu_num;
+
+#defineSFI_FREQ_MAX            32
+#defineINTEL_MSR_RANGE(0xffff)
+#defineSFI_CPU_MAX8
+
+
+struct sfi_cpufreq_data {
+struct sfi_processor_performance *sfi_data;
+struct cpufreq_frequency_table *freq_table;
+unsigned int max_freq;
+unsigned int resume;
+};
+
+static DEFINE_PER_CPU(struct sfi_cpufreq_data *, drv_data);
+struct sfi_freq_table_entry sfi_cpufreq_array[SFI_FREQ_MAX];
+static struct sfi_cpu_table_entry sfi_cpu_array[SFI_CPU_MAX];
+
+/* sfi_perf_data is a pointer to percpu data. */
+static struct sfi_processor_performance *sfi_perf_data;
+
+static struct cpufreq_driver sfi_cpufreq_driver;
+
+static int parse_freq(struct sfi_table_header *table)
+{
+struct sfi_table_simple *sb;
+struct sfi_freq_table_entry *pentry;
+int totallen;
+
+sb = (struct sfi_table_simple *)table;
+if (!sb) {
+printk(KERN_WARNING "SFI: Unable to map FREQ\n");
+return -ENODEV;
+}
+
+if (!sfi_cpufreq_num) {
+sfi_cpufreq_num = SFI_GET_NUM_ENTRIES(sb,
+ struct sfi_freq_table_entry);
+pentry = (struct sfi_freq_table_entry *)sb-&amp;gt;pentry;
+totallen = sfi_cpufreq_num * sizeof(*pentry);
+memcpy(sfi_cpufreq_array, pentry, totallen);
+}
+
+return 0;
+}
+
+static int sfi_processor_get_performance_states(struct sfi_processor *pr)
+{
+int result = 0;
+int i;
+
+pr-&amp;gt;performance-&amp;gt;state_count = sfi_cpufreq_num;
+pr-&amp;gt;performance-&amp;gt;states =
+    kmalloc(sizeof(struct sfi_processor_px) * sfi_cpufreq_num,
+    GFP_KERNEL);
+if (!pr-&amp;gt;performance-&amp;gt;states)
+result = -ENOMEM;
+
+printk(KERN_INFO "Num p-states %d\n", sfi_cpufreq_num);
+
+/* Populate the P-states info from the SFI table here */
+for (i = 0; i &amp;lt; sfi_cpufreq_num; i++) {
+pr-&amp;gt;performance-&amp;gt;states[i].core_frequency = \
+sfi_cpufreq_array[i].freq_mhz;
+pr-&amp;gt;performance-&amp;gt;states[i].transition_latency = \
+sfi_cpufreq_array[i].latency;
+pr-&amp;gt;performance-&amp;gt;states[i].control = \
+sfi_cpufreq_array[i].ctrl_val;
+printk(KERN_INFO "State [%d]: core_frequency[%d] transition_latency[%d] control[0x%x]\n",
+i,
+(u32) pr-&amp;gt;performance-&amp;gt;states[i].core_frequency,
+(u32) pr-&amp;gt;performance-&amp;gt;states[i].transition_latency,
+(u32) pr-&amp;gt;performance-&amp;gt;states[i].control);
+}
+
+return result;
+}
+
+static int sfi_processor_register_performance(struct sfi_processor_performance
+    *performance, unsigned int cpu)
+{
+struct sfi_processor *pr;
+
+mutex_lock(&amp;amp;performance_mutex);
+
+pr = per_cpu(sfi_processors, cpu);
+if (!pr) {
+mutex_unlock(&amp;amp;performance_mutex);
+return -ENODEV;
+}
+
+if (pr-&amp;gt;performance) {
+mutex_unlock(&amp;amp;performance_mutex);
+return -EBUSY;
+}
+
+WARN_ON(!performance);
+
+pr-&amp;gt;performance = performance;
+
+/* parse the freq table from sfi */
+sfi_cpufreq_num = 0;
+sfi_table_parse(SFI_SIG_FREQ, NULL, NULL, parse_freq);
+
+sfi_processor_get_performance_states(pr);
+
+mutex_unlock(&amp;amp;performance_mutex);
+return 0;
+}
+
+void sfi_processor_unregister_performance(struct sfi_processor_performance
+      *performance, unsigned int cpu)
+{
+struct sfi_processor *pr;
+
+
+mutex_lock(&amp;amp;performance_mutex);
+
+pr = per_cpu(sfi_processors, cpu);
+if (!pr) {
+mutex_unlock(&amp;amp;performance_mutex);
+return;
+}
+
+if (pr-&amp;gt;performance)
+kfree(pr-&amp;gt;performance-&amp;gt;states);
+pr-&amp;gt;performance = NULL;
+
+mutex_unlock(&amp;amp;performance_mutex);
+
+return;
+}
+
+static unsigned int get_cur_freq_on_cpu(unsigned int cpu)
+{
+struct sfi_cpufreq_data *data = per_cpu(drv_data, cpu);
+unsigned int cached_freq;
+
+pr_debug("get_cur_freq_on_cpu (%d)\n", cpu);
+
+if (unlikely(data == NULL ||
+data-&amp;gt;sfi_data == NULL || data-&amp;gt;freq_table == NULL)) {
+return 0;
+}
+
+cached_freq = data-&amp;gt;freq_table[data-&amp;gt;sfi_data-&amp;gt;state].frequency;
+
+return cached_freq;
+}
+
+static int sfi_cpufreq_target(struct cpufreq_policy *policy,
+       unsigned int target_freq, unsigned int relation)
+{
+struct sfi_cpufreq_data *data = per_cpu(drv_data, policy-&amp;gt;cpu);
+struct sfi_processor_performance *perf;
+struct cpufreq_freqs freqs;
+unsigned int next_state = 0; /* Index into freq_table */
+unsigned int next_perf_state = 0; /* Index into perf table */
+int result = 0;
+u32 lo, hi;
+
+pr_debug("sfi_cpufreq_target %d (%d)\n", target_freq, policy-&amp;gt;cpu);
+
+if (unlikely(data == NULL ||
+     data-&amp;gt;sfi_data == NULL || data-&amp;gt;freq_table == NULL)) {
+return -ENODEV;
+}
+
+perf = data-&amp;gt;sfi_data;
+result = cpufreq_frequency_table_target(policy,
+data-&amp;gt;freq_table,
+target_freq,
+relation, &amp;amp;next_state);
+if (unlikely(result))
+return -ENODEV;
+
+next_perf_state = data-&amp;gt;freq_table[next_state].index;
+if (perf-&amp;gt;state == next_perf_state) {
+if (unlikely(data-&amp;gt;resume)) {
+pr_debug("Called after resume, resetting to P%d\n",
+next_perf_state);
+data-&amp;gt;resume = 0;
+} else {
+pr_debug("Already at target state (P%d)\n",
+next_perf_state);
+return 0;
+}
+}
+
+freqs.old = perf-&amp;gt;states[perf-&amp;gt;state].core_frequency * 1000;
+freqs.new = data-&amp;gt;freq_table[next_state].frequency;
+freqs.cpu = policy-&amp;gt;cpu;
+
+cpufreq_notify_transition(&amp;amp;freqs, CPUFREQ_PRECHANGE);
+
+rdmsr_on_cpu(policy-&amp;gt;cpu, MSR_IA32_PERF_CTL, &amp;amp;lo, &amp;amp;hi);
+lo = (lo &amp;amp; ~INTEL_MSR_RANGE) |
+((u32) perf-&amp;gt;states[next_perf_state].control &amp;amp; INTEL_MSR_RANGE);
+wrmsr_on_cpu(policy-&amp;gt;cpu, MSR_IA32_PERF_CTL, lo, hi);
+
+
+cpufreq_notify_transition(&amp;amp;freqs, CPUFREQ_POSTCHANGE);
+perf-&amp;gt;state = next_perf_state;
+
+return result;
+}
+
+static int sfi_cpufreq_verify(struct cpufreq_policy *policy)
+{
+struct sfi_cpufreq_data *data = per_cpu(drv_data, policy-&amp;gt;cpu);
+
+pr_debug("sfi_cpufreq_verify\n");
+
+return cpufreq_frequency_table_verify(policy, data-&amp;gt;freq_table);
+}
+
+/*
+ * sfi_cpufreq_early_init - initialize SFI P-States library
+ *
+ * Initialize the SFI P-States library (drivers/sfi/processor_perflib.c)
+ * in order to cope with the correct frequency and voltage pairings.
+ */
+static int __init sfi_cpufreq_early_init(void)
+{
+sfi_perf_data = alloc_percpu(struct sfi_processor_performance);
+if (!sfi_perf_data) {
+pr_debug("Memory allocation error for sfi_perf_data.\n");
+return -ENOMEM;
+}
+
+return 0;
+}
+
+
+static int sfi_cpufreq_cpu_init(struct cpufreq_policy *policy)
+{
+unsigned int i;
+unsigned int valid_states = 0;
+unsigned int cpu = policy-&amp;gt;cpu;
+struct sfi_cpufreq_data *data;
+unsigned int result = 0;
+struct cpuinfo_x86 *c = &amp;amp;cpu_data(policy-&amp;gt;cpu);
+struct sfi_processor_performance *perf;
+
+pr_debug("sfi_cpufreq_cpu_init CPU:%d\n", policy-&amp;gt;cpu);
+
+data = kzalloc(sizeof(struct sfi_cpufreq_data), GFP_KERNEL);
+if (!data)
+return -ENOMEM;
+
+data-&amp;gt;sfi_data = per_cpu_ptr(sfi_perf_data, cpu);
+per_cpu(drv_data, cpu) = data;
+
+sfi_cpufreq_driver.flags |= CPUFREQ_CONST_LOOPS;
+
+
+result = sfi_processor_register_performance(data-&amp;gt;sfi_data, cpu);
+if (result)
+goto err_free;
+
+perf = data-&amp;gt;sfi_data;
+policy-&amp;gt;shared_type = CPUFREQ_SHARED_TYPE_HW;
+
+cpumask_set_cpu(policy-&amp;gt;cpu, policy-&amp;gt;cpus);
+cpumask_set_cpu(policy-&amp;gt;cpu, policy-&amp;gt;related_cpus);
+
+/* capability check */
+if (perf-&amp;gt;state_count &amp;lt;= 1) {
+pr_debug("No P-States\n");
+result = -ENODEV;
+goto err_unreg;
+}
+
+data-&amp;gt;freq_table = kzalloc(sizeof(struct cpufreq_frequency_table) *
+    (perf-&amp;gt;state_count+1), GFP_KERNEL);
+if (!data-&amp;gt;freq_table) {
+result = -ENOMEM;
+goto err_unreg;
+}
+
+/* detect transition latency */
+policy-&amp;gt;cpuinfo.transition_latency = 0;
+for (i = 0; i &amp;lt; perf-&amp;gt;state_count; i++) {
+if ((perf-&amp;gt;states[i].transition_latency * 1000) &amp;gt;
+    policy-&amp;gt;cpuinfo.transition_latency)
+policy-&amp;gt;cpuinfo.transition_latency =
+    perf-&amp;gt;states[i].transition_latency * 1000;
+}
+
+data-&amp;gt;max_freq = perf-&amp;gt;states[0].core_frequency * 1000;
+/* table init */
+for (i = 0; i &amp;lt; perf-&amp;gt;state_count; i++) {
+if (i &amp;gt; 0 &amp;amp;&amp;amp; perf-&amp;gt;states[i].core_frequency &amp;gt;=
+    data-&amp;gt;freq_table[valid_states-1].frequency / 1000)
+continue;
+
+data-&amp;gt;freq_table[valid_states].index = i;
+data-&amp;gt;freq_table[valid_states].frequency =
+    perf-&amp;gt;states[i].core_frequency * 1000;
+valid_states++;
+}
+data-&amp;gt;freq_table[valid_states].frequency = CPUFREQ_TABLE_END;
+perf-&amp;gt;state = 0;
+
+result = cpufreq_frequency_table_cpuinfo(policy, data-&amp;gt;freq_table);
+if (result)
+goto err_freqfree;
+
+sfi_cpufreq_driver.get = get_cur_freq_on_cpu;
+policy-&amp;gt;cur = get_cur_freq_on_cpu(cpu);
+
+
+/* Check for APERF/MPERF support in hardware */
+if (cpu_has(c, X86_FEATURE_APERFMPERF))
+sfi_cpufreq_driver.getavg = cpufreq_get_measured_perf;
+
+pr_debug("CPU%u - SFI performance management activated.\n", cpu);
+for (i = 0; i &amp;lt; perf-&amp;gt;state_count; i++)
+pr_debug("     %cP%d: %d MHz, %d uS\n",
+(i == perf-&amp;gt;state ? '*' : ' '), i,
+(u32) perf-&amp;gt;states[i].core_frequency,
+(u32) perf-&amp;gt;states[i].transition_latency);
+
+cpufreq_frequency_table_get_attr(data-&amp;gt;freq_table, policy-&amp;gt;cpu);
+
+/*
+ * the first call to -&amp;gt;target() should result in us actually
+ * writing something to the appropriate registers.
+ */
+data-&amp;gt;resume = 1;
+
+return result;
+
+err_freqfree:
+kfree(data-&amp;gt;freq_table);
+err_unreg:
+sfi_processor_unregister_performance(perf, cpu);
+err_free:
+kfree(data);
+per_cpu(drv_data, cpu) = NULL;
+
+return result;
+}
+
+static int sfi_cpufreq_cpu_exit(struct cpufreq_policy *policy)
+{
+struct sfi_cpufreq_data *data = per_cpu(drv_data, policy-&amp;gt;cpu);
+
+pr_debug("sfi_cpufreq_cpu_exit\n");
+
+if (data) {
+cpufreq_frequency_table_put_attr(policy-&amp;gt;cpu);
+per_cpu(drv_data, policy-&amp;gt;cpu) = NULL;
+sfi_processor_unregister_performance(data-&amp;gt;sfi_data,
+policy-&amp;gt;cpu);
+kfree(data);
+}
+
+return 0;
+}
+
+static int sfi_cpufreq_resume(struct cpufreq_policy *policy)
+{
+struct sfi_cpufreq_data *data = per_cpu(drv_data, policy-&amp;gt;cpu);
+
+pr_debug("sfi_cpufreq_resume\n");
+
+data-&amp;gt;resume = 1;
+
+return 0;
+}
+
+static struct freq_attr *sfi_cpufreq_attr[] = {
+&amp;amp;cpufreq_freq_attr_scaling_available_freqs,
+NULL,
+};
+
+static struct cpufreq_driver sfi_cpufreq_driver = {
+.verify = sfi_cpufreq_verify,
+.target = sfi_cpufreq_target,
+.init = sfi_cpufreq_cpu_init,
+.exit = sfi_cpufreq_cpu_exit,
+.resume = sfi_cpufreq_resume,
+.name = "sfi-cpufreq",
+.owner = THIS_MODULE,
+.attr = sfi_cpufreq_attr,
+};
+
+static int __init parse_cpus(struct sfi_table_header *table)
+{
+struct sfi_table_simple *sb;
+struct sfi_cpu_table_entry *pentry;
+int i;
+
+sb = (struct sfi_table_simple *)table;
+
+sfi_cpu_num = SFI_GET_NUM_ENTRIES(sb, struct sfi_cpu_table_entry);
+
+pentry = (struct sfi_cpu_table_entry *) sb-&amp;gt;pentry;
+for (i = 0; i &amp;lt; sfi_cpu_num; i++) {
+sfi_cpu_array[i].apic_id = pentry-&amp;gt;apic_id;
+printk(KERN_INFO "APIC ID: %d\n", pentry-&amp;gt;apic_id);
+pentry++;
+}
+
+return 0;
+
+}
+
+
+static int __init init_sfi_processor_list(void)
+{
+struct sfi_processor *pr;
+int i;
+int result;
+
+/* parse the cpus from the sfi table */
+result = sfi_table_parse(SFI_SIG_CPUS, NULL, NULL, parse_cpus);
+
+if (result &amp;lt; 0)
+return result;
+
+pr = kzalloc(sfi_cpu_num * sizeof(struct sfi_processor), GFP_KERNEL);
+if (!pr)
+return -ENOMEM;
+
+for (i = 0; i &amp;lt; sfi_cpu_num; i++) {
+pr-&amp;gt;id = sfi_cpu_array[i].apic_id;
+per_cpu(sfi_processors, pr-&amp;gt;id) = pr;
+pr++;
+}
+
+return 0;
+}
+
+static int __init sfi_cpufreq_init(void)
+{
+int ret;
+
+pr_debug("sfi_cpufreq_init\n");
+
+ret = init_sfi_processor_list();
+if (ret)
+return ret;
+
+ret = sfi_cpufreq_early_init();
+if (ret)
+return ret;
+
+return cpufreq_register_driver(&amp;amp;sfi_cpufreq_driver);
+}
+
+static void __exit sfi_cpufreq_exit(void)
+{
+
+struct sfi_processor *pr;
+
+pr_debug("sfi_cpufreq_exit\n");
+
+pr = per_cpu(sfi_processors, 0);
+kfree(pr);
+
+cpufreq_unregister_driver(&amp;amp;sfi_cpufreq_driver);
+
+free_percpu(sfi_perf_data);
+
+return;
+}
+late_initcall(sfi_cpufreq_init);
+module_exit(sfi_cpufreq_exit);
+
+MODULE_ALIAS("sfi");
diff --git a/drivers/cpufreq/sfi-cpufreq.h b/drivers/cpufreq/sfi-cpufreq.h
new file mode 100644
index 0000000..7e01c1e
--- /dev/null
+++ b/drivers/cpufreq/sfi-cpufreq.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -0,0 +1,65 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
+/*
+ * sfi_processor.h
+ * Copyright (c) 2010, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#ifndef __SFI_PROCESSOR_H__
+#define __SFI_PROCESSOR_H__
+
+#include &amp;lt;linux/sfi.h&amp;gt;
+#include &amp;lt;linux/cpuidle.h&amp;gt;
+
+struct sfi_processor_power {
+struct cpuidle_device dev;
+u32 default_state;
+int count;
+struct cpuidle_state *states;
+struct sfi_cstate_table_entry *sfi_cstates;
+};
+
+struct sfi_processor_flags {
+u8 valid;
+u8 power;
+};
+
+struct sfi_processor {
+u32 id;
+struct sfi_processor_flags flags;
+struct sfi_processor_power power;
+struct sfi_processor_performance *performance;
+};
+
+/* Performance management */
+struct sfi_processor_px {
+u32 core_frequency;/* megahertz */
+u32 transition_latency;/* microseconds */
+u32 control;/* control value */
+};
+
+struct sfi_processor_performance {
+unsigned int state;
+unsigned int state_count;
+struct sfi_processor_px *states;
+};
+
+/* for communication between multiple parts of the processor kernel module */
+DECLARE_PER_CPU(struct sfi_processor *, sfi_processors);
+
+int sfi_processor_power_init(struct sfi_processor *pr);
+int sfi_processor_power_exit(struct sfi_processor *pr);
+
+#endif /*__SFI_PROCESSOR_H__*/
&lt;/pre&gt;</description>
    <dc:creator>Vishwesh M Rudramuni</dc:creator>
    <dc:date>2012-03-28T10:33:19</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.linux.kernel.cpufreq">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.linux.kernel.cpufreq</link>
  </textinput>
</rdf:RDF>

