<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/linux/thermal.h, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-03-25T19:52:04+00:00</updated>
<entry>
<title>thermal: core: Remove duplicate struct declaration</title>
<updated>2025-03-25T19:52:04+00:00</updated>
<author>
<name>xueqin Luo</name>
<email>luoxueqin@kylinos.cn</email>
</author>
<published>2025-02-06T08:14:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9e6ec8cf64e2973f0ec74f09023988cabd218426'/>
<id>urn:sha1:9e6ec8cf64e2973f0ec74f09023988cabd218426</id>
<content type='text'>
The struct thermal_zone_device is already declared on line 32, so the
duplicate declaration has been removed.

Fixes: b1ae92dcfa8e ("thermal: core: Make struct thermal_zone_device definition internal")
Signed-off-by: xueqin Luo &lt;luoxueqin@kylinos.cn&gt;
Link: https://lore.kernel.org/r/20250206081436.51785-1-luoxueqin@kylinos.cn
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
</content>
</entry>
<entry>
<title>thermal: core: Add stub for thermal_zone_device_update()</title>
<updated>2024-12-14T16:00:44+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2024-11-18T06:15:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=868dc3cd1105bd328be864bf2c409891438df44a'/>
<id>urn:sha1:868dc3cd1105bd328be864bf2c409891438df44a</id>
<content type='text'>
To simplify the !CONFIG_THERMAL case in the hwmon core,
add a !CONFIG_THERMAL stub for thermal_zone_device_update().

Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Reviewed-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Acked-by: Rafael J. Wysocki &lt;rafael@kernel.org&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>thermal: core: Add and use cooling device guard</title>
<updated>2024-10-24T12:48:23+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2024-10-14T14:59:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a5a98a786e5e31e85a69d30935254e8730734706'/>
<id>urn:sha1:a5a98a786e5e31e85a69d30935254e8730734706</id>
<content type='text'>
Add and use a special guard for cooling devices.

This allows quite a few error code paths to be simplified among
other things and brings in code size reduction for a good measure.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Link: https://patch.msgid.link/5837621.DvuYhMxLoT@rjwysocki.net
Reviewed-by: Lukasz Luba &lt;lukasz.luba@arm.com&gt;
</content>
</entry>
<entry>
<title>thermal: core: Add user thresholds support</title>
<updated>2024-10-10T21:33:37+00:00</updated>
<author>
<name>Daniel Lezcano</name>
<email>daniel.lezcano@linaro.org</email>
</author>
<published>2024-09-23T09:59:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=445936f9e258eca624c8239056bd8cd6e853b3fd'/>
<id>urn:sha1:445936f9e258eca624c8239056bd8cd6e853b3fd</id>
<content type='text'>
The user thresholds mechanism is a way to have the userspace to tell
the thermal framework to send a notification when a temperature limit
is crossed. There is no id, no hysteresis, just the temperature and
the direction of the limit crossing. That means we can be notified
when a threshold is crossed the way up only, or the way down only or
both ways. That allows to create hysteresis values if it is needed.

A threshold can be added, deleted or flushed. The latter means all
thresholds belonging to a thermal zone will be deleted.

When a threshold is added:

 - if the same threshold (temperature and direction) exists, an error
   is returned

 - if a threshold is specified with the same temperature but a
   different direction, the specified direction is added

 - if there is no threshold with the same temperature then it is
   created

When a threshold is deleted:

 - if the same threshold (temperature and direction) exists, it is
   deleted

 - if a threshold is specified with the same temperature but a
   different direction, the specified direction is removed

 - if there is no threshold with the same temperature, then an error
   is returned

When the threshold are flushed:

 - All thresholds related to a thermal zone are deleted

When a threshold is crossed:

 - the userspace does not need to know which threshold(s) have been
   crossed, it will be notified with the current temperature and the
   previous temperature

 - if multiple thresholds have been crossed between two updates only
   one notification will be send to the userspace, it is pointless to
   send a notification per thresholds crossed as the userspace can
   handle that easily when it has the temperature delta information

Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://patch.msgid.link/20240923100005.2532430-2-daniel.lezcano@linaro.org
[ rjw: Subject edit, use BIT(0) and BIT(1) in symbol definitions ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>thermal: core: Drop unused bind/unbind functions and callbacks</title>
<updated>2024-08-23T13:42:58+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2024-08-19T16:31:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c579286a514d88a3f0d3bdabfd4d88737b33cb17'/>
<id>urn:sha1:c579286a514d88a3f0d3bdabfd4d88737b33cb17</id>
<content type='text'>
There are no more callers of thermal_zone_bind_cooling_device() and
thermal_zone_unbind_cooling_device(), so drop them along with all of
the corresponding headers, code and documentation.

Moreover, because the .bind() and .unbind() thermal zone callbacks would
only be used when the above functions, respectively, were called, drop
them as well along with all of the code related to them.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Reviewed-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Acked-by: Huisong Li &lt;lihuisong@huawei.com&gt;
Reviewed-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://patch.msgid.link/4251116.1IzOArtZ34@rjwysocki.net
</content>
</entry>
<entry>
<title>thermal: core: Unexport thermal_bind_cdev_to_trip() and thermal_unbind_cdev_from_trip()</title>
<updated>2024-08-22T15:43:14+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2024-08-19T16:05:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2fb85633641770d55b50c934db6b4fb02411a1fe'/>
<id>urn:sha1:2fb85633641770d55b50c934db6b4fb02411a1fe</id>
<content type='text'>
Since thermal_bind_cdev_to_trip() and thermal_unbind_cdev_from_trip()
are only called locally in the thermal core now, they can be static,
so change their definitions accordingly and drop their headers from
the global thermal header file.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Reviewed-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Acked-by: Huisong Li &lt;lihuisong@huawei.com&gt;
Reviewed-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://patch.msgid.link/3512161.QJadu78ljV@rjwysocki.net
</content>
</entry>
<entry>
<title>thermal: core: Introduce .should_bind() thermal zone callback</title>
<updated>2024-08-22T15:43:14+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2024-08-19T16:00:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=aa35e56a5217b86f9c05420c36c908baf3b2df5f'/>
<id>urn:sha1:aa35e56a5217b86f9c05420c36c908baf3b2df5f</id>
<content type='text'>
The current design of the code binding cooling devices to trip points in
thermal zones is convoluted and hard to follow.

Namely, a driver that registers a thermal zone can provide .bind()
and .unbind() operations for it, which are required to call either
thermal_bind_cdev_to_trip() and thermal_unbind_cdev_from_trip(),
respectively, or thermal_zone_bind_cooling_device() and
thermal_zone_unbind_cooling_device(), respectively, for every relevant
trip point and the given cooling device.  Moreover, if .bind() is
provided and .unbind() is not, the cleanup necessary during the removal
of a thermal zone or a cooling device may not be carried out.

In other words, the core relies on the thermal zone owners to do the
right thing, which is error prone and far from obvious, even though all
of that is not really necessary.  Specifically, if the core could ask
the thermal zone owner, through a special thermal zone callback, whether
or not a given cooling device should be bound to a given trip point in
the given thermal zone, it might as well carry out all of the binding
and unbinding by itself.  In particular, the unbinding can be done
automatically without involving the thermal zone owner at all because
all of the thermal instances associated with a thermal zone or cooling
device going away must be deleted regardless.

Accordingly, introduce a new thermal zone operation, .should_bind(),
that can be invoked by the thermal core for a given thermal zone,
trip point and cooling device combination in order to check whether
or not the cooling device should be bound to the trip point at hand.
It takes an additional cooling_spec argument allowing the thermal
zone owner to specify the highest and lowest cooling states of the
cooling device and its weight for the given trip point binding.

Make the thermal core use this operation, if present, in the absence of
.bind() and .unbind().  Note that .should_bind() will be called under
the thermal zone lock.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Reviewed-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Acked-by: Huisong Li &lt;lihuisong@huawei.com&gt;
Reviewed-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://patch.msgid.link/9334403.CDJkKcVGEf@rjwysocki.net
</content>
</entry>
<entry>
<title>Merge back thermal core material for 6.12.</title>
<updated>2024-08-19T12:42:19+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2024-08-19T12:42:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5ae98b5a9f3aaacf62c34942e7efbee3de2b4abb'/>
<id>urn:sha1:5ae98b5a9f3aaacf62c34942e7efbee3de2b4abb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>thermal: gov_bang_bang: Use governor_data to reduce overhead</title>
<updated>2024-08-16T11:13:59+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2024-08-13T14:29:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6e6f58a170ea98e44075b761f2da42a5aec47dfb'/>
<id>urn:sha1:6e6f58a170ea98e44075b761f2da42a5aec47dfb</id>
<content type='text'>
After running once, the for_each_trip_desc() loop in
bang_bang_manage() is pure needless overhead because it is not going to
make any changes unless a new cooling device has been bound to one of
the trips in the thermal zone or the system is resuming from sleep.

For this reason, make bang_bang_manage() set governor_data for the
thermal zone and check it upfront to decide whether or not it needs to
do anything.

However, governor_data needs to be reset in some cases to let
bang_bang_manage() know that it should walk the trips again, so add an
.update_tz() callback to the governor and make the core additionally
invoke it during system resume.

To avoid affecting the other users of that callback unnecessarily, add
a special notification reason for system resume, THERMAL_TZ_RESUME, and
also pass it to __thermal_zone_device_update() called during system
resume for consistency.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Peter Kästle &lt;peter@piie.net&gt;
Reviewed-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Cc: 6.10+ &lt;stable@vger.kernel.org&gt; # 6.10+
Link: https://patch.msgid.link/2285575.iZASKD2KPV@rjwysocki.net
</content>
</entry>
<entry>
<title>thermal: trip: Drop thermal_zone_get_trip()</title>
<updated>2024-08-02T12:01:12+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2024-07-29T16:12:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8ecd953ca5850d2f83f548d4bbcf672d2d2cd0ca'/>
<id>urn:sha1:8ecd953ca5850d2f83f548d4bbcf672d2d2cd0ca</id>
<content type='text'>
There are no more callers of thermal_zone_get_trip() in the tree, so
drop it.

No functional impact.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Reviewed-by: Lukasz Luba &lt;lukasz.luba@arm.com&gt;
Link: https://patch.msgid.link/2220301.Mh6RI2rZIc@rjwysocki.net
</content>
</entry>
</feed>
