linux-next/drivers
Daniel Lezcano 4feaedf7d2 thermal/thresholds: Fix boundaries and detection routine
The current implementation does not work if the thermal zone is
interrupt driven only.

The boundaries are not correctly checked and computed as it happens
only when the temperature is increasing or decreasing.

The problem arises because the routine to detect when we cross a
threshold is correlated with the computation of the boundaries. We
assume we have to recompute the boundaries when a threshold is crossed
but actually we should do that even if the it is not the case.

Mixing the boundaries computation and the threshold detection for the
sake of optimizing the routine is much more complex as it appears
intuitively and prone to errors.

This fix separates the boundaries computation and the threshold
crossing detection into different routines. The result is a code much
more simple to understand, thus easier to maintain.

The drawback is we browse the thresholds list several time but we can
consider that as neglictible because that happens when the temperature
is updated. There are certainly some aeras to improve in the
temperature update routine but it would be not adequate as this change
aims to fix the thresholds for v6.13.

Fixes: 445936f9e2 ("thermal: core: Add user thresholds support")
Tested-by: Daniel Lezcano <daniel.lezcano@linaro.org> # rock5b, Lenovo x13s
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://patch.msgid.link/20241216212644.1145122-1-daniel.lezcano@linaro.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2024-12-18 14:51:31 +01:00
..
accel module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
accessibility
acpi ACPI fixes for 6.13-rc3 2024-12-13 16:51:56 -08:00
amba ARM: 9415/1: amba: Add dev_is_amba() function and export it for modules 2024-11-12 16:41:45 +00:00
android Char/Misc/IIO/Whatever driver subsystem updates for 6.13-rc1 2024-11-29 11:58:27 -08:00
ata ata: sata_highbank: fix OF node reference leak in highbank_initialize_phys() 2024-12-09 09:06:58 +09:00
atm Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
auxdisplay module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
base - Have the Automatic IBRS setting check on AMD does not falsely fire in 2024-12-08 11:38:56 -08:00
bcma Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
block virtio-blk: don't keep queue frozen during system suspend 2024-12-05 10:00:20 -07:00
bluetooth Bluetooth: btmtk: avoid UAF in btmtk_process_coredump 2024-12-12 09:25:28 -05:00
bus Char/Misc/IIO/Whatever driver subsystem updates for 6.13-rc1 2024-11-29 11:58:27 -08:00
cache
cdrom Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
cdx module: Convert default symbol namespace to string literal 2024-12-03 08:22:25 -08:00
char Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
clk Two reverts and two EN7581 driver fixes: 2024-12-10 18:21:40 -08:00
clocksource Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
comedi comedi: Flush partial mappings in error case 2024-11-05 14:01:07 +01:00
connector
counter module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
cpufreq powerpc updates for 6.13 2024-11-23 10:44:31 -08:00
cpuidle Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
crypto crypto: hisilicon/debugfs - fix the struct pointer incorrectly offset problem 2024-12-10 13:40:25 +08:00
cxl module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
dax module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
dca
devfreq Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
dio
dma module: Convert default symbol namespace to string literal 2024-12-03 08:22:25 -08:00
dma-buf drm fixes for 6.13-rc2 2024-12-06 11:52:15 -08:00
dpll
edac EDAC/amd64: Simplify ECC check on unified memory controllers 2024-12-11 21:47:33 +01:00
eisa
extcon Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
firewire firewire updates for v6.13 2024-11-25 17:12:54 -08:00
firmware First batch of EFI fixes for v6.13 2024-12-15 15:33:41 -08:00
fpga module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
fsi Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
gnss
gpio gpio: idio-16: Actually make use of the GPIO_IDIO_16 symbol namespace 2024-12-10 11:38:57 +01:00
gpu Rust fixes for v6.13 2024-12-14 08:51:43 -08:00
greybus greybus: Fix a typo 2024-11-05 05:33:46 +01:00
hid hid-for-linus-2024120501 2024-12-05 10:06:47 -08:00
hsi Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
hte Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
hv Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
hwmon module: Convert default symbol namespace to string literal 2024-12-03 08:22:25 -08:00
hwspinlock Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
hwtracing Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
i2c i2c: riic: Always round-up when calculating bus period 2024-12-12 12:54:02 +01:00
i3c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
idle intel_idle: add Granite Rapids Xeon D support 2024-11-11 15:48:50 +01:00
iio 24 hotfixes. 17 are cc:stable. 15 are MM and 9 are non-MM. 2024-12-08 11:26:13 -08:00
infiniband module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
input Input updates for v6.13-rc0 2024-11-25 10:31:39 -08:00
interconnect Merge branch 'icc-sar2130p' into icc-next 2024-11-05 01:32:05 +02:00
iommu iommu/vt-d: Avoid draining PRQ in sva mm release path 2024-12-13 15:54:27 +01:00
ipack
irqchip irqchip/gic-v3: Work around insecure GIC integrations 2024-12-13 18:15:29 +01:00
isdn mISDN: Fix typos 2024-11-09 09:14:12 -08:00
leds module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
macintosh Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
mailbox TTY / Serial driver updates for 6.13-rc1 2024-11-30 09:03:16 -08:00
mcb module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
md dm: Fix dm-zoned-reclaim zone write pointer alignment 2024-12-10 09:15:33 -07:00
media module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
memory Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
memstick Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
message scsi: message: fusion: Constify struct pci_device_id 2024-11-20 21:38:24 -05:00
mfd module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
misc module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
mmc mmc: core: Further prevent card detect during shutdown 2024-12-02 15:37:16 +01:00
most
mtd This pull request contains updates for JFFS2, UBI and UBIFS: 2024-11-30 10:32:47 -08:00
mux
net net: dsa: microchip: KSZ9896 register regmap alignment to 32 bit boundaries 2024-12-12 07:10:11 -08:00
nfc
ntb
nubus
nvdimm module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
nvme nvme fixes for Linux 6.13 2024-12-05 10:14:36 -07:00
nvmem Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
of Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
opp Additional power management updates for 6.13-rc1 2024-11-27 14:40:33 -08:00
parisc Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
parport Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
pci module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
pcmcia Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
peci module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
perf module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
phy Driver core changes for 6.13-rc1 2024-11-29 11:43:29 -08:00
pinctrl module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
platform platform-drivers-x86 for v6.13-2 2024-12-04 10:28:30 -08:00
pmdomain pmdomain core: 2024-12-06 11:24:00 -08:00
pnp
power power supply and reset changes for the 6.13 series 2024-11-28 09:28:09 -08:00
powercap module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
pps Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
ps3 ps3: Correct some typos in comments 2024-11-15 00:32:29 +11:00
ptp ptp: kvm: x86: Return EOPNOTSUPP instead of ENODEV from kvm_arch_ptp_init() 2024-12-06 17:38:11 -08:00
pwm module: Convert default symbol namespace to string literal 2024-12-03 08:22:25 -08:00
rapidio
ras
regulator regulator: axp20x: AXP717: set ramp_delay 2024-12-09 13:06:07 +00:00
remoteproc remoteproc: qcom: wcss: Remove double assignment in q6v5_wcss_probe() 2024-11-15 20:36:27 -08:00
reset module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
rpmsg Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
rtc module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
s390 Driver core changes for 6.13-rc1 2024-11-29 11:43:29 -08:00
sbus Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
scsi scsi: scsi_debug: Fix hrtimer support for ndelay 2024-12-04 13:22:59 -05:00
sh sh updates for v6.13 2024-11-30 14:45:29 -08:00
siox
slimbus Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
soc Networking changes for 6.13. 2024-11-21 08:28:08 -08:00
soundwire module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
spi spi: spi-cadence-qspi: Disable STIG mode for Altera SoCFPGA. 2024-12-09 13:06:24 +00:00
spmi Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
ssb
staging staging: gpib: Fix i386 build issue 2024-12-04 17:29:20 +01:00
target Merge branch '6.13/scsi-queue' into 6.13/scsi-fixes 2024-12-02 12:36:18 -05:00
tc TC: Fix the wrong format specifier 2024-11-12 15:48:08 +01:00
tee Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
thermal thermal/thresholds: Fix boundaries and detection routine 2024-12-18 14:51:31 +01:00
thunderbolt USB / Thunderbolt (USB4) changes for 6.13-rc1 2024-11-29 11:19:31 -08:00
tty Serial driver fixes for 6.13-rc3 2024-12-14 09:31:19 -08:00
ufs scsi: ufs: core: Update compl_time_stamp_local_clock after completing a cqe 2024-12-09 21:49:08 -05:00
uio Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
usb USB driver fixes for 6.13-rc3 2024-12-14 09:35:22 -08:00
vdpa vdpa/mlx5: Fix suboptimal range on iotlb iteration 2024-11-12 18:05:05 -05:00
vfio VFIO fixes for v6.13-rc3 2024-12-11 13:48:25 -08:00
vhost mm: page_frag: avoid caller accessing 'page_frag_cache' directly 2024-11-11 10:56:27 -08:00
video module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
virt arm64 fixes for 6.13-rc2: 2024-12-06 13:47:55 -08:00
virtio virtio_ring: add a func argument 'recycle_done' to virtqueue_reset() 2024-12-10 11:22:21 +01:00
w1 Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
watchdog linux-watchdog 6.13-rc1 tag 2024-12-05 10:03:43 -08:00
xen module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
zorro
Kconfig
Makefile