<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/thermal/qcom/tsens.c, branch linux-6.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2024-05-30T07:44:23Z</updated>
<entry>
<title>thermal/drivers/tsens: Fix null pointer dereference</title>
<updated>2024-05-30T07:44:23Z</updated>
<author>
<name>Aleksandr Mishin</name>
<email>amishin@t-argos.ru</email>
</author>
<published>2024-04-11T11:40:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=fcf5f1b5f308f2eb422f6aca55d295b25890906b'/>
<id>urn:sha1:fcf5f1b5f308f2eb422f6aca55d295b25890906b</id>
<content type='text'>
[ Upstream commit d998ddc86a27c92140b9f7984ff41e3d1d07a48f ]

compute_intercept_slope() is called from calibrate_8960() (in tsens-8960.c)
as compute_intercept_slope(priv, p1, NULL, ONE_PT_CALIB) which lead to null
pointer dereference (if DEBUG or DYNAMIC_DEBUG set).
Fix this bug by adding null pointer check.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: dfc1193d4dbd ("thermal/drivers/tsens: Replace custom 8960 apis with generic apis")
Signed-off-by: Aleksandr Mishin &lt;amishin@t-argos.ru&gt;
Reviewed-by: Konrad Dybcio &lt;konrad.dybcio@linaro.org&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20240411114021.12203-1-amishin@t-argos.ru
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>thermal: tsens: Convert to platform remove callback returning void</title>
<updated>2023-09-29T10:34:17Z</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2023-09-27T19:37:24Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2128ba4639e37f39c73e2e07baed24038d47b973'/>
<id>urn:sha1:2128ba4639e37f39c73e2e07baed24038d47b973</id>
<content type='text'>
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;
</content>
</entry>
<entry>
<title>thermal/drivers/qcom: Remove redundant msg at probe time</title>
<updated>2023-06-26T10:03:14Z</updated>
<author>
<name>Yangtao Li</name>
<email>frank.li@vivo.com</email>
</author>
<published>2023-06-20T09:07:30Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7adbbb3b7b2a5bc413425fe001f8e237163c435f'/>
<id>urn:sha1:7adbbb3b7b2a5bc413425fe001f8e237163c435f</id>
<content type='text'>
The upper-layer devm_thermal_add_hwmon_sysfs() function can directly
print error information.

Signed-off-by: Yangtao Li &lt;frank.li@vivo.com&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20230620090732.50025-9-frank.li@vivo.com
</content>
</entry>
<entry>
<title>thermal/drivers/qcom/tsens-v0_1: Add MSM8909 data</title>
<updated>2023-06-26T10:03:13Z</updated>
<author>
<name>Stephan Gerhold</name>
<email>stephan.gerhold@kernkonzept.com</email>
</author>
<published>2023-06-07T10:47:49Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4af164c1c11895adcf0181a6c627fbcacf439107'/>
<id>urn:sha1:4af164c1c11895adcf0181a6c627fbcacf439107</id>
<content type='text'>
The MSM8909 SoC has 5 thermal sensors in a TSENS v0.1 block. Like
MDM9607 it uses a non-standard default slope value of 3000 [1] and needs
per-sensor "correction factors" to workaround issues with the factory
calibration [2].

[1]: https://git.codelinaro.org/clo/la/kernel/msm-3.18/-/blob/LA.UM.7.7.c26-09100-8x09.0/arch/arm/boot/dts/qcom/msm8909.dtsi#L476
[2]: https://git.codelinaro.org/clo/la/kernel/msm-3.18/-/commit/6df022c6d0c2c1b4a5a6c2124dba4d57910c0911

Reviewed-by: Konrad Dybcio &lt;konrad.dybcio@linaro.org&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Signed-off-by: Stephan Gerhold &lt;stephan.gerhold@kernkonzept.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20230508-msm8909-tsens-v5-6-5eb632235ba7@kernkonzept.com
</content>
</entry>
<entry>
<title>thermal/drivers/qcom/tsens-v0_1: Add mdm9607 correction offsets</title>
<updated>2023-06-26T10:03:13Z</updated>
<author>
<name>Stephan Gerhold</name>
<email>stephan.gerhold@kernkonzept.com</email>
</author>
<published>2023-06-07T10:47:46Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b6f739da0070c36655118618a173a59fa14c7adc'/>
<id>urn:sha1:b6f739da0070c36655118618a173a59fa14c7adc</id>
<content type='text'>
According to the msm-3.18 vendor kernel from Qualcomm, mdm9607 needs
"correction factors" to adjust for additional offsets observed after the
factory calibration values in the fuses [1, 2].

The fixed offsets should be applied unless there is a special
calibration mode value that indicates that no offsets are needed [3].

Note that the new calibration mode values are called differently in this
patch compared to the vendor kernel:
  - TSENS_TWO_POINT_CALIB_N_WA        -&gt; ONE_PT_CALIB2_NO_OFFSET
  - TSENS_TWO_POINT_CALIB_N_OFFSET_WA -&gt; TWO_PT_CALIB_NO_OFFSET
This is because close inspection of the calibration function [3] reveals
that TSENS_TWO_POINT_CALIB_N_WA is actually a "one point" calibration
because the if statements skip all "point2" related code for it.

[1]: https://git.codelinaro.org/clo/la/kernel/msm-3.18/-/commit/d9d2db1b82bf3f72f5de0803d55e6849eb5b671e
[2]: https://git.codelinaro.org/clo/la/kernel/msm-3.18/-/commit/d75aef53a760e8ff7bac54049d00c8b2ee1b193e
[3]: https://git.codelinaro.org/clo/la/kernel/msm-3.18/-/blob/LE.UM.4.3.2.r1-04200-9x07/drivers/thermal/msm-tsens.c#L2987-3136

Fixes: a2149ab815fc ("thermal/drivers/qcom/tsens-v0_1: Add support for MDM9607")
Reviewed-by: Konrad Dybcio &lt;konrad.dybcio@linaro.org&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Signed-off-by: Stephan Gerhold &lt;stephan.gerhold@kernkonzept.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20230508-msm8909-tsens-v5-3-5eb632235ba7@kernkonzept.com
</content>
</entry>
<entry>
<title>thermal/drivers/qcom/tsens-v0_1: Add support for MSM8226</title>
<updated>2023-06-26T10:03:13Z</updated>
<author>
<name>Matti Lehtimäki</name>
<email>matti.lehtimaki@gmail.com</email>
</author>
<published>2023-05-07T20:12:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=598e1afca47fdbb302ce8d288b06bcc8728efc6c'/>
<id>urn:sha1:598e1afca47fdbb302ce8d288b06bcc8728efc6c</id>
<content type='text'>
The MSM8226 TSENS IP has 6 thermal sensors in a TSENS v0.1 block.
The thermal sensors use non-standard slope values.

Signed-off-by: Matti Lehtimäki &lt;matti.lehtimaki@gmail.com&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Reviewed-by: Luca Weiss &lt;luca@z3ntu.xyz&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20230507201225.89694-4-matti.lehtimaki@gmail.com
</content>
</entry>
<entry>
<title>thermal/hwmon: Use the right device for devm_thermal_add_hwmon_sysfs()</title>
<updated>2023-03-03T19:45:02Z</updated>
<author>
<name>Daniel Lezcano</name>
<email>daniel.lezcano@linaro.org</email>
</author>
<published>2023-03-01T20:14:36Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4a16c190f761cb3a87dcbbf355f91c71ce1f8c0b'/>
<id>urn:sha1:4a16c190f761cb3a87dcbbf355f91c71ce1f8c0b</id>
<content type='text'>
The devres variant of thermal_add_hwmon_sysfs() only takes the thermal
zone structure pointer as parameter.

Actually, it uses the tz-&gt;device to add it in the devres list.

It is preferable to use the device registering the thermal zone
instead of the thermal zone device itself. That prevents the driver
accessing the thermal zone structure internals and it is from my POV
more correct regarding how devm_ is used.

Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Acked-by: Martin Blumenstingl &lt;martin.blumenstingl@googlemail.com&gt; #amlogic_thermal
Acked-by: Jernej Skrabec &lt;jernej.skrabec@gmail.com&gt; #sun8i_thermal
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt; #MediaTek auxadc
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:02Z</updated>
<author>
<name>Daniel Lezcano</name>
<email>daniel.lezcano@linaro.org</email>
</author>
<published>2023-03-01T20:14:30Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/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/drivers/qcom: Remove duplicate set next trip point interrupt code</title>
<updated>2023-01-16T12:05:24Z</updated>
<author>
<name>Daniel Lezcano</name>
<email>daniel.lezcano@linaro.org</email>
</author>
<published>2023-01-16T10:19:54Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=df715f26cb7b43e3fabb4518aa65931180de8a71'/>
<id>urn:sha1:df715f26cb7b43e3fabb4518aa65931180de8a71</id>
<content type='text'>
The tsens driver reprogram the next trip points in the irq
handler. This function then call thermal_zone_device_update().

However, thermal_zone_device_update() calls thermal_zone_set_trips()
and from there it calls the backend 'set_trips' ops. This one in turn
reprogram the next trip points (low/high).

Consequently, the code setting the next trip points interrupt in the
interrupt handle is not needed and could be removed.

Reviewed-by: Bjorn Andersson &lt;andersson@kernel.org&gt;
Acked-by: Amit Kucheria &lt;amitk@kernel.org&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20230116101955.3961427-1-daniel.lezcano@linaro.org
</content>
</entry>
<entry>
<title>thermal/drivers/tsens: Rework legacy calibration data parsers</title>
<updated>2023-01-16T10:22:30Z</updated>
<author>
<name>Dmitry Baryshkov</name>
<email>dmitry.baryshkov@linaro.org</email>
</author>
<published>2023-01-01T19:40:25Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=913d32e2786c183f5b38e7f1ffb67e9120afbf83'/>
<id>urn:sha1:913d32e2786c183f5b38e7f1ffb67e9120afbf83</id>
<content type='text'>
Rework existing calibration parsing code to use simple data structure
describing data layout. This allows us to drop all the mask &amp; shift
values, replacing them with data tables.

The code for msm8974 is not reworked, as it has separate calibration and
backup data.

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Link: https://lore.kernel.org/r/20230101194034.831222-12-dmitry.baryshkov@linaro.org
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
</content>
</entry>
</feed>
