<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/thermal, branch linux-5.19.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.19.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.19.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2022-10-24T07:58:09Z</updated>
<entry>
<title>thermal: intel_powerclamp: Use get_cpu() instead of smp_processor_id() to avoid crash</title>
<updated>2022-10-24T07:58:09Z</updated>
<author>
<name>Srinivas Pandruvada</name>
<email>srinivas.pandruvada@linux.intel.com</email>
</author>
<published>2022-09-20T11:06:57Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6e2a347b304224b2aeb1c0ea000d1cf8a02cc592'/>
<id>urn:sha1:6e2a347b304224b2aeb1c0ea000d1cf8a02cc592</id>
<content type='text'>
[ Upstream commit 68b99e94a4a2db6ba9b31fe0485e057b9354a640 ]

When CPU 0 is offline and intel_powerclamp is used to inject
idle, it generates kernel BUG:

BUG: using smp_processor_id() in preemptible [00000000] code: bash/15687
caller is debug_smp_processor_id+0x17/0x20
CPU: 4 PID: 15687 Comm: bash Not tainted 5.19.0-rc7+ #57
Call Trace:
&lt;TASK&gt;
dump_stack_lvl+0x49/0x63
dump_stack+0x10/0x16
check_preemption_disabled+0xdd/0xe0
debug_smp_processor_id+0x17/0x20
powerclamp_set_cur_state+0x7f/0xf9 [intel_powerclamp]
...
...

Here CPU 0 is the control CPU by default and changed to the current CPU,
if CPU 0 offlined. This check has to be performed under cpus_read_lock(),
hence the above warning.

Use get_cpu() instead of smp_processor_id() to avoid this BUG.

Suggested-by: Chen Yu &lt;yu.c.chen@intel.com&gt;
Signed-off-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
[ rjw: Subject edits ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>thermal/drivers/qcom/tsens-v0_1: Fix MSM8939 fourth sensor hw_id</title>
<updated>2022-10-24T07:58:07Z</updated>
<author>
<name>Vincent Knecht</name>
<email>vincent.knecht@mailoo.org</email>
</author>
<published>2022-08-11T10:50:14Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=57bf2897692b12cc89551cc5d656d240a1def18e'/>
<id>urn:sha1:57bf2897692b12cc89551cc5d656d240a1def18e</id>
<content type='text'>
[ Upstream commit b0c883e900702f408d62cf92b0ef01303ed69be9 ]

Reading temperature from this sensor fails with 'Invalid argument'.

Looking at old vendor dts [1], its hw_id should be 3 instead of 4.
Change this hw_id accordingly.

[1] https://github.com/msm8916-mainline/android_kernel_qcom_msm8916/blob/master/arch/arm/boot/dts/qcom/msm8939-common.dtsi#L511

Fixes: 332bc8ebab2c ("thermal: qcom: tsens-v0_1: Add support for MSM8939")
Signed-off-by: Vincent Knecht &lt;vincent.knecht@mailoo.org&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Reviewed-by: Bjorn Andersson &lt;andersson@kernel.org&gt;
Reviewed-by: Bryan O'Donoghue &lt;bryan.odonoghue@linaro.org&gt;
Link: https://lore.kernel.org/r/20220811105014.7194-1-vincent.knecht@mailoo.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: cpufreq_cooling: Check the policy first in cpufreq_cooling_register()</title>
<updated>2022-10-24T07:57:01Z</updated>
<author>
<name>Xuewen Yan</name>
<email>xuewen.yan@unisoc.com</email>
</author>
<published>2022-08-25T11:40:17Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7750f52ce090eb27db1c8aefcfce1bef9f6256ab'/>
<id>urn:sha1:7750f52ce090eb27db1c8aefcfce1bef9f6256ab</id>
<content type='text'>
[ Upstream commit cff895277c8558221ba180aefe26799dcb4eec86 ]

Since the policy needs to be accessed first when obtaining cpu devices,
first check whether the policy is legal before this.

Fixes: 5130802ddbb1 ("thermal: cpu_cooling: Switch to QoS requests for freq limits")
Signed-off-by: Xuewen Yan &lt;xuewen.yan@unisoc.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>thermal/int340x_thermal: handle data_vault when the value is ZERO_SIZE_PTR</title>
<updated>2022-09-15T08:47:09Z</updated>
<author>
<name>Lee, Chun-Yi</name>
<email>joeyli.kernel@gmail.com</email>
</author>
<published>2022-08-08T13:21:58Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=dae42083b045a4ddf71c57cf350cb2412b5915c2'/>
<id>urn:sha1:dae42083b045a4ddf71c57cf350cb2412b5915c2</id>
<content type='text'>
[ Upstream commit 7931e28098a4c1a2a6802510b0cbe57546d2049d ]

In some case, the GDDV returns a package with a buffer which has
zero length. It causes that kmemdup() returns ZERO_SIZE_PTR (0x10).

Then the data_vault_read() got NULL point dereference problem when
accessing the 0x10 value in data_vault.

[   71.024560] BUG: kernel NULL pointer dereference, address:
0000000000000010

This patch uses ZERO_OR_NULL_PTR() for checking ZERO_SIZE_PTR or
NULL value in data_vault.

Signed-off-by: "Lee, Chun-Yi" &lt;jlee@suse.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>PM: EM: convert power field to micro-Watts precision and align drivers</title>
<updated>2022-08-17T13:14:05Z</updated>
<author>
<name>Lukasz Luba</name>
<email>lukasz.luba@arm.com</email>
</author>
<published>2022-07-07T07:15:52Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=bfd4c6710d22c939bebc2f34e897e919a9f01ad5'/>
<id>urn:sha1:bfd4c6710d22c939bebc2f34e897e919a9f01ad5</id>
<content type='text'>
[ Upstream commit ae6ccaa650380d243cf43d31c864c5ced2fd4612 ]

The milli-Watts precision causes rounding errors while calculating
efficiency cost for each OPP. This is especially visible in the 'simple'
Energy Model (EM), where the power for each OPP is provided from OPP
framework. This can cause some OPPs to be marked inefficient, while
using micro-Watts precision that might not happen.

Update all EM users which access 'power' field and assume the value is
in milli-Watts.

Solve also an issue with potential overflow in calculation of energy
estimation on 32bit machine. It's needed now since the power value
(thus the 'cost' as well) are higher.

Example calculation which shows the rounding error and impact:

power = 'dyn-power-coeff' * volt_mV * volt_mV * freq_MHz

power_a_uW = (100 * 600mW * 600mW * 500MHz) / 10^6 = 18000
power_a_mW = (100 * 600mW * 600mW * 500MHz) / 10^9 = 18

power_b_uW = (100 * 605mW * 605mW * 600MHz) / 10^6 = 21961
power_b_mW = (100 * 605mW * 605mW * 600MHz) / 10^9 = 21

max_freq = 2000MHz

cost_a_mW = 18 * 2000MHz/500MHz = 72
cost_a_uW = 18000 * 2000MHz/500MHz = 72000

cost_b_mW = 21 * 2000MHz/600MHz = 70 // &lt;- artificially better
cost_b_uW = 21961 * 2000MHz/600MHz = 73203

The 'cost_b_mW' (which is based on old milli-Watts) is misleadingly
better that the 'cost_b_uW' (this patch uses micro-Watts) and such
would have impact on the 'inefficient OPPs' information in the Cpufreq
framework. This patch set removes the rounding issue.

Signed-off-by: Lukasz Luba &lt;lukasz.luba@arm.com&gt;
Acked-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>thermal: sysfs: Fix cooling_device_stats_setup() error code path</title>
<updated>2022-08-17T13:13:47Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2022-07-29T15:39:07Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ff58bd0db5cc0baca2442d18f45699293919abd0'/>
<id>urn:sha1:ff58bd0db5cc0baca2442d18f45699293919abd0</id>
<content type='text'>
commit d5a8aa5d7d80d21ab6b266f1bed4194b61746199 upstream.

If cooling_device_stats_setup() fails to create the stats object, it
must clear the last slot in cooling_device_attr_groups that was
initially empty (so as to make it possible to add stats attributes to
the cooling device attribute groups).

Failing to do so may cause the stats attributes to be created by
mistake for a device that doesn't have a stats object, because the
slot in question might be populated previously during the registration
of another cooling device.

Fixes: 8ea229511e06 ("thermal: Add cooling device's statistics in sysfs")
Reported-by: Di Shen &lt;di.shen@unisoc.com&gt;
Tested-by: Di Shen &lt;di.shen@unisoc.com&gt;
Cc: 4.17+ &lt;stable@vger.kernel.org&gt; # 4.17+
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'thermal-5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm</title>
<updated>2022-07-01T20:00:47Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2022-07-01T20:00:47Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1ce8c443e95698cecc32cc8ed5ff4b72da61eed4'/>
<id>urn:sha1:1ce8c443e95698cecc32cc8ed5ff4b72da61eed4</id>
<content type='text'>
Pull thermal control fix from Rafael Wysocki:
 "Add a new CPU ID to the list of supported processors in the
  intel_tcc_cooling driver (Sumeet Pawnikar)"

* tag 'thermal-5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  thermal: intel_tcc_cooling: Add TCC cooling support for RaptorLake
</content>
</entry>
<entry>
<title>thermal: intel_tcc_cooling: Add TCC cooling support for RaptorLake</title>
<updated>2022-06-30T17:48:44Z</updated>
<author>
<name>Sumeet Pawnikar</name>
<email>sumeet.r.pawnikar@intel.com</email>
</author>
<published>2022-05-06T13:50:09Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=62f46fc7b8c639bc97cc9c69e063c40970b6e14c'/>
<id>urn:sha1:62f46fc7b8c639bc97cc9c69e063c40970b6e14c</id>
<content type='text'>
Add RaptorLake to the list of processor models supported by the Intel
TCC cooling driver.

Signed-off-by: Sumeet Pawnikar &lt;sumeet.r.pawnikar@intel.com&gt;
[ rjw: Subject edits, new changelog ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'thermal-5.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm</title>
<updated>2022-05-30T18:34:13Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2022-05-30T18:34:13Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=32665a9e5432fd88fe20f4affa8986833bbbabe7'/>
<id>urn:sha1:32665a9e5432fd88fe20f4affa8986833bbbabe7</id>
<content type='text'>
Pull additional thermal control update from Rafael Wysocki:
 "Add Meteor Lake PCI device ID to the int340x thermal control driver
  (Sumeet Pawnikar)"

* tag 'thermal-5.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  thermal: int340x: Add Meteor Lake PCI device ID
</content>
</entry>
<entry>
<title>thermal: int340x: Add Meteor Lake PCI device ID</title>
<updated>2022-05-25T13:44:58Z</updated>
<author>
<name>Sumeet Pawnikar</name>
<email>sumeet.r.pawnikar@intel.com</email>
</author>
<published>2022-05-23T17:48:52Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3c1d004bdb4e12b4b1dfbdd6a9167ea5003e48cd'/>
<id>urn:sha1:3c1d004bdb4e12b4b1dfbdd6a9167ea5003e48cd</id>
<content type='text'>
Add Meteor Lake PCI ID for processor thermal device.

Signed-off-by: Sumeet Pawnikar &lt;sumeet.r.pawnikar@intel.com&gt;
Reviewed-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
</feed>
