From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Saravana Kannan <skannan@codeaurora.org>,
"Srivatsa S. Bhat" <srivatsa@mit.edu>,
Viresh Kumar <viresh.kumar@linaro.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Subject: [PATCH 3.14 34/39] cpufreq: move policy kobj to policy->cpu at resume
Date: Tue, 5 Aug 2014 11:14:11 -0700 [thread overview]
Message-ID: <20140805181337.068678065@linuxfoundation.org> (raw)
In-Reply-To: <20140805181336.030349158@linuxfoundation.org>
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viresh Kumar <viresh.kumar@linaro.org>
commit 92c14bd9477a20a83144f08c0ca25b0308bf0730 upstream.
This is only relevant to implementations with multiple clusters, where clusters
have separate clock lines but all CPUs within a cluster share it.
Consider a dual cluster platform with 2 cores per cluster. During suspend we
start hot unplugging CPUs in order 1 to 3. When CPU2 is removed, policy->kobj
would be moved to CPU3 and when CPU3 goes down we wouldn't free policy or its
kobj as we want to retain permissions/values/etc.
Now on resume, we will get CPU2 before CPU3 and will call __cpufreq_add_dev().
We will recover the old policy and update policy->cpu from 3 to 2 from
update_policy_cpu().
But the kobj is still tied to CPU3 and isn't moved to CPU2. We wouldn't create a
link for CPU2, but would try that for CPU3 while bringing it online. Which will
report errors as CPU3 already has kobj assigned to it.
This bug got introduced with commit 42f921a, which overlooked this scenario.
To fix this, lets move kobj to the new policy->cpu while bringing first CPU of a
cluster back. Also do a WARN_ON() if kobject_move failed, as we would reach here
only for the first CPU of a non-boot cluster. And we can't recover from this
situation, if kobject_move() fails.
Fixes: 42f921a6f10c (cpufreq: remove sysfs files for CPUs which failed to come back after resume)
Cc: 3.13+ <stable@vger.kernel.org> # 3.13+
Reported-and-tested-by: Bu Yitian <ybu@qti.qualcomm.com>
Reported-by: Saravana Kannan <skannan@codeaurora.org>
Reviewed-by: Srivatsa S. Bhat <srivatsa@mit.edu>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/cpufreq/cpufreq.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1089,10 +1089,12 @@ static int __cpufreq_add_dev(struct devi
* the creation of a brand new one. So we need to perform this update
* by invoking update_policy_cpu().
*/
- if (frozen && cpu != policy->cpu)
+ if (frozen && cpu != policy->cpu) {
update_policy_cpu(policy, cpu);
- else
+ WARN_ON(kobject_move(&policy->kobj, &dev->kobj));
+ } else {
policy->cpu = cpu;
+ }
policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
cpumask_copy(policy->cpus, cpumask_of(cpu));
next prev parent reply other threads:[~2014-08-05 18:14 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-05 18:13 [PATCH 3.14 00/39] 3.14.16-stable review Greg Kroah-Hartman
2014-08-05 18:13 ` [PATCH 3.14 01/39] crypto: arm-aes - fix encryption of unaligned data Greg Kroah-Hartman
2014-08-05 18:13 ` [PATCH 3.14 02/39] crypto: af_alg - properly label AF_ALG socket Greg Kroah-Hartman
2014-08-05 18:13 ` [PATCH 3.14 03/39] ARM: dts: fix L2 address in Hi3620 Greg Kroah-Hartman
2014-08-05 18:13 ` [PATCH 3.14 04/39] ARM: fix alignment of keystone page table fixup Greg Kroah-Hartman
2014-08-05 18:13 ` [PATCH 3.14 05/39] ARM: 8115/1: LPAE: reduce damage caused by idmap to virtual memory layout Greg Kroah-Hartman
2014-08-05 18:13 ` [PATCH 3.14 06/39] ath9k: fix aggregation session lockup Greg Kroah-Hartman
2014-08-05 18:13 ` [PATCH 3.14 07/39] cfg80211: fix mic_failure tracing Greg Kroah-Hartman
2014-08-05 18:13 ` [PATCH 3.14 08/39] rapidio/tsi721_dma: fix failure to obtain transaction descriptor Greg Kroah-Hartman
2014-08-05 18:13 ` [PATCH 3.14 09/39] scsi: handle flush errors properly Greg Kroah-Hartman
2014-08-05 18:13 ` [PATCH 3.14 10/39] mm/page-writeback.c: fix divide by zero in bdi_dirty_limits() Greg Kroah-Hartman
2014-08-05 18:13 ` [PATCH 3.14 11/39] mm, thp: do not allow thp faults to avoid cpuset restrictions Greg Kroah-Hartman
2014-08-05 18:13 ` [PATCH 3.14 12/39] memcg: oom_notify use-after-free fix Greg Kroah-Hartman
2014-08-05 18:13 ` [PATCH 3.14 13/39] staging: vt6655: Fix disassociated messages every 10 seconds Greg Kroah-Hartman
2014-08-05 18:13 ` [PATCH 3.14 14/39] ACPI / PNP: Fix acpi_pnp_match() Greg Kroah-Hartman
2014-08-05 18:13 ` [PATCH 3.14 15/39] iio:bma180: Fix scale factors to report correct acceleration units Greg Kroah-Hartman
2014-08-05 18:13 ` [PATCH 3.14 16/39] iio:bma180: Missing check for frequency fractional part Greg Kroah-Hartman
2014-08-05 18:13 ` [PATCH 3.14 17/39] iio: buffer: Fix demux table creation Greg Kroah-Hartman
2014-08-05 18:13 ` [PATCH 3.14 18/39] dm bufio: fully initialize shrinker Greg Kroah-Hartman
2014-08-05 18:13 ` [PATCH 3.14 19/39] dm cache: fix race affecting dirty block count Greg Kroah-Hartman
2014-08-05 18:13 ` [PATCH 3.14 20/39] printk: rename printk_sched to printk_deferred Greg Kroah-Hartman
2014-08-05 18:13 ` [PATCH 3.14 21/39] sched_clock: Avoid corrupting hrtimer tree during suspend Greg Kroah-Hartman
2014-08-05 18:13 ` [PATCH 3.14 22/39] timer: Fix lock inversion between hrtimer_bases.lock and scheduler locks Greg Kroah-Hartman
2014-08-05 18:14 ` [PATCH 3.14 23/39] Revert "x86-64, modify_ldt: Make support for 16-bit segments a runtime option" Greg Kroah-Hartman
2014-08-05 18:14 ` [PATCH 3.14 24/39] x86-64, espfix: Dont leak bits 31:16 of %esp returning to 16-bit stack Greg Kroah-Hartman
2014-08-05 18:14 ` [PATCH 3.14 25/39] x86, espfix: Move espfix definitions into a separate header file Greg Kroah-Hartman
2014-08-05 18:14 ` [PATCH 3.14 26/39] x86, espfix: Fix broken header guard Greg Kroah-Hartman
2014-08-05 18:14 ` [PATCH 3.14 27/39] x86, espfix: Make espfix64 a Kconfig option, fix UML Greg Kroah-Hartman
2014-08-05 18:14 ` [PATCH 3.14 28/39] x86, espfix: Make it possible to disable 16-bit support Greg Kroah-Hartman
2014-08-05 18:14 ` [PATCH 3.14 29/39] x86_64/entry/xen: Do not invoke espfix64 on Xen Greg Kroah-Hartman
2014-08-05 18:14 ` [PATCH 3.14 30/39] pinctrl: dra: dt-bindings: Fix pull enable/disable Greg Kroah-Hartman
2014-08-05 18:14 ` [PATCH 3.14 31/39] ARM: dts: dra7-evm: Make VDDA_1V8_PHY supply always on Greg Kroah-Hartman
2014-08-05 18:14 ` [PATCH 3.14 32/39] staging: vt6655: Fix Warning on boot handle_irq_event_percpu Greg Kroah-Hartman
2014-08-05 18:14 ` [PATCH 3.14 33/39] Revert "mac80211: move "bufferable MMPDU" check to fix AP mode scan" Greg Kroah-Hartman
2014-08-05 18:14 ` Greg Kroah-Hartman [this message]
2014-08-05 18:14 ` [PATCH 3.14 35/39] x86/xen: no need to explicitly register an NMI callback Greg Kroah-Hartman
2014-08-05 18:14 ` [PATCH 3.14 36/39] xtensa: add fixup for double exception raised in window overflow Greg Kroah-Hartman
2014-08-05 18:14 ` [PATCH 3.14 37/39] net/l2tp: dont fall back on UDP [get|set]sockopt Greg Kroah-Hartman
2014-08-05 18:14 ` [PATCH 3.14 38/39] lib/btree.c: fix leak of whole btree nodes Greg Kroah-Hartman
2014-08-05 18:14 ` [PATCH 3.14 39/39] x86/espfix/xen: Fix allocation of pages for paravirt page tables Greg Kroah-Hartman
2014-08-05 23:07 ` [PATCH 3.14 00/39] 3.14.16-stable review Shuah Khan
2014-08-06 2:35 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140805181337.068678065@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=skannan@codeaurora.org \
--cc=srivatsa@mit.edu \
--cc=stable@vger.kernel.org \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).