CPU hotplug, debug: detect imbalance between get_online_cpus() and pu…
¦t_online_cpus()# Please enter the commit message for your changes.
Lines starting
The synchronization between CPU hotplug readers and writers is achieved#
(use "git reset HEAD <file>..." to unstage) by means of refcounting,
safeguarded by the cpu_hotplug.lock.#
get_online_cpus() increments the refcount, whereas put_online_cpus()#
decrements it.  If we ever hit an imbalance between the two, we end up
compromising the guarantees of the hotplug synchronization i.e, for
example, an extra call to put_online_cpus() can end up allowing a
hotplug reader to execute concurrently with a hotplug writer. So, add a
WARN_ON() in put_online_cpus() to detect such cases where the refcount
can go negative, and also attempt to fix it up, so that we can continue
to run. Change-Id: I144efeaa5899a2e8a3cddd21f010679cbaaa2459
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Cc: Jiri
Kosina <jkosina@suse.cz> Cc: Thomas Gleixner <tglx@linutronix.de> Cc:
Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org> Git-commit: 075663d
Git-repo:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: Fix policy getting stuck when user & kernel min/max don't ov…
¦erlap# Please enter the commit message for your changes. Lines
starting
Every __cpufreq_set_policy starts with checking the new policy min/max
has# (use "git push" to publish your local commits) some overlap with
the current policy min/max. This works out fine until we# end up with
the policy min/max being set to a range that doesn't overlap# Changes to
be committed: with the user policy min/max. Once we get into this
situation, the check at# (use "git reset HEAD <file>..." to unstage) the
start of __cpufreq_set_policy fails and prevents us from getting out of#
this state.# modified: drivers/cpufreq/cpufreq.c
This only happens when one of the CPUFREQ_ADJUST/CPUFREQ_INCOMPATIBLE
notifiers called inside __cpufreq_set_policy pick a min/max outside the
range of user policy min/max. The real intent of the check at the start
of __cpufreq_set_policy is to make sure userspace can't set user policy
min > user policy max. Since __cpufreq_set_policy always gets called
only with current user policy min/max except when the actual user space
policy min/max is changed, we can fix the issue by simply checking the
new policy min/max against current user policy min/max. Change-Id:
Iaac805825e64d7985c41fb9052bd96baacdf3d6f Signed-off-by: Saravana Kannan
<skannan@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: Optimize cpufreq_frequency_table_verify()
cpufreq_frequency_table_verify() is rewritten here to make it more
logical# Please enter the commit message for your changes. Lines
starting and efficient.# with '#' will be ignored, and an empty message
aborts the commit.
 - merge multiple lines for variable declarations together.# On branch
my-cm-11.0-3.X
 - quit early if any frequency between min/max is found.# Your branch is
ahead of 'origin/my-cm-11.0-3.X' by 2 commits.
 - don't call cpufreq_verify_within_limits() in case any valid freq is#
(use "git push" to publish your local commits)
   found as it is of no use.#
 - rename the count variable as found and change its type to boolean.#
Changes to be committed:
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org># Signed-off-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com># modified:
drivers/cpufreq/freq_table.c
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>#