<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/thermal/intel, branch v6.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2023-10-23T18:06:58Z</updated>
<entry>
<title>Merge branch 'thermal-intel'</title>
<updated>2023-10-23T18:06:58Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2023-10-23T18:06:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8aa49284f3673879dcabfb116f7cac265b4cb0f5'/>
<id>urn:sha1:8aa49284f3673879dcabfb116f7cac265b4cb0f5</id>
<content type='text'>
Merge changes in Intel thermal control drivers for 6.7-rc1:

 - Add power floor notifications support to the int340x thermal control
   driver (Srinivas Pandruvada).

 - Rework updating trip points in the int340x thermal driver so that it
   does not access thermal zone internals directly (Rafael Wysocki).

 - Use param_get_byte() instead of param_get_int() as the max_idle module
   parameter .get() callback in the Intel powerclamp thermal driver to
   avoid possible out-of-bounds access (David Arcari).

 - Add workload hints support to the the int340x thermal driver (Srinivas
   Pandruvada).

* thermal-intel:
  selftests/thermel/intel: Add test to read power floor status
  thermal: int340x: processor_thermal: Enable power floor support
  thermal: int340x: processor_thermal: Handle power floor interrupts
  thermal: int340x: processor_thermal: Support power floor notifications
  thermal: int340x: processor_thermal: Set feature mask before proc_thermal_add
  thermal: int340x: processor_thermal: Common function to clear SOC interrupt
  thermal: int340x: processor_thermal: Move interrupt status MMIO offset to common header
  thermal: intel: powerclamp: fix mismatch in get function for max_idle
  thermal: int340x: Use thermal_zone_for_each_trip()
  thermal: int340x: processor_thermal: Ack all PCI interrupts
  thermal: int340x: Add ArrowLake-S PCI ID
  selftests/thermel/intel: Add test to read workload hint
  thermal: int340x: Handle workload hint interrupts
  thermal: int340x: processor_thermal: Add workload type hint interface
  thermal: int340x: Remove PROC_THERMAL_FEATURE_WLT_REQ for Meteor Lake
  thermal: int340x: processor_thermal: Use non MSI interrupts by default
  thermal: int340x: processor_thermal: Add interrupt configuration function
  thermal: int340x: processor_thermal: Move mailbox code to common module
</content>
</entry>
<entry>
<title>thermal: int340x: processor_thermal: Enable power floor support</title>
<updated>2023-10-12T19:09:48Z</updated>
<author>
<name>Srinivas Pandruvada</name>
<email>srinivas.pandruvada@linux.intel.com</email>
</author>
<published>2023-10-09T19:05:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0e509253924b5eed886029a3b49dcef9f6001c49'/>
<id>urn:sha1:0e509253924b5eed886029a3b49dcef9f6001c49</id>
<content type='text'>
Enable power floor feature support for Meteor Lake processors.

Signed-off-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>
<entry>
<title>thermal: int340x: processor_thermal: Handle power floor interrupts</title>
<updated>2023-10-12T19:09:48Z</updated>
<author>
<name>Srinivas Pandruvada</name>
<email>srinivas.pandruvada@linux.intel.com</email>
</author>
<published>2023-10-09T19:05:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8cd5ad18ddc3caab734c376eda5214f01eeb932c'/>
<id>urn:sha1:8cd5ad18ddc3caab734c376eda5214f01eeb932c</id>
<content type='text'>
On thermal device interrupt, if the interrupt is generated for passing
power floor status, call the callback to pass notification to the user
space.

First call proc_thermal_check_power_floor_intr() to check interrupt, if
this callback returns true, wake the IRQ thread to call
proc_thermal_power_floor_intr_callback() to notify user space.

Signed-off-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>
<entry>
<title>thermal: int340x: processor_thermal: Support power floor notifications</title>
<updated>2023-10-12T19:09:48Z</updated>
<author>
<name>Srinivas Pandruvada</name>
<email>srinivas.pandruvada@linux.intel.com</email>
</author>
<published>2023-10-09T19:05:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b473d6a9d68f5bc27c7e35f5c98172d5f2206039'/>
<id>urn:sha1:b473d6a9d68f5bc27c7e35f5c98172d5f2206039</id>
<content type='text'>
When the hardware reduces the power to the minimum possible, the power
floor is notified via an interrupt.

This can happen when user space requests a power limit via powercap RAPL
interface, which forces the system to enter to the lowest power. This
power floor indication can be used as a hint to resort to other methods
of reducing power than via RAPL power limit.

Before power floor status can be read or the firmware can trigger
notifications regarding it, it needs to be configured via a mailbox
command. The actual power floor status is read via bit 39 of MMIO
offset 0x5B18 of the processor thermal PCI device.

To show the current power floor status and get notification
on a sysfs attribute, add 2 new attributes to
/sys/bus/pci/devices/0000\:00\:04.0/power_limits/

power_floor_enable : This attribute is present when power floor
 notifications are supported. This attribute allows to enable/disable
 power floor notifications.

power_floor_status : This attribute is present when power floor
 notifications are supported. When enabled via power_floor_enable, this
 attribute shows the current power floor status.

The power floor implementation provides interfaces which are called
from the sysfs callbacks to enable/disable and read power floor
status. It also provides two additional interfaces to check if the
current processor thermal device interrupt is for power floor status
and to send notifications to user space.

Signed-off-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
[ rjw: Changelog and documentation changes edits ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>thermal: int340x: processor_thermal: Set feature mask before proc_thermal_add</title>
<updated>2023-10-12T19:09:48Z</updated>
<author>
<name>Srinivas Pandruvada</name>
<email>srinivas.pandruvada@linux.intel.com</email>
</author>
<published>2023-10-09T19:05:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6ebc25d8b053a208786295bab58abbb66b39c318'/>
<id>urn:sha1:6ebc25d8b053a208786295bab58abbb66b39c318</id>
<content type='text'>
The function proc_thermal_add() adds sysfs entries for power limits.

The feature mask of available features is not present at that time, so
it cannot be used by proc_thermal_add() to selectively create sysfs
attributes.

The feature mask is set by proc_thermal_mmio_add(), so modify the code
to call it before proc_thermal_add() so as to allow the latter to use
the feature mask.

There is no functional impact with this change.

Signed-off-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>thermal: int340x: processor_thermal: Common function to clear SOC interrupt</title>
<updated>2023-10-12T19:09:48Z</updated>
<author>
<name>Srinivas Pandruvada</name>
<email>srinivas.pandruvada@linux.intel.com</email>
</author>
<published>2023-10-09T19:05:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=088f16f35257becaed1c3deececda6080bc77ee3'/>
<id>urn:sha1:088f16f35257becaed1c3deececda6080bc77ee3</id>
<content type='text'>
The SOC interrupt status register contains multiple interrupt sources
(workload hint interrupt and power floor interrupt). It is not possible
to clear individual interrupt source with read-modify-write, as it may
clear the new interrupt from the firmware after a read operation. It is
also not possible to set the interrupt status bit to 1 for the other
interrupt source, which is not part of clearing.

Hence, create a common function, to clear all status bits at once.

Call this function after processing all interrupt sources.

Signed-off-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>thermal: int340x: processor_thermal: Move interrupt status MMIO offset to common header</title>
<updated>2023-10-12T19:09:48Z</updated>
<author>
<name>Srinivas Pandruvada</name>
<email>srinivas.pandruvada@linux.intel.com</email>
</author>
<published>2023-10-09T19:05:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=24e4c26202801f31392a04965b539e70223d9026'/>
<id>urn:sha1:24e4c26202801f31392a04965b539e70223d9026</id>
<content type='text'>
Move define SOC_WT_RES_INT_STATUS_OFFSET to processor_thermal_device.h.

This way it can be reused in other modules.

Signed-off-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>
<entry>
<title>thermal: intel: powerclamp: fix mismatch in get function for max_idle</title>
<updated>2023-10-05T18:18:03Z</updated>
<author>
<name>David Arcari</name>
<email>darcari@redhat.com</email>
</author>
<published>2023-10-05T11:17:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fae633cfb729da2771b5433f6b84ae7e8b4aa5f7'/>
<id>urn:sha1:fae633cfb729da2771b5433f6b84ae7e8b4aa5f7</id>
<content type='text'>
KASAN reported this

      [ 444.853098] BUG: KASAN: global-out-of-bounds in param_get_int+0x77/0x90
      [ 444.853111] Read of size 4 at addr ffffffffc16c9220 by task cat/2105
      ...
      [ 444.853442] The buggy address belongs to the variable:
      [ 444.853443] max_idle+0x0/0xffffffffffffcde0 [intel_powerclamp]

There is a mismatch between the param_get_int and the definition of
max_idle.  Replacing param_get_int with param_get_byte resolves this
issue.

Fixes: ebf519710218 ("thermal: intel: powerclamp: Add two module parameters")
Cc: 6.3+ &lt;stable@vger.kernel.org&gt; # 6.3+
Signed-off-by: David Arcari &lt;darcari@redhat.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>
<entry>
<title>thermal: int340x: Use thermal_zone_for_each_trip()</title>
<updated>2023-10-05T11:31:15Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2023-10-03T13:26:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cd3c00e7760905270541981f4c5d1e31f38c2e47'/>
<id>urn:sha1:cd3c00e7760905270541981f4c5d1e31f38c2e47</id>
<content type='text'>
Modify int340x_thermal_update_trips() to use thermal_zone_for_each_trip()
for walking trips instead of using the trips[] table passed to the
thermal zone registration function.

For this purpose, store active trip point indices in the priv fieids of
the corresponding thermal_trip structures.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
</content>
</entry>
<entry>
<title>thermal: int3406: 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:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a876f99d120dd81ff1e195260901f4a68fc4b498'/>
<id>urn:sha1:a876f99d120dd81ff1e195260901f4a68fc4b498</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>
</feed>
