Merge tag 'thermal-6.4-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 5 May 2023 19:05:00 +0000 (12:05 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 5 May 2023 19:05:00 +0000 (12:05 -0700)
Pull thermal control fixes from Rafael Wysocki:
 "These fix a NULL pointer dereference in the Intel powerclamp driver
  introduced during the 6.3 cycle and update MAINTAINERS to match recent
  code changes.

  Specifics:

   - Fix NULL pointer access in the Intel powerclamp thermal driver that
     occurs on attempts to set the cooling device state to 0 in the
     default configuration (Srinivas Pandruvada)

   - Drop the stale MAINTAINERS entry for the Intel Menlow thermal
     driver that has been removed recently (Lukas Bulwahn)"

* tag 'thermal-6.4-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  MAINTAINERS: remove section INTEL MENLOW THERMAL DRIVER
  thermal: intel: powerclamp: Fix NULL pointer access issue

MAINTAINERS
drivers/thermal/intel/intel_powerclamp.c

index e5c3101161d1e00a73f7e56f2f3d5b12303818a0..4accfb9f0865490c62bedf9262ac68ad73fb2600 100644 (file)
@@ -10556,12 +10556,6 @@ F:     drivers/hwmon/intel-m10-bmc-hwmon.c
 F:     drivers/mfd/intel-m10-bmc*
 F:     include/linux/mfd/intel-m10-bmc.h
 
-INTEL MENLOW THERMAL DRIVER
-M:     Sujith Thomas <sujith.thomas@intel.com>
-L:     linux-pm@vger.kernel.org
-S:     Supported
-F:     drivers/thermal/intel/intel_menlow.c
-
 INTEL P-Unit IPC DRIVER
 M:     Zha Qipeng <qipeng.zha@intel.com>
 L:     platform-driver-x86@vger.kernel.org
index 91fc7e239497165d6cf5a91eed20f8810d9c4903..36243a3972fd7f6dec640c67ab3b0c8154c14712 100644 (file)
@@ -703,6 +703,10 @@ static int powerclamp_set_cur_state(struct thermal_cooling_device *cdev,
 
        new_target_ratio = clamp(new_target_ratio, 0UL,
                                (unsigned long) (max_idle - 1));
+
+       if (powerclamp_data.target_ratio == new_target_ratio)
+               goto exit_set;
+
        if (!powerclamp_data.target_ratio && new_target_ratio > 0) {
                pr_info("Start idle injection to reduce power\n");
                powerclamp_data.target_ratio = new_target_ratio;