Thermal control fixes for 7.4-rc1

- Fix CPU mask truncation in power limit trace event used by the power
    allocator thermal governor (Hungyu Lin)
 
  - Fix code indentation in create_s32_tzp_attr() and rearrange it to
    use early return when applicable (Thorsten Blum)
 
  - Allow cross builds of the Intel thermal tests (Sasha Levin)
 -----BEGIN PGP SIGNATURE-----
 
 iQFGBAABCAAwFiEEcM8Aw/RY0dgsiRUR7l+9nS/U47UFAmrk+OUSHHJqd0Byand5
 c29ja2kubmV0AAoJEO5fvZ0v1OO1l6sH/1hdre7kr1AixczWHUuhG22QZpOT2uV0
 UWQ5woVkcFivobTemz+3OZR5sA2bx2iuO7AsNUqDwOTEnxuH4vAB7STwp7CM2gBE
 x2/1ZWdHje7QBw0sXEiH5RYQDkLeOMcfS8lXnXzoEVIkRz86vEd9yzRQfbvK/nNv
 PEhTScmXN+euC1ZWglVOjzx/NEEjHnLvSrAU2nuKhEp7VOx0niL2BAtMKYM0w44X
 cmPpmqs2TG1ya5rGNxwQYZa9XKFZ9QSNXfPClyncy1MJDRJKBcvYo5Xi7JZGh3yh
 pTJeuS4UPYwKEWCEdSFOsbgruWjxfLAqQlMfGNAfWOMvB8YMl8Kt/Mk=
 =M2+P
 -----END PGP SIGNATURE-----

Merge tag 'thermal-7.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull thermal control fixes from Rafael Wysocki:
 "These fix three issues related to thermal control:

   - Fix CPU mask truncation in power limit trace event used by the
     power allocator thermal governor (Hungyu Lin)

   - Fix code indentation in create_s32_tzp_attr() and rearrange it to
     use early return when applicable (Thorsten Blum)

   - Allow cross builds of the Intel thermal tests (Sasha Levin)"

* tag 'thermal-7.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  thermal: sysfs: Fix indentation in create_s32_tzp_attr()
  thermal: Fix CPU mask truncation in power limit trace event
  selftests/thermal: allow cross builds of the Intel tests
This commit is contained in:
Linus Torvalds 2026-10-30 13:28:58 -10:00
commit a9547379cb
4 changed files with 16 additions and 20 deletions

View File

@ -287,12 +287,12 @@ sustainable_power_store(struct device *dev, struct device_attribute *devattr,
name##_show(struct device *dev, struct device_attribute *devattr, \
char *buf) \
{ \
struct thermal_zone_device *tz = to_thermal_zone(dev); \
struct thermal_zone_device *tz = to_thermal_zone(dev); \
\
if (!tz->tzp) \
return -EIO; \
\
if (tz->tzp) \
return sysfs_emit(buf, "%d\n", tz->tzp->name); \
else \
return -EIO; \
} \
\
static ssize_t \

View File

@ -119,7 +119,7 @@ TRACE_EVENT(thermal_power_cpu_limit,
TP_ARGS(cpus, freq, cdev_state, power),
TP_STRUCT__entry(
__bitmask(cpumask, num_possible_cpus())
__bitmask(cpumask, nr_cpumask_bits)
__field(unsigned int, freq )
__field(unsigned long, cdev_state)
__field(u32, power )
@ -127,7 +127,7 @@ TRACE_EVENT(thermal_power_cpu_limit,
TP_fast_assign(
__assign_bitmask(cpumask, cpumask_bits(cpus),
num_possible_cpus());
nr_cpumask_bits);
__entry->freq = freq;
__entry->cdev_state = cdev_state;
__entry->power = power;

View File

@ -1,12 +1,10 @@
# SPDX-License-Identifier: GPL-2.0
ifndef CROSS_COMPILE
ARCH ?= $(shell uname -m 2>/dev/null || echo not)
override ARCH := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
top_srcdir = ../../../../../..
include $(top_srcdir)/scripts/subarch.include
ARCH_PROCESSED := $(shell echo $(or $(ARCH),$(SUBARCH)) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
ifeq ($(ARCH),x86)
ifeq ($(ARCH_PROCESSED),x86)
TEST_GEN_PROGS := power_floor_test
endif
include ../../../lib.mk
endif
endif

View File

@ -1,12 +1,10 @@
# SPDX-License-Identifier: GPL-2.0
ifndef CROSS_COMPILE
ARCH ?= $(shell uname -m 2>/dev/null || echo not)
override ARCH := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
top_srcdir = ../../../../../..
include $(top_srcdir)/scripts/subarch.include
ARCH_PROCESSED := $(shell echo $(or $(ARCH),$(SUBARCH)) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
ifeq ($(ARCH),x86)
ifeq ($(ARCH_PROCESSED),x86)
TEST_GEN_PROGS := workload_hint_test
endif
include ../../../lib.mk
endif
endif