Merge tag 'thermal-v5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/therma...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 10 Jul 2021 18:43:25 +0000 (11:43 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 10 Jul 2021 18:43:25 +0000 (11:43 -0700)
Pull thermal updates from Daniel Lezcano:

 - Add rk3568 sensor support (Finley Xiao)

 - Add missing MODULE_DEVICE_TABLE for the Spreadtrum sensor (Chunyan
   Zhang)

 - Export additionnal attributes for the int340x thermal processor
   (Srinivas Pandruvada)

 - Add SC7280 compatible for the tsens driver (Rajeshwari Ravindra
   Kamble)

 - Fix kernel documentation for thermal_zone_device_unregister() and use
   devm_platform_get_and_ioremap_resource() (Yang Yingliang)

 - Fix coefficient calculations for the rcar_gen3 sensor driver (Niklas
   Söderlund)

 - Fix shadowing variable rcar_gen3_ths_tj_1 (Geert Uytterhoeven)

 - Add missing of_node_put() for the iMX and Spreadtrum sensors
   (Krzysztof Kozlowski)

 - Add tegra3 thermal sensor DT bindings (Dmitry Osipenko)

 - Stop the thermal zone monitoring when unregistering it to prevent a
   temperature update without the 'get_temp' callback (Dmitry Osipenko)

 - Add rk3568 DT bindings, convert bindings to yaml schemas and add the
   corresponding compatible in the Rockchip sensor (Ezequiel Garcia)

 - Add the sc8180x compatible for the Qualcomm tsensor (Bjorn Andersson)

 - Use the find_first_zero_bit() function instead of custom code (Andy
   Shevchenko)

 - Fix the kernel doc for the device cooling device (Yang Li)

 - Reorg the processor thermal int340x to set the scene for the PCI mmio
   driver (Srinivas Pandruvada)

 - Add PCI MMIO driver for the int340x processor thermal driver
   (Srinivas Pandruvada)

 - Add hwmon sensors for the mediatek sensor (Frank Wunderlich)

 - Fix warning for return value reported by Smatch for the int340x
   thermal processor (Srinivas Pandruvada)

 - Fix wrong register access and decoding for the int340x thermal
   processor (Srinivas Pandruvada)

* tag 'thermal-v5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: (23 commits)
  thermal/drivers/int340x/processor_thermal: Fix tcc setting
  thermal/drivers/int340x/processor_thermal: Fix warning for return value
  thermal/drivers/mediatek: Add sensors-support
  thermal/drivers/int340x/processor_thermal: Add PCI MMIO based thermal driver
  thermal/drivers/int340x/processor_thermal: Split enumeration and processing part
  thermal: devfreq_cooling: Fix kernel-doc
  thermal/drivers/intel/intel_soc_dts_iosf: Switch to use find_first_zero_bit()
  dt-bindings: thermal: tsens: Add sc8180x compatible
  dt-bindings: rockchip-thermal: Support the RK3568 SoC compatible
  dt-bindings: thermal: convert rockchip-thermal to json-schema
  thermal/core/thermal_of: Stop zone device before unregistering it
  dt-bindings: thermal: Add binding for Tegra30 thermal sensor
  thermal/drivers/sprd: Add missing of_node_put for loop iteration
  thermal/drivers/imx_sc: Add missing of_node_put for loop iteration
  thermal/drivers/rcar_gen3_thermal: Do not shadow rcar_gen3_ths_tj_1
  thermal/drivers/rcar_gen3_thermal: Fix coefficient calculations
  thermal/drivers/st: Use devm_platform_get_and_ioremap_resource()
  thermal/core: Correct function name thermal_zone_device_unregister()
  dt-bindings: thermal: tsens: Add compatible string to TSENS binding for SC7280
  thermal/drivers/int340x: processor_thermal: Export additional attributes
  ...

1  2 
Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
drivers/thermal/thermal_core.c

@@@ -46,6 -46,8 +46,8 @@@ properties
                - qcom,msm8996-tsens
                - qcom,msm8998-tsens
                - qcom,sc7180-tsens
+               - qcom,sc7280-tsens
+               - qcom,sc8180x-tsens
                - qcom,sdm845-tsens
                - qcom,sm8150-tsens
                - qcom,sm8250-tsens
@@@ -77,6 -79,7 +79,6 @@@
  
    nvmem-cell-names:
      minItems: 1
 -    maxItems: 2
      items:
        - const: calib
        - enum:
@@@ -36,8 -36,10 +36,8 @@@ static LIST_HEAD(thermal_governor_list)
  
  static DEFINE_MUTEX(thermal_list_lock);
  static DEFINE_MUTEX(thermal_governor_lock);
 -static DEFINE_MUTEX(poweroff_lock);
  
  static atomic_t in_suspend;
 -static bool power_off_triggered;
  
  static struct thermal_governor *def_governor;
  
@@@ -325,18 -327,70 +325,18 @@@ static void handle_non_critical_trips(s
                       def_governor->throttle(tz, trip);
  }
  
 -/**
 - * thermal_emergency_poweroff_func - emergency poweroff work after a known delay
 - * @work: work_struct associated with the emergency poweroff function
 - *
 - * This function is called in very critical situations to force
 - * a kernel poweroff after a configurable timeout value.
 - */
 -static void thermal_emergency_poweroff_func(struct work_struct *work)
 -{
 -      /*
 -       * We have reached here after the emergency thermal shutdown
 -       * Waiting period has expired. This means orderly_poweroff has
 -       * not been able to shut off the system for some reason.
 -       * Try to shut down the system immediately using kernel_power_off
 -       * if populated
 -       */
 -      WARN(1, "Attempting kernel_power_off: Temperature too high\n");
 -      kernel_power_off();
 -
 -      /*
 -       * Worst of the worst case trigger emergency restart
 -       */
 -      WARN(1, "Attempting emergency_restart: Temperature too high\n");
 -      emergency_restart();
 -}
 -
 -static DECLARE_DELAYED_WORK(thermal_emergency_poweroff_work,
 -                          thermal_emergency_poweroff_func);
 -
 -/**
 - * thermal_emergency_poweroff - Trigger an emergency system poweroff
 - *
 - * This may be called from any critical situation to trigger a system shutdown
 - * after a known period of time. By default this is not scheduled.
 - */
 -static void thermal_emergency_poweroff(void)
 +void thermal_zone_device_critical(struct thermal_zone_device *tz)
  {
 -      int poweroff_delay_ms = CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS;
        /*
         * poweroff_delay_ms must be a carefully profiled positive value.
 -       * Its a must for thermal_emergency_poweroff_work to be scheduled
 +       * Its a must for forced_emergency_poweroff_work to be scheduled.
         */
 -      if (poweroff_delay_ms <= 0)
 -              return;
 -      schedule_delayed_work(&thermal_emergency_poweroff_work,
 -                            msecs_to_jiffies(poweroff_delay_ms));
 -}
 +      int poweroff_delay_ms = CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS;
  
 -void thermal_zone_device_critical(struct thermal_zone_device *tz)
 -{
        dev_emerg(&tz->device, "%s: critical temperature reached, "
                  "shutting down\n", tz->type);
  
 -      mutex_lock(&poweroff_lock);
 -      if (!power_off_triggered) {
 -              /*
 -               * Queue a backup emergency shutdown in the event of
 -               * orderly_poweroff failure
 -               */
 -              thermal_emergency_poweroff();
 -              orderly_poweroff(true);
 -              power_off_triggered = true;
 -      }
 -      mutex_unlock(&poweroff_lock);
 +      hw_protection_shutdown("Temperature too high", poweroff_delay_ms);
  }
  EXPORT_SYMBOL(thermal_zone_device_critical);
  
@@@ -1315,7 -1369,7 +1315,7 @@@ free_tz
  EXPORT_SYMBOL_GPL(thermal_zone_device_register);
  
  /**
-  * thermal_device_unregister - removes the registered thermal zone device
+  * thermal_zone_device_unregister - removes the registered thermal zone device
   * @tz: the thermal zone device to remove
   */
  void thermal_zone_device_unregister(struct thermal_zone_device *tz)
@@@ -1484,6 -1538,7 +1484,6 @@@ error
        ida_destroy(&thermal_cdev_ida);
        mutex_destroy(&thermal_list_lock);
        mutex_destroy(&thermal_governor_lock);
 -      mutex_destroy(&poweroff_lock);
        return result;
  }
  postcore_initcall(thermal_init);