<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/cpufreq/cpufreq.c, branch v3.13</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>cpufreq: preserve user_policy across suspend/resume</title>
<updated>2013-12-29T14:31:21+00:00</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2013-12-24T01:41:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=08fd8c1cf0a99abf34e09a8b99b74872e0d73a23'/>
<id>08fd8c1cf0a99abf34e09a8b99b74872e0d73a23</id>
<content type='text'>
Prevent __cpufreq_add_dev() from overwriting the existing values of
user_policy.{min|max|policy|governor} with defaults during resume
from system suspend.

Fixes: 5302c3fb2e62 ("cpufreq: Perform light-weight init/teardown during suspend/resume")
Reported-by: Bjørn Mork &lt;bjorn@mork.no&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Cc: 3.12+ &lt;stable@vger.kernel.org&gt; # 3.12+
[rjw: Changelog]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Prevent __cpufreq_add_dev() from overwriting the existing values of
user_policy.{min|max|policy|governor} with defaults during resume
from system suspend.

Fixes: 5302c3fb2e62 ("cpufreq: Perform light-weight init/teardown during suspend/resume")
Reported-by: Bjørn Mork &lt;bjorn@mork.no&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Cc: 3.12+ &lt;stable@vger.kernel.org&gt; # 3.12+
[rjw: Changelog]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cpufreq: Clean up after a failing light-weight initialization</title>
<updated>2013-12-29T14:30:36+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2013-12-27T00:07:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=72368d122c7479aa6e14fbbd334717b8a0c157a6'/>
<id>72368d122c7479aa6e14fbbd334717b8a0c157a6</id>
<content type='text'>
If cpufreq_policy_restore() returns NULL during system resume,
__cpufreq_add_dev() should just fall back to the full initialization
instead of returning an error, because that may actually make things
work.  Moreover, it should not leave stale fallback data behind after
it has failed to restore a previously existing policy.

This change is based on Viresh Kumar's work.

Fixes: 5302c3fb2e62 ("cpufreq: Perform light-weight init/teardown during suspend/resume")
Reported-by: Bjørn Mork &lt;bjorn@mork.no&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Cc: 3.12+ &lt;stable@vger.kernel.org&gt; # 3.12+
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If cpufreq_policy_restore() returns NULL during system resume,
__cpufreq_add_dev() should just fall back to the full initialization
instead of returning an error, because that may actually make things
work.  Moreover, it should not leave stale fallback data behind after
it has failed to restore a previously existing policy.

This change is based on Viresh Kumar's work.

Fixes: 5302c3fb2e62 ("cpufreq: Perform light-weight init/teardown during suspend/resume")
Reported-by: Bjørn Mork &lt;bjorn@mork.no&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Cc: 3.12+ &lt;stable@vger.kernel.org&gt; # 3.12+
</pre>
</div>
</content>
</entry>
<entry>
<title>cpufreq: Use CONFIG_CPU_FREQ_DEFAULT_* to set initial policy for setpolicy drivers</title>
<updated>2013-12-21T23:51:52+00:00</updated>
<author>
<name>Jason Baron</name>
<email>jbaron@akamai.com</email>
</author>
<published>2013-12-19T22:50:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a27a9ab706c8f5bb8bbd320d2e9c5d089e380c6a'/>
<id>a27a9ab706c8f5bb8bbd320d2e9c5d089e380c6a</id>
<content type='text'>
When configuring a default governor (via CONFIG_CPU_FREQ_DEFAULT_*) with the
intel_pstate driver, the desired default policy is not properly set. For
example, setting 'CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE' ends up with the
'powersave' policy being set.

Fix by configuring the correct default policy, if either 'powersave' or
'performance' are requested. Otherwise, fallback to what the driver originally
set via its 'init' routine.

Signed-off-by: Jason Baron &lt;jbaron@akamai.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When configuring a default governor (via CONFIG_CPU_FREQ_DEFAULT_*) with the
intel_pstate driver, the desired default policy is not properly set. For
example, setting 'CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE' ends up with the
'powersave' policy being set.

Fix by configuring the correct default policy, if either 'powersave' or
'performance' are requested. Otherwise, fallback to what the driver originally
set via its 'init' routine.

Signed-off-by: Jason Baron &lt;jbaron@akamai.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cpufreq: remove sysfs files for CPUs which failed to come back after resume</title>
<updated>2013-12-21T23:47:46+00:00</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2013-12-20T15:56:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=42f921a6f10c6c2079b093a115eb7e3c3508357f'/>
<id>42f921a6f10c6c2079b093a115eb7e3c3508357f</id>
<content type='text'>
There are cases where cpufreq_add_dev() may fail for some CPUs
during system resume. With the current code we will still have
sysfs cpufreq files for those CPUs and struct cpufreq_policy
would be already freed for them. Hence any operation on those
sysfs files would result in kernel warnings.

Example of problems resulting from resume errors (from Bjørn Mork):

WARNING: CPU: 0 PID: 6055 at fs/sysfs/file.c:343 sysfs_open_file+0x77/0x212()
missing sysfs attribute operations for kobject: (null)
Modules linked in: [stripped as irrelevant]
CPU: 0 PID: 6055 Comm: grep Tainted: G      D      3.13.0-rc2 #153
Hardware name: LENOVO 2776LEG/2776LEG, BIOS 6EET55WW (3.15 ) 12/19/2011
 0000000000000009 ffff8802327ebb78 ffffffff81380b0e 0000000000000006
 ffff8802327ebbc8 ffff8802327ebbb8 ffffffff81038635 0000000000000000
 ffffffff811823c7 ffff88021a19e688 ffff88021a19e688 ffff8802302f9310
Call Trace:
 [&lt;ffffffff81380b0e&gt;] dump_stack+0x55/0x76
 [&lt;ffffffff81038635&gt;] warn_slowpath_common+0x7c/0x96
 [&lt;ffffffff811823c7&gt;] ? sysfs_open_file+0x77/0x212
 [&lt;ffffffff810386e3&gt;] warn_slowpath_fmt+0x41/0x43
 [&lt;ffffffff81182dec&gt;] ? sysfs_get_active+0x6b/0x82
 [&lt;ffffffff81182382&gt;] ? sysfs_open_file+0x32/0x212
 [&lt;ffffffff811823c7&gt;] sysfs_open_file+0x77/0x212
 [&lt;ffffffff81182350&gt;] ? sysfs_schedule_callback+0x1ac/0x1ac
 [&lt;ffffffff81122562&gt;] do_dentry_open+0x17c/0x257
 [&lt;ffffffff8112267e&gt;] finish_open+0x41/0x4f
 [&lt;ffffffff81130225&gt;] do_last+0x80c/0x9ba
 [&lt;ffffffff8112dbbd&gt;] ? inode_permission+0x40/0x42
 [&lt;ffffffff81130606&gt;] path_openat+0x233/0x4a1
 [&lt;ffffffff81130b7e&gt;] do_filp_open+0x35/0x85
 [&lt;ffffffff8113b787&gt;] ? __alloc_fd+0x172/0x184
 [&lt;ffffffff811232ea&gt;] do_sys_open+0x6b/0xfa
 [&lt;ffffffff811233a7&gt;] SyS_openat+0xf/0x11
 [&lt;ffffffff8138c812&gt;] system_call_fastpath+0x16/0x1b

To fix this, remove those sysfs files or put the associated kobject
in case of such errors. Also, to make it simple, remove the cpufreq
sysfs links from all the CPUs (except for the policy-&gt;cpu) during
suspend, as that operation won't result in a loss of sysfs file
permissions and we can create those links during resume just fine.

Fixes: 5302c3fb2e62 ("cpufreq: Perform light-weight init/teardown during suspend/resume")
Reported-and-tested-by: Bjørn Mork &lt;bjorn@mork.no&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Cc: 3.12+ &lt;stable@vger.kernel.org&gt; # 3.12+
[rjw: Changelog]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are cases where cpufreq_add_dev() may fail for some CPUs
during system resume. With the current code we will still have
sysfs cpufreq files for those CPUs and struct cpufreq_policy
would be already freed for them. Hence any operation on those
sysfs files would result in kernel warnings.

Example of problems resulting from resume errors (from Bjørn Mork):

WARNING: CPU: 0 PID: 6055 at fs/sysfs/file.c:343 sysfs_open_file+0x77/0x212()
missing sysfs attribute operations for kobject: (null)
Modules linked in: [stripped as irrelevant]
CPU: 0 PID: 6055 Comm: grep Tainted: G      D      3.13.0-rc2 #153
Hardware name: LENOVO 2776LEG/2776LEG, BIOS 6EET55WW (3.15 ) 12/19/2011
 0000000000000009 ffff8802327ebb78 ffffffff81380b0e 0000000000000006
 ffff8802327ebbc8 ffff8802327ebbb8 ffffffff81038635 0000000000000000
 ffffffff811823c7 ffff88021a19e688 ffff88021a19e688 ffff8802302f9310
Call Trace:
 [&lt;ffffffff81380b0e&gt;] dump_stack+0x55/0x76
 [&lt;ffffffff81038635&gt;] warn_slowpath_common+0x7c/0x96
 [&lt;ffffffff811823c7&gt;] ? sysfs_open_file+0x77/0x212
 [&lt;ffffffff810386e3&gt;] warn_slowpath_fmt+0x41/0x43
 [&lt;ffffffff81182dec&gt;] ? sysfs_get_active+0x6b/0x82
 [&lt;ffffffff81182382&gt;] ? sysfs_open_file+0x32/0x212
 [&lt;ffffffff811823c7&gt;] sysfs_open_file+0x77/0x212
 [&lt;ffffffff81182350&gt;] ? sysfs_schedule_callback+0x1ac/0x1ac
 [&lt;ffffffff81122562&gt;] do_dentry_open+0x17c/0x257
 [&lt;ffffffff8112267e&gt;] finish_open+0x41/0x4f
 [&lt;ffffffff81130225&gt;] do_last+0x80c/0x9ba
 [&lt;ffffffff8112dbbd&gt;] ? inode_permission+0x40/0x42
 [&lt;ffffffff81130606&gt;] path_openat+0x233/0x4a1
 [&lt;ffffffff81130b7e&gt;] do_filp_open+0x35/0x85
 [&lt;ffffffff8113b787&gt;] ? __alloc_fd+0x172/0x184
 [&lt;ffffffff811232ea&gt;] do_sys_open+0x6b/0xfa
 [&lt;ffffffff811233a7&gt;] SyS_openat+0xf/0x11
 [&lt;ffffffff8138c812&gt;] system_call_fastpath+0x16/0x1b

To fix this, remove those sysfs files or put the associated kobject
in case of such errors. Also, to make it simple, remove the cpufreq
sysfs links from all the CPUs (except for the policy-&gt;cpu) during
suspend, as that operation won't result in a loss of sysfs file
permissions and we can create those links during resume just fine.

Fixes: 5302c3fb2e62 ("cpufreq: Perform light-weight init/teardown during suspend/resume")
Reported-and-tested-by: Bjørn Mork &lt;bjorn@mork.no&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Cc: 3.12+ &lt;stable@vger.kernel.org&gt; # 3.12+
[rjw: Changelog]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "cpufreq: fix garbage kobjects on errors during suspend/resume"</title>
<updated>2013-12-08T00:32:41+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2013-12-08T00:23:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d4faadd5d5b368a7051fef374ee933ec3606713b'/>
<id>d4faadd5d5b368a7051fef374ee933ec3606713b</id>
<content type='text'>
Commit 2167e2399dc5 (cpufreq: fix garbage kobjects on errors during
suspend/resume) breaks suspend/resume on Martin Ziegler's system
(hard lockup during resume), so revert it.

Fixes: 2167e2399dc5 (cpufreq: fix garbage kobjects on errors during suspend/resume)
References: https://bugzilla.kernel.org/show_bug.cgi?id=66751
Reported-by: Martin Ziegler &lt;ziegler@uni-freiburg.de&gt;
Cc: 3.12+ &lt;stable@vger.kernel.org&gt; # 3.12+
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 2167e2399dc5 (cpufreq: fix garbage kobjects on errors during
suspend/resume) breaks suspend/resume on Martin Ziegler's system
(hard lockup during resume), so revert it.

Fixes: 2167e2399dc5 (cpufreq: fix garbage kobjects on errors during suspend/resume)
References: https://bugzilla.kernel.org/show_bug.cgi?id=66751
Reported-by: Martin Ziegler &lt;ziegler@uni-freiburg.de&gt;
Cc: 3.12+ &lt;stable@vger.kernel.org&gt; # 3.12+
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "cpufreq: suspend governors on system suspend/hibernate"</title>
<updated>2013-12-08T00:04:17+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2013-12-08T00:04:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=12205a4b79bef56ef618a4b7caa840c5c971cff2'/>
<id>12205a4b79bef56ef618a4b7caa840c5c971cff2</id>
<content type='text'>
Commit 5a87182aa21d (cpufreq: suspend governors on system
suspend/hibernate) causes hibernation problems to happen on
Bjørn Mork's and Paul Bolle's systems, so revert it.

Fixes: 5a87182aa21d (cpufreq: suspend governors on system suspend/hibernate)
Reported-by: Bjørn Mork &lt;bjorn@mork.no&gt;
Reported-by: Paul Bolle &lt;pebolle@tiscali.nl&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 5a87182aa21d (cpufreq: suspend governors on system
suspend/hibernate) causes hibernation problems to happen on
Bjørn Mork's and Paul Bolle's systems, so revert it.

Fixes: 5a87182aa21d (cpufreq: suspend governors on system suspend/hibernate)
Reported-by: Bjørn Mork &lt;bjorn@mork.no&gt;
Reported-by: Paul Bolle &lt;pebolle@tiscali.nl&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cpufreq: fix garbage kobjects on errors during suspend/resume</title>
<updated>2013-12-03T14:25:52+00:00</updated>
<author>
<name>Bjørn Mork</name>
<email>bjorn@mork.no</email>
</author>
<published>2013-12-03T11:14:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=2167e2399dc5e69c62db56d933e9c8cbe107620a'/>
<id>2167e2399dc5e69c62db56d933e9c8cbe107620a</id>
<content type='text'>
This is effectively a revert of commit 5302c3fb2e62 ("cpufreq: Perform
light-weight init/teardown during suspend/resume"), which enabled
suspend/resume optimizations leaving the sysfs files in place.

Errors during suspend/resume are not handled properly, leaving
dead sysfs attributes in case of failures.  There are are number of
functions with special code for the "frozen" case, and all these
need to also have special error handling.

The problem is easy to demonstrate by making cpufreq_driver-&gt;init()
or cpufreq_driver-&gt;get() fail during resume.

The code is too complex for a simple fix, with split code paths
in multiple blocks within a number of functions.  It is therefore
best to revert the patch enabling this code until the error handling
is in place.

Examples of problems resulting from resume errors:

WARNING: CPU: 0 PID: 6055 at fs/sysfs/file.c:343 sysfs_open_file+0x77/0x212()
missing sysfs attribute operations for kobject: (null)
Modules linked in: [stripped as irrelevant]
CPU: 0 PID: 6055 Comm: grep Tainted: G      D      3.13.0-rc2 #153
Hardware name: LENOVO 2776LEG/2776LEG, BIOS 6EET55WW (3.15 ) 12/19/2011
 0000000000000009 ffff8802327ebb78 ffffffff81380b0e 0000000000000006
 ffff8802327ebbc8 ffff8802327ebbb8 ffffffff81038635 0000000000000000
 ffffffff811823c7 ffff88021a19e688 ffff88021a19e688 ffff8802302f9310
Call Trace:
 [&lt;ffffffff81380b0e&gt;] dump_stack+0x55/0x76
 [&lt;ffffffff81038635&gt;] warn_slowpath_common+0x7c/0x96
 [&lt;ffffffff811823c7&gt;] ? sysfs_open_file+0x77/0x212
 [&lt;ffffffff810386e3&gt;] warn_slowpath_fmt+0x41/0x43
 [&lt;ffffffff81182dec&gt;] ? sysfs_get_active+0x6b/0x82
 [&lt;ffffffff81182382&gt;] ? sysfs_open_file+0x32/0x212
 [&lt;ffffffff811823c7&gt;] sysfs_open_file+0x77/0x212
 [&lt;ffffffff81182350&gt;] ? sysfs_schedule_callback+0x1ac/0x1ac
 [&lt;ffffffff81122562&gt;] do_dentry_open+0x17c/0x257
 [&lt;ffffffff8112267e&gt;] finish_open+0x41/0x4f
 [&lt;ffffffff81130225&gt;] do_last+0x80c/0x9ba
 [&lt;ffffffff8112dbbd&gt;] ? inode_permission+0x40/0x42
 [&lt;ffffffff81130606&gt;] path_openat+0x233/0x4a1
 [&lt;ffffffff81130b7e&gt;] do_filp_open+0x35/0x85
 [&lt;ffffffff8113b787&gt;] ? __alloc_fd+0x172/0x184
 [&lt;ffffffff811232ea&gt;] do_sys_open+0x6b/0xfa
 [&lt;ffffffff811233a7&gt;] SyS_openat+0xf/0x11
 [&lt;ffffffff8138c812&gt;] system_call_fastpath+0x16/0x1b

The failure to restore cpufreq devices on cancelled hibernation is
not a new bug. It is caused by the ACPI _PPC call failing unless the
hibernate is completed. This makes the acpi_cpufreq driver fail its
init.

Previously, the cpufreq device could be restored by offlining the
cpu temporarily.  And as a complete hibernation cycle would do this,
it would be automatically restored most of the time.  But after
commit 5302c3fb2e62 the leftover sysfs attributes will block any
device add action.  Therefore offlining and onlining CPU 1 will no
longer restore the cpufreq object, and a complete suspend/resume
cycle will replace it with garbage.

Fixes: 5302c3fb2e62 ("cpufreq: Perform light-weight init/teardown during suspend/resume")
Cc: 3.12+ &lt;stable@vger.kernel.org&gt; # 3.12+
Signed-off-by: Bjørn Mork &lt;bjorn@mork.no&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is effectively a revert of commit 5302c3fb2e62 ("cpufreq: Perform
light-weight init/teardown during suspend/resume"), which enabled
suspend/resume optimizations leaving the sysfs files in place.

Errors during suspend/resume are not handled properly, leaving
dead sysfs attributes in case of failures.  There are are number of
functions with special code for the "frozen" case, and all these
need to also have special error handling.

The problem is easy to demonstrate by making cpufreq_driver-&gt;init()
or cpufreq_driver-&gt;get() fail during resume.

The code is too complex for a simple fix, with split code paths
in multiple blocks within a number of functions.  It is therefore
best to revert the patch enabling this code until the error handling
is in place.

Examples of problems resulting from resume errors:

WARNING: CPU: 0 PID: 6055 at fs/sysfs/file.c:343 sysfs_open_file+0x77/0x212()
missing sysfs attribute operations for kobject: (null)
Modules linked in: [stripped as irrelevant]
CPU: 0 PID: 6055 Comm: grep Tainted: G      D      3.13.0-rc2 #153
Hardware name: LENOVO 2776LEG/2776LEG, BIOS 6EET55WW (3.15 ) 12/19/2011
 0000000000000009 ffff8802327ebb78 ffffffff81380b0e 0000000000000006
 ffff8802327ebbc8 ffff8802327ebbb8 ffffffff81038635 0000000000000000
 ffffffff811823c7 ffff88021a19e688 ffff88021a19e688 ffff8802302f9310
Call Trace:
 [&lt;ffffffff81380b0e&gt;] dump_stack+0x55/0x76
 [&lt;ffffffff81038635&gt;] warn_slowpath_common+0x7c/0x96
 [&lt;ffffffff811823c7&gt;] ? sysfs_open_file+0x77/0x212
 [&lt;ffffffff810386e3&gt;] warn_slowpath_fmt+0x41/0x43
 [&lt;ffffffff81182dec&gt;] ? sysfs_get_active+0x6b/0x82
 [&lt;ffffffff81182382&gt;] ? sysfs_open_file+0x32/0x212
 [&lt;ffffffff811823c7&gt;] sysfs_open_file+0x77/0x212
 [&lt;ffffffff81182350&gt;] ? sysfs_schedule_callback+0x1ac/0x1ac
 [&lt;ffffffff81122562&gt;] do_dentry_open+0x17c/0x257
 [&lt;ffffffff8112267e&gt;] finish_open+0x41/0x4f
 [&lt;ffffffff81130225&gt;] do_last+0x80c/0x9ba
 [&lt;ffffffff8112dbbd&gt;] ? inode_permission+0x40/0x42
 [&lt;ffffffff81130606&gt;] path_openat+0x233/0x4a1
 [&lt;ffffffff81130b7e&gt;] do_filp_open+0x35/0x85
 [&lt;ffffffff8113b787&gt;] ? __alloc_fd+0x172/0x184
 [&lt;ffffffff811232ea&gt;] do_sys_open+0x6b/0xfa
 [&lt;ffffffff811233a7&gt;] SyS_openat+0xf/0x11
 [&lt;ffffffff8138c812&gt;] system_call_fastpath+0x16/0x1b

The failure to restore cpufreq devices on cancelled hibernation is
not a new bug. It is caused by the ACPI _PPC call failing unless the
hibernate is completed. This makes the acpi_cpufreq driver fail its
init.

Previously, the cpufreq device could be restored by offlining the
cpu temporarily.  And as a complete hibernation cycle would do this,
it would be automatically restored most of the time.  But after
commit 5302c3fb2e62 the leftover sysfs attributes will block any
device add action.  Therefore offlining and onlining CPU 1 will no
longer restore the cpufreq object, and a complete suspend/resume
cycle will replace it with garbage.

Fixes: 5302c3fb2e62 ("cpufreq: Perform light-weight init/teardown during suspend/resume")
Cc: 3.12+ &lt;stable@vger.kernel.org&gt; # 3.12+
Signed-off-by: Bjørn Mork &lt;bjorn@mork.no&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cpufreq: suspend governors on system suspend/hibernate</title>
<updated>2013-11-28T13:47:31+00:00</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2013-11-27T03:39:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5a87182aa21d6d5d306840feab9321818dd3e2a3'/>
<id>5a87182aa21d6d5d306840feab9321818dd3e2a3</id>
<content type='text'>
This patch adds cpufreq suspend/resume calls to dpm_{suspend|resume}_noirq()
for handling suspend/resume of cpufreq governors.

Lan Tianyu (Intel) &amp; Jinhyuk Choi (Broadcom) found anr issue where
tunables configuration for clusters/sockets with non-boot CPUs was
getting lost after suspend/resume, as we were notifying governors
with CPUFREQ_GOV_POLICY_EXIT on removal of the last cpu for that
policy and so deallocating memory for tunables. This is fixed by
this patch as we don't allow any operation on governors after
device suspend and before device resume now.

Reported-and-tested-by: Lan Tianyu &lt;tianyu.lan@intel.com&gt;
Reported-by: Jinhyuk Choi &lt;jinchoi@broadcom.com&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
[rjw: Changelog, minor cleanups]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds cpufreq suspend/resume calls to dpm_{suspend|resume}_noirq()
for handling suspend/resume of cpufreq governors.

Lan Tianyu (Intel) &amp; Jinhyuk Choi (Broadcom) found anr issue where
tunables configuration for clusters/sockets with non-boot CPUs was
getting lost after suspend/resume, as we were notifying governors
with CPUFREQ_GOV_POLICY_EXIT on removal of the last cpu for that
policy and so deallocating memory for tunables. This is fixed by
this patch as we don't allow any operation on governors after
device suspend and before device resume now.

Reported-and-tested-by: Lan Tianyu &lt;tianyu.lan@intel.com&gt;
Reported-by: Jinhyuk Choi &lt;jinchoi@broadcom.com&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
[rjw: Changelog, minor cleanups]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cpufreq: move freq change notifications to cpufreq core</title>
<updated>2013-10-30T23:11:08+00:00</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2013-08-14T14:08:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d4019f0a92ab802f385cc9c8ad3ab7b5449712cb'/>
<id>d4019f0a92ab802f385cc9c8ad3ab7b5449712cb</id>
<content type='text'>
Most of the drivers do following in their -&gt;target_index() routines:

	struct cpufreq_freqs freqs;
	freqs.old = old freq...
	freqs.new = new freq...

	cpufreq_notify_transition(policy, &amp;freqs, CPUFREQ_PRECHANGE);

	/* Change rate here */

	cpufreq_notify_transition(policy, &amp;freqs, CPUFREQ_POSTCHANGE);

This is replicated over all cpufreq drivers today and there doesn't exists a
good enough reason why this shouldn't be moved to cpufreq core instead.

There are few special cases though, like exynos5440, which doesn't do everything
on the call to -&gt;target_index() routine and call some kind of bottom halves for
doing this work, work/tasklet/etc..

They may continue doing notification from their own code as flag:
CPUFREQ_ASYNC_NOTIFICATION is already set for them.

All drivers are also modified in this patch to avoid breaking 'git bisect', as
double notification would happen otherwise.

Acked-by: Hans-Christian Egtvedt &lt;egtvedt@samfundet.no&gt;
Acked-by: Jesper Nilsson &lt;jesper.nilsson@axis.com&gt;
Acked-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Acked-by: Russell King &lt;linux@arm.linux.org.uk&gt;
Acked-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Tested-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Tested-by: Nicolas Pitre &lt;nicolas.pitre@linaro.org&gt;
Reviewed-by: Lan Tianyu &lt;tianyu.lan@intel.com&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Most of the drivers do following in their -&gt;target_index() routines:

	struct cpufreq_freqs freqs;
	freqs.old = old freq...
	freqs.new = new freq...

	cpufreq_notify_transition(policy, &amp;freqs, CPUFREQ_PRECHANGE);

	/* Change rate here */

	cpufreq_notify_transition(policy, &amp;freqs, CPUFREQ_POSTCHANGE);

This is replicated over all cpufreq drivers today and there doesn't exists a
good enough reason why this shouldn't be moved to cpufreq core instead.

There are few special cases though, like exynos5440, which doesn't do everything
on the call to -&gt;target_index() routine and call some kind of bottom halves for
doing this work, work/tasklet/etc..

They may continue doing notification from their own code as flag:
CPUFREQ_ASYNC_NOTIFICATION is already set for them.

All drivers are also modified in this patch to avoid breaking 'git bisect', as
double notification would happen otherwise.

Acked-by: Hans-Christian Egtvedt &lt;egtvedt@samfundet.no&gt;
Acked-by: Jesper Nilsson &lt;jesper.nilsson@axis.com&gt;
Acked-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Acked-by: Russell King &lt;linux@arm.linux.org.uk&gt;
Acked-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Tested-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Tested-by: Nicolas Pitre &lt;nicolas.pitre@linaro.org&gt;
Reviewed-by: Lan Tianyu &lt;tianyu.lan@intel.com&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cpufreq: create per policy rwsem instead of per CPU cpu_policy_rwsem</title>
<updated>2013-10-25T21:54:12+00:00</updated>
<author>
<name>viresh kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2013-10-18T13:40:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=ad7722dab7292dbc1c4586d701ac226b68122d39'/>
<id>ad7722dab7292dbc1c4586d701ac226b68122d39</id>
<content type='text'>
We have per-CPU cpu_policy_rwsem for cpufreq core, but we never use
all of them. We always use rwsem of policy-&gt;cpu and so we can
actually make this rwsem per policy instead.

This patch does this change. With this change other tricky situations
are also avoided now, like which lock to take while we are changing
policy-&gt;cpu, etc.

Suggested-by: Srivatsa S. Bhat &lt;srivatsa.bhat@linux.vnet.ibm.com&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Reviewed-by: Srivatsa S. Bhat &lt;srivatsa.bhat@linux.vnet.ibm.com&gt;
Tested-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We have per-CPU cpu_policy_rwsem for cpufreq core, but we never use
all of them. We always use rwsem of policy-&gt;cpu and so we can
actually make this rwsem per policy instead.

This patch does this change. With this change other tricky situations
are also avoided now, like which lock to take while we are changing
policy-&gt;cpu, etc.

Suggested-by: Srivatsa S. Bhat &lt;srivatsa.bhat@linux.vnet.ibm.com&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Reviewed-by: Srivatsa S. Bhat &lt;srivatsa.bhat@linux.vnet.ibm.com&gt;
Tested-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
