1. 11 Mar, 2024 14 commits
  2. 07 Mar, 2024 1 commit
    • Rafael J. Wysocki's avatar
      Merge branches 'thermal-core' and 'thermal-intel' · dcb497ec
      Rafael J. Wysocki authored
      Merge thermal core changes and Intel thermal drivers changes for
      6.9-rc1:
      
       - Store zone trips table and zone operations directly in struct
         thermal_zone_device (Rafael Wysocki).
      
       - Rework writable trip points handling (Rafael Wysocki).
      
       - Thermal core code cleanups (Dan Carpenter, Flavio Suligoi).
      
       - Use thermal zone accessor functions in the int340x Intel thermal
         driver (Rafael Wysocki).
      
       - Add Lunar Lake-M PCI ID to the int340x Intel thermal driver (Srinivas
         Pandruvada).
      
      * thermal-core:
        thermal: core: remove unnecessary check in trip_point_hyst_store()
        thermal: core: Remove excess empty line from a comment
        thermal: core: Eliminate writable trip points masks
        thermal: of: Set THERMAL_TRIP_FLAG_RW_TEMP directly
        thermal: imx: Set THERMAL_TRIP_FLAG_RW_TEMP directly
        wifi: iwlwifi: mvm: Set THERMAL_TRIP_FLAG_RW_TEMP directly
        mlxsw: core_thermal: Set THERMAL_TRIP_FLAG_RW_TEMP directly
        thermal: intel: Set THERMAL_TRIP_FLAG_RW_TEMP directly
        thermal: core: Drop the .set_trip_hyst() thermal zone operation
        thermal: core: Add flags to struct thermal_trip
        thermal: core: Move initial num_trips assignment before memcpy()
        thermal: Get rid of CONFIG_THERMAL_WRITABLE_TRIPS
        thermal: intel: Adjust ops handling during thermal zone registration
        thermal: ACPI: Constify acpi_thermal_zone_ops
        thermal: core: Store zone ops in struct thermal_zone_device
        thermal: intel: Discard trip tables after zone registration
        thermal: ACPI: Discard trips table after zone registration
        thermal: core: Store zone trips table in struct thermal_zone_device
      
      * thermal-intel:
        thermal: intel: int340x_thermal: Use thermal zone accessor functions
        thermal: int340x: processor_thermal: Add Lunar Lake-M PCI ID
      dcb497ec
  3. 06 Mar, 2024 1 commit
  4. 05 Mar, 2024 3 commits
  5. 28 Feb, 2024 1 commit
  6. 27 Feb, 2024 9 commits
  7. 23 Feb, 2024 8 commits
    • Rafael J. Wysocki's avatar
      thermal: Get rid of CONFIG_THERMAL_WRITABLE_TRIPS · a85739c8
      Rafael J. Wysocki authored
      The only difference made by CONFIG_THERMAL_WRITABLE_TRIPS is whether or
      not the writable trips mask passed during thermal zone registration
      will take any effect, but whoever passes a non-zero writable trips mask
      to thermal_zone_device_register_with_trips() can be forgiven thinking
      that it will always work.
      
      Moreover, some thermal drivers expect user space to set trip temperature
      values, so they select CONFIG_THERMAL_WRITABLE_TRIPS, possibly overriding
      a manual choice to unset it and going against the design purportedly
      allowing system integrators to decide on the writability of trip points
      for the given kernel build.  It is also set in one platform's defconfig.
      
      Forthermore, CONFIG_THERMAL_WRITABLE_TRIPS only affects trip temperature,
      because trip hysteresis is writable as long as the thermal zone provides
      a callback to update it, regardless of the CONFIG_THERMAL_WRITABLE_TRIPS
      value.
      
      The above means that the symbol in question is used inconsistently and
      its purpose is at least moot, so remove it and always take the writable
      trip mask passed to thermal_zone_device_register_with_trips() into
      account.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      a85739c8
    • Rafael J. Wysocki's avatar
      thermal: intel: Adjust ops handling during thermal zone registration · 62dd1784
      Rafael J. Wysocki authored
      Because thermal zone operations are now stored directly in struct
      thermal_zone_device, thermal zone creators can discard the operations
      structure after the zone registration is complete, or it can be made
      read-only.
      
      Accordingly, make int340x_thermal_zone_add() use a local variable to
      represent thermal zone operations, so it is freed automatically upon the
      function exit, and make the other Intel thermal drivers use const zone
      operations structures.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: default avatarStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
      Reviewed-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      62dd1784
    • Rafael J. Wysocki's avatar
      thermal: ACPI: Constify acpi_thermal_zone_ops · 75fb8714
      Rafael J. Wysocki authored
      Because thermal zone operations are now stored directly in struct
      thermal_zone_device, acpi_thermal_zone_ops need not be modified by
      the thermal core and so it can be const.
      
      Adjust the code accordingly.
      
      No functional impact.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      75fb8714
    • Rafael J. Wysocki's avatar
      thermal: core: Store zone ops in struct thermal_zone_device · 698a1eb1
      Rafael J. Wysocki authored
      The current code requires thermal zone creators to pass pointers to
      writable ops structures to thermal_zone_device_register_with_trips()
      which needs to modify the target struct thermal_zone_device_ops object
      if the "critical" operation in it is NULL.
      
      Moreover, the callers of thermal_zone_device_register_with_trips() are
      required to hold on to the struct thermal_zone_device_ops object passed
      to it until the given thermal zone is unregistered.
      
      Both of these requirements are quite inconvenient, so modify struct
      thermal_zone_device to contain struct thermal_zone_device_ops as field and
      make thermal_zone_device_register_with_trips() copy the contents of the
      struct thermal_zone_device_ops passed to it via a pointer (which can be
      const now) to that field.
      
      Also adjust the code using thermal zone ops accordingly and modify
      thermal_of_zone_register() to use a local ops variable during
      thermal zone registration so ops do not need to be freed in
      thermal_of_zone_unregister() any more.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: default avatarStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
      Reviewed-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      698a1eb1
    • Rafael J. Wysocki's avatar
      thermal: intel: Discard trip tables after zone registration · fcbf8780
      Rafael J. Wysocki authored
      Because the thermal core creates and uses its own copy of the trips
      table passed to thermal_zone_device_register_with_trips(), it is not
      necessary to hold on to a local copy of it any more after the given
      thermal zone has been registered.
      
      Accordingly, modify Intel thermal drivers to discard the trips tables
      passed to thermal_zone_device_register_with_trips() after thermal zone
      registration, for example by storing them in local variables which are
      automatically discarded when the zone registration is complete.
      
      Also make some additional code simplifications unlocked by the above
      changes.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: default avatarStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
      Acked-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      fcbf8780
    • Rafael J. Wysocki's avatar
      thermal: ACPI: Discard trips table after zone registration · 9686f04a
      Rafael J. Wysocki authored
      Because the thermal core creates and uses its own copy of the trips
      table passed to thermal_zone_device_register_with_trips(), it is not
      necessary to hold on to a local copy of it any more after the given
      thermal zone has been registered.
      
      Accordingly, modify the ACPI thermal driver to store the trips table
      passed to thermal_zone_device_register_with_trips() in a local variable
      which is automatically discarded when acpi_thermal_add() returns to
      its caller.
      
      Also make some additional code simplifications unlocked by the above
      change.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: default avatarStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
      Acked-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      9686f04a
    • Rafael J. Wysocki's avatar
      thermal: core: Store zone trips table in struct thermal_zone_device · 9b0a6275
      Rafael J. Wysocki authored
      The current code expects thermal zone creators to pass a pointer to a
      writable trips table to thermal_zone_device_register_with_trips() and
      that trips table is then used by the thermal core going forward.
      
      Consequently, the callers of thermal_zone_device_register_with_trips()
      are required to hold on to the trips table passed to it until the given
      thermal zone is unregistered, at which point the trips table can be
      freed, but at the same time they are not expected to access that table
      directly.  This is both error prone and confusing.
      
      To address it, turn the trips table pointer in struct thermal_zone_device
      into a flex array (counted by its num_trips field), allocate it during
      thermal zone device allocation and copy the contents of the trips table
      supplied by the zone creator (which can be const now) into it, which
      will allow the callers of thermal_zone_device_register_with_trips() to
      drop their trip tables right after the zone registration.
      
      This requires the imx thermal driver to be adjusted to store the new
      temperature in its internal trips table in imx_set_trip_temp(), because
      it will be separate from the core's trips table now and it has to be
      explicitly kept in sync with the latter.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: default avatarStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
      Reviewed-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      9b0a6275
    • Rafael J. Wysocki's avatar
      Merge branch 'thermal-core' · 2c8459a5
      Rafael J. Wysocki authored
      Merge thermal core changes for 6.9:
      
       - Minor fixes for thermal governors (Rafael J. Wysocki, Di Shen).
      
       - Trip point handling fixes for the iwlwifi wireless driver (Rafael J.
         Wysocki).
      
       - Code cleanups (Rafael J. Wysocki, AngeloGioacchino Del Regno).
      
      * thermal-tmp:
        thermal: gov_power_allocator: Avoid overwriting PID coefficients from setup time
        thermal: sysfs: Fix up white space in trip_point_temp_store()
        iwlwifi: mvm: Use for_each_thermal_trip() for walking trip points
        iwlwifi: mvm: Populate trip table before registering thermal zone
        iwlwifi: mvm: Drop unused fw_trips_index[] from iwl_mvm_thermal_device
        thermal: core: Change governor name to const char pointer
        thermal: gov_bang_bang: Fix possible cooling device state ping-pong
        thermal: gov_fair_share: Fix dependency on trip points ordering
      2c8459a5
  8. 12 Feb, 2024 3 commits