<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/thermal/broadcom, branch v6.6.132</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-08-11T10:47:12+00:00</updated>
<entry>
<title>thermal/drivers/broadcom: Fix race between removal and clock disable</title>
<updated>2024-08-11T10:47:12+00:00</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzysztof.kozlowski@linaro.org</email>
</author>
<published>2024-07-09T12:59:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=34e788045d0c292a8e2e79a945c0ed228441fd22'/>
<id>urn:sha1:34e788045d0c292a8e2e79a945c0ed228441fd22</id>
<content type='text'>
[ Upstream commit e90c369cc2ffcf7145a46448de101f715a1f5584 ]

During the probe, driver enables clocks necessary to access registers
(in get_temp()) and then registers thermal zone with managed-resources
(devm) interface.  Removal of device is not done in reversed order,
because:
1. Clock will be disabled in driver remove() callback - thermal zone is
   still registered and accessible to users,
2. devm interface will unregister thermal zone.

This leaves short window between (1) and (2) for accessing the
get_temp() callback with disabled clock.

Fix this by enabling clock also via devm-interface, so entire cleanup
path will be in proper, reversed order.

Fixes: 8454c8c09c77 ("thermal/drivers/bcm2835: Remove buggy call to thermal_of_zone_unregister")
Cc: stable@vger.kernel.org
Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@linaro.org&gt;
Link: https://lore.kernel.org/r/20240709-thermal-probe-v1-1-241644e2b6e0@linaro.org
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>thermal: bcm2835: Convert to platform remove callback returning void</title>
<updated>2024-08-11T10:47:12+00:00</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2023-09-27T19:37:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=103881e6363c60c1e65e3ac7531d7243177e34b9'/>
<id>urn:sha1:103881e6363c60c1e65e3ac7531d7243177e34b9</id>
<content type='text'>
[ Upstream commit f29ecd3748a28d0b52512afc81b3c13fd4a00c9b ]

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Acked-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Stable-dep-of: e90c369cc2ff ("thermal/drivers/broadcom: Fix race between removal and clock disable")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>thermal/drivers/broadcom/brcstb_thermal: Removed unneeded platform_set_drvdata()</title>
<updated>2023-08-16T10:22:28+00:00</updated>
<author>
<name>Andrei Coardos</name>
<email>aboutphysycs@gmail.com</email>
</author>
<published>2023-08-09T15:48:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fb6ce327d6ad382d46b30fa79cae763d5bc457ae'/>
<id>urn:sha1:fb6ce327d6ad382d46b30fa79cae763d5bc457ae</id>
<content type='text'>
This function call was found to be unnecessary as there is no equivalent
platform_get_drvdata() call to access the private data of the driver. Also,
the private data is defined in this driver, so there is no risk of it being
accessed outside of this driver file.

Signed-off-by: Andrei Coardos &lt;aboutphysycs@gmail.com&gt;
Reviewed-by: Alexandru Ardelean &lt;alex@shruggie.ro&gt;
Reviewed-by: Florian Fainelli &lt;florian.fainelli@broadcom.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20230809154813.16033-1-aboutphysycs@gmail.com
</content>
</entry>
<entry>
<title>thermal/drivers/broadcom/sr-thermal: Removed call to platform_set_drvdata()</title>
<updated>2023-08-16T10:17:19+00:00</updated>
<author>
<name>Andrei Coardos</name>
<email>aboutphysycs@gmail.com</email>
</author>
<published>2023-08-10T11:13:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1c73c3be9cc83ad1340897fe45adf1d11c418678'/>
<id>urn:sha1:1c73c3be9cc83ad1340897fe45adf1d11c418678</id>
<content type='text'>
This function call was found to be unnecessary as there is no equivalent
platform_get_drvdata() call to access the private data of the driver. Also,
the private data is defined in this driver, so there is no risk of it being
accessed outside of this driver file.

Signed-off-by: Andrei Coardos &lt;aboutphysycs@gmail.com&gt;
Reviewed-by: Alexandru Ardelean &lt;alex@shruggie.ro&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20230810111330.3248-1-aboutphysycs@gmail.com
</content>
</entry>
<entry>
<title>thermal: Explicitly include correct DT includes</title>
<updated>2023-07-31T18:03:42+00:00</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2023-07-14T17:50:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f6a756e8fb12923f0e3996a575e935e94f3594eb'/>
<id>urn:sha1:f6a756e8fb12923f0e3996a575e935e94f3594eb</id>
<content type='text'>
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Reviewed-by: Alim Akhtar &lt;alim.akhtar@samsung.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>thermal/drivers/bcm2835: Remove buggy call to thermal_of_zone_unregister</title>
<updated>2023-04-07T16:36:28+00:00</updated>
<author>
<name>Daniel Lezcano</name>
<email>daniel.lezcano@linaro.org</email>
</author>
<published>2023-04-04T07:51:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8454c8c09c7768fd86cda61f1a07b9c746050c80'/>
<id>urn:sha1:8454c8c09c7768fd86cda61f1a07b9c746050c80</id>
<content type='text'>
The driver is using the devm_thermal_of_zone_device_register().

In the error path of the function calling
devm_thermal_of_zone_device_register(), the function
devm_thermal_of_zone_unregister() should be called instead of
thermal_of_zone_unregister(), otherwise this one will be called twice
when the device is freed.

The same happens for the remove function where the devm_ guarantee the
thermal_of_zone_unregister() will be called, so adding this call in
the remove function will lead to a double free also.

Use devm_ variant in the error path of the probe function.

Remove thermal_of_zone_unregister() in the remove function.

Cc: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Cc: Ray Jui &lt;rjui@broadcom.com&gt;
Cc: Scott Branden &lt;sbranden@broadcom.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20230404075138.2914680-1-daniel.lezcano@linaro.org
</content>
</entry>
<entry>
<title>thermal/hwmon: Do not set no_hwmon before calling thermal_add_hwmon_sysfs()</title>
<updated>2023-03-03T19:45:02+00:00</updated>
<author>
<name>Daniel Lezcano</name>
<email>daniel.lezcano@linaro.org</email>
</author>
<published>2023-03-01T20:14:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8f3f4ad4ad45e2e30c814de42629ef4c9688e92c'/>
<id>urn:sha1:8f3f4ad4ad45e2e30c814de42629ef4c9688e92c</id>
<content type='text'>
The thermal-&gt;tzp-&gt;no_hwmon parameter is only used when calling
thermal_zone_device_register().

Setting it to 'false' before calling thermal_add_hwmon_sysfs() has no
effect.

Remove the call and again prevent the drivers to access the thermal
internals.

Reviewed-by: Niklas Söderlund &lt;niklas.soderlund+renesas@ragnatech.se&gt; #R-Car
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Acked-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt; #Broadcom
Acked-by: Heiko Stuebner &lt;heiko@sntech.de&gt; #rockchip
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>thermal: Remove debug or error messages in get_temp() ops</title>
<updated>2023-03-03T19:45:02+00:00</updated>
<author>
<name>Daniel Lezcano</name>
<email>daniel.lezcano@linaro.org</email>
</author>
<published>2023-03-01T20:14:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=abda7383ec3a2efc0417d3265b7a872e74fe47e7'/>
<id>urn:sha1:abda7383ec3a2efc0417d3265b7a872e74fe47e7</id>
<content type='text'>
Some get_temp() ops implementation are showing an error or a debug
message if the reading of the sensor fails.

The debug message is already displayed from the call site of this
ops. So we can remove it.

On the other side, the error should not be displayed because in
production that can raise tons of messages.

Finally, some drivers are showing a debug message with the
temperature, this is also accessible through the trace from the core
code in the temperature_update() function.

Another benefit is the dev_* messages are accessing the thermal zone
device field from the structure, so we encapsulate even more the code
by preventing these accesses.

Remove those messages.

Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt; #Armada
Acked-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt; #brcmstb_thermal.c
Acked-by: Heiko Stuebner &lt;heiko@sntech.de&gt; #rockchip
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>thermal/core: Use the thermal zone 'devdata' accessor in thermal located drivers</title>
<updated>2023-03-03T19:45:02+00:00</updated>
<author>
<name>Daniel Lezcano</name>
<email>daniel.lezcano@linaro.org</email>
</author>
<published>2023-03-01T20:14:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5f68d0785e5258ab5e6df9e351929973a0742c1a'/>
<id>urn:sha1:5f68d0785e5258ab5e6df9e351929973a0742c1a</id>
<content type='text'>
The thermal zone device structure is exposed to the different drivers
and obviously they access the internals while that should be
restricted to the core thermal code.

In order to self-encapsulate the thermal core code, we need to prevent
the drivers accessing directly the thermal zone structure and provide
accessor functions to deal with.

Use the devdata accessor introduced in the previous patch.

No functional changes intended.

Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Reviewed-by: Niklas Söderlund &lt;niklas.soderlund+renesas@ragnatech.se&gt; #R-Car
Acked-by: Mark Brown &lt;broonie@kernel.org&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt; #MediaTek auxadc and lvts
Reviewed-by: Balsam CHIHI &lt;bchihi@baylibre.com&gt; #Mediatek lvts
Reviewed-by: Adam Ward &lt;DLG-Adam.Ward.opensource@dm.renesas.com&gt; #da9062
Reviewed-by: Baolin Wang &lt;baolin.wang@linux.alibaba.com&gt;  #spread
Acked-by: Jernej Skrabec &lt;jernej.skrabec@gmail.com&gt; #sun8i_thermal
Acked-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt; #Broadcom
Reviewed-by: Dhruva Gole &lt;d-gole@ti.com&gt; # K3 bandgap
Acked-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Acked-by: Heiko Stuebner &lt;heiko@sntech.de&gt; #rockchip
Reviewed-by: Kunihiko Hayashi &lt;hayashi.kunihiko@socionext.com&gt; #uniphier
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>thermal: Remove core header inclusion from drivers</title>
<updated>2023-02-15T16:29:48+00:00</updated>
<author>
<name>Daniel Lezcano</name>
<email>daniel.lezcano@linaro.org</email>
</author>
<published>2023-02-06T15:34:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9272d2d43b6e532d0c0b6d3a597cf75c9ca1e183'/>
<id>urn:sha1:9272d2d43b6e532d0c0b6d3a597cf75c9ca1e183</id>
<content type='text'>
As the name states "thermal_core.h" is the header file for the core
components of the thermal framework.

Too many drivers are including it. Hopefully the recent cleanups
helped to self encapsulate the code a bit more and prevented the
drivers to need this header.

Remove this inclusion in every place where it is possible.

Some other drivers did a confusion with the core header and the one
exported in linux/thermal.h. They include the former instead of the
latter. The changes also fix this.

The tegra/soctherm driver still remains as it uses an internal
function which need to be replaced.

The Intel HFI driver uses the netlink internal framework core and
should be changed to prevent to deal with the internals.

No functional changes intended.

Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt; # armada_thermal.c
Reviewed-by: Kunihiko Hayashi &lt;hayashi.kunihiko@socionext.com&gt; # uniphier_thermal.c
Reviewed-by: Niklas Söderlund &lt;niklas.soderlund+renesas@ragnatech.se&gt; # rcar_gen3_thermal.c
Reviewed-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt; # amlogic_thermal.c
Acked-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt; # bcm2835_thermal.c
Acked-by: Thierry Reding &lt;treding@nvidia.com&gt; # tegra30-tsensor.c
Link: https://lore.kernel.org/r/20230206153432.1017282-1-daniel.lezcano@linaro.org
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
</feed>
