Skip to content

Commit

Permalink
Merge tag 'thermal-6.6-rc1' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/rafael/linux-pm

Pull thermal control updates from Rafael Wysocki:
 "These rework the Intel DTS IOSF and the ACPI thermal drivers to pass
  tables of generic trip point structures to the core during
  initialization and make some requisite modifications in the thermal
  core, fix a few issues elsewhere and clean up code.

  This includes changes that are present in the ACPI updates too,
  because they involve both ACPI and the thermal core. The list of
  specific changes below is limited to thermal control, however.

  Specifics:

   - Make the ACPI thermal driver use its own Notify() handler (Michal
     Wilczynski)

   - Rework the ACPI thermal driver to use a table of generic trip point
     structures on top of the internal representation of trip points and
     remove thermal zone callbacks that are not necessary any more from
     that driver (Rafael Wysocki)

   - Fix a few issues in the Intel DTS IOSF thermal driver, clean up
     code in it and make it pass tables of generic trip point structures
     to the core during thermal zone registration (Rafael Wysocki)

   - Drop a redundant check from the Intel DTS IOSF thermal driver's
     "remove" routine (Zhang Rui)

   - Use module_platform_driver() to replace an open-coded counterpart
     of it in the int340x thermal driver (Yang Yingliang)

   - Fix possible uninitialized value access in __thermal_of_bind() and
     __thermal_of_unbind() (Peng Fan)

   - Make the int3400 driver use thermal zone device wrappers (Daniel
     Lezcano)

   - Remove redundant thermal zone state check from the int340x thermal
     driver (Daniel Lezcano)

   - Drop non-functional nocrt parameter from ACPI thermal (Mario
     Limonciello)

   - Explicitly include correct DT includes in the thermal core and
     drivers (Rob Herring)"

* tag 'thermal-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  thermal: intel: intel_soc_dts_iosf: Remove redundant check
  thermal: intel: int340x: simplify the code with module_platform_driver()
  thermal/of: Fix potential uninitialized value access
  thermal: intel: intel_soc_dts_iosf: Use struct thermal_trip
  thermal: intel: intel_soc_dts_iosf: Rework critical trip setup
  thermal: intel: intel_soc_dts_iosf: Add helper for resetting trip points
  thermal: intel: intel_soc_dts_iosf: Change initialization ordering
  thermal: intel: intel_soc_dts_iosf: Pass sensors to update_trip_temp()
  thermal: intel: intel_soc_dts_iosf: Untangle update_trip_temp()
  thermal: intel: intel_soc_dts_iosf: Always assume notification support
  thermal: intel: intel_soc_dts_iosf: Drop redundant symbol definition
  thermal: intel: intel_soc_dts_iosf: Always use 2 trips
  thermal: Explicitly include correct DT includes
  thermal/drivers/int340x: Do not check the thermal zone state
  thermal/drivers/int3400: Use thermal zone device wrappers
  • Loading branch information
Linus Torvalds committed Aug 29, 2023
2 parents ccc5e98 + d081228 commit 3653478
Show file tree
Hide file tree
Showing 29 changed files with 123 additions and 205 deletions.
2 changes: 0 additions & 2 deletions drivers/thermal/amlogic_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/thermal.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/thermal/broadcom/bcm2711_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include <linux/kernel.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/of_device.h>
#include <linux/regmap.h>
#include <linux/thermal.h>

Expand Down
2 changes: 1 addition & 1 deletion drivers/thermal/broadcom/brcmstb_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/of_device.h>
#include <linux/thermal.h>

#define AVS_TMON_STATUS 0x00
Expand Down
2 changes: 1 addition & 1 deletion drivers/thermal/hisi_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/of_device.h>
#include <linux/thermal.h>

#define HI6220_TEMP0_LAG (0x0)
Expand Down
1 change: 0 additions & 1 deletion drivers/thermal/imx8mm_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <linux/module.h>
#include <linux/nvmem-consumer.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/thermal.h>
Expand Down
1 change: 0 additions & 1 deletion drivers/thermal/imx_sc_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <linux/firmware/imx/sci.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/thermal.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/thermal/imx_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/thermal.h>
#include <linux/nvmem-consumer.h>
Expand Down
44 changes: 22 additions & 22 deletions drivers/thermal/intel/int340x_thermal/int3400_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define INT3400_THERMAL_TABLE_CHANGED 0x83
#define INT3400_ODVP_CHANGED 0x88
#define INT3400_KEEP_ALIVE 0xA0
#define INT3400_FAKE_TEMP (20 * 1000) /* faked temp sensor with 20C */

enum int3400_thermal_uuid {
INT3400_THERMAL_ACTIVE = 0,
Expand Down Expand Up @@ -453,6 +454,7 @@ static void int3400_notify(acpi_handle handle,
void *data)
{
struct int3400_thermal_priv *priv = data;
struct device *dev;
char *thermal_prop[5];
int therm_event;

Expand All @@ -475,12 +477,14 @@ static void int3400_notify(acpi_handle handle,
return;
}

thermal_prop[0] = kasprintf(GFP_KERNEL, "NAME=%s", priv->thermal->type);
thermal_prop[1] = kasprintf(GFP_KERNEL, "TEMP=%d", priv->thermal->temperature);
dev = thermal_zone_device(priv->thermal);

thermal_prop[0] = kasprintf(GFP_KERNEL, "NAME=%s", thermal_zone_device_type(priv->thermal));
thermal_prop[1] = kasprintf(GFP_KERNEL, "TEMP=%d", INT3400_FAKE_TEMP);
thermal_prop[2] = kasprintf(GFP_KERNEL, "TRIP=");
thermal_prop[3] = kasprintf(GFP_KERNEL, "EVENT=%d", therm_event);
thermal_prop[4] = NULL;
kobject_uevent_env(&priv->thermal->device.kobj, KOBJ_CHANGE, thermal_prop);
kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, thermal_prop);
kfree(thermal_prop[0]);
kfree(thermal_prop[1]);
kfree(thermal_prop[2]);
Expand All @@ -490,7 +494,7 @@ static void int3400_notify(acpi_handle handle,
static int int3400_thermal_get_temp(struct thermal_zone_device *thermal,
int *temp)
{
*temp = 20 * 1000; /* faked temp sensor with 20C */
*temp = INT3400_FAKE_TEMP;
return 0;
}

Expand All @@ -499,32 +503,28 @@ static int int3400_thermal_change_mode(struct thermal_zone_device *thermal,
{
struct int3400_thermal_priv *priv = thermal_zone_device_priv(thermal);
int result = 0;
int enabled;

if (!priv)
return -EINVAL;

if (mode != thermal->mode) {
int enabled;

enabled = mode == THERMAL_DEVICE_ENABLED;
enabled = mode == THERMAL_DEVICE_ENABLED;

if (priv->os_uuid_mask) {
if (!enabled) {
priv->os_uuid_mask = 0;
result = set_os_uuid_mask(priv, priv->os_uuid_mask);
}
goto eval_odvp;
if (priv->os_uuid_mask) {
if (!enabled) {
priv->os_uuid_mask = 0;
result = set_os_uuid_mask(priv, priv->os_uuid_mask);
}

if (priv->current_uuid_index < 0 ||
priv->current_uuid_index >= INT3400_THERMAL_MAXIMUM_UUID)
return -EINVAL;

result = int3400_thermal_run_osc(priv->adev->handle,
int3400_thermal_uuids[priv->current_uuid_index],
&enabled);
goto eval_odvp;
}

if (priv->current_uuid_index < 0 ||
priv->current_uuid_index >= INT3400_THERMAL_MAXIMUM_UUID)
return -EINVAL;

result = int3400_thermal_run_osc(priv->adev->handle,
int3400_thermal_uuids[priv->current_uuid_index],
&enabled);
eval_odvp:
evaluate_odvp(priv);

Expand Down
13 changes: 1 addition & 12 deletions drivers/thermal/intel/int340x_thermal/int3401_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,7 @@ static struct platform_driver int3401_driver = {
},
};

static int __init proc_thermal_init(void)
{
return platform_driver_register(&int3401_driver);
}

static void __exit proc_thermal_exit(void)
{
platform_driver_unregister(&int3401_driver);
}

module_init(proc_thermal_init);
module_exit(proc_thermal_exit);
module_platform_driver(int3401_driver);

MODULE_AUTHOR("Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>");
MODULE_DESCRIPTION("Processor Thermal Reporting Device Driver");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static int proc_thermal_pci_probe(struct pci_dev *pdev,
* ACPI/MSR. So we don't want to fail for auxiliary DTSs.
*/
proc_priv->soc_dts = intel_soc_dts_iosf_init(
INTEL_SOC_DTS_INTERRUPT_MSI, 2, 0);
INTEL_SOC_DTS_INTERRUPT_MSI, false, 0);

if (!IS_ERR(proc_priv->soc_dts) && pdev->irq) {
ret = pci_enable_msi(pdev);
Expand Down
Loading

0 comments on commit 3653478

Please sign in to comment.