thermal: intel_powerclamp: Use first online CPU as control_cpu
Rafael J. Wysocki authored
commit 4bb7f6c2 upstream.

Commit 68b99e94 ("thermal: intel_powerclamp: Use get_cpu() instead
of smp_processor_id() to avoid crash") fixed an issue related to using
smp_processor_id() in preemptible context by replacing it with a pair
of get_cpu()/put_cpu(), but what is needed there really is any online
CPU and not necessarily the one currently running the code.  Arguably,
getting the one that's running the code in there is confusing.

For this reason, simply give the control CPU role to the first online
one which automatically will be CPU0 if it is online, so one check
can be dropped from the code for an added benefit.

Link: https://lore.kernel.org/linux-pm/20221011113646.GA12080@duo.ucw.cz/
Fixes: 68b99e94

 ("thermal: intel_powerclamp: Use get_cpu() instead of smp_processor_id() to avoid crash")
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: default avatarChen Yu <yu.c.chen@intel.com>
Sig...
7b198588
Name Last commit Last update
Documentation iio: ABI: Fix wrong format of differential capacitance channel ABI.
LICENSES LICENSES/deprecated: add Zlib license text
arch arm64: topology: fix possible overflow in amu_fie_setup()
block blk-throttle: prevent overflow while calculating wait time
certs certs/blacklist_hashes.c: fix const confusion in certs blacklist
crypto crypto: akcipher - default implementation for setting a private key
drivers thermal: intel_powerclamp: Use first online CPU as control_cpu
fs ext4: continue to expand file system when the target size doesn't reach
include inet: fully convert sk->sk_rx_dst to RCU rules
init Kconfig: Add option for asm goto w/ tied outputs to workaround clang-13 bug
ipc ipc/mqueue: use get_tree_nodev() in mqueue_get_tree()
kernel rcu-tasks: Convert RCU_LOCKDEP_WARN() to WARN_ONCE()
lib dyndbg: drop EXPORTed dynamic_debug_exec_queries
mm mm: hugetlb: fix UAF in hugetlb_handle_userfault
net inet: fully convert sk->sk_rx_dst to RCU rules
samples x86: Prepare inline-asm for straight-line-speculation
scripts kbuild: rpm-pkg: fix breakage when V=1 is used
security hardening: Remove Clang's enable flag for -ftrivial-auto-var-init=zero
sound ASoC: SOF: pci: Change DMI match info to support all Chrome platforms
tools perf intel-pt: Fix segfault in intel_pt_print_info() with uClibc
usr usr/include/Makefile: add linux/nfc.h to the compile-test coverage
virt KVM: SEV: add cache flush to solve SEV cache incoherency issues
.clang-format Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.