]> Git Repo - linux.git/commitdiff
Merge tag 'thermal-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
authorLinus Torvalds <[email protected]>
Wed, 13 Mar 2024 19:03:57 +0000 (12:03 -0700)
committerLinus Torvalds <[email protected]>
Wed, 13 Mar 2024 19:03:57 +0000 (12:03 -0700)
Pull thermal control updates from Rafael Wysocki:
 "These mostly change the thermal core in a few ways allowing thermal
  drivers to be simplified, in particular in their removal and failing
  probe handling parts that are notoriously prone to errors, and
  propagate the changes to several drivers.

  Apart from that, support for a new platform is added (Intel Lunar
  Lake-M), some bugs are fixed and some code is cleaned up, as usual.

  Specifics:

   - Store zone trips table and zone operations directly in struct
     thermal_zone_device (Rafael Wysocki)

   - Fix up flex array initialization during thermal zone device
     registration (Nathan Chancellor)

   - Rework writable trip points handling in the thermal core and
     several drivers (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)

   - Minor fixes for thermal governors (Rafael Wysocki, Di Shen)

   - Trip point handling fixes for the iwlwifi wireless driver (Rafael
     Wysocki)

   - Code cleanups (Rafael J. Wysocki, AngeloGioacchino Del Regno)"

* tag 'thermal-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (29 commits)
  thermal: core: remove unnecessary check in trip_point_hyst_store()
  thermal: intel: int340x_thermal: Use thermal zone accessor functions
  thermal: core: Remove excess empty line from a comment
  thermal: int340x: processor_thermal: Add Lunar Lake-M PCI ID
  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
  ...

1  2 
arch/arm/configs/imx_v6_v7_defconfig
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
drivers/thermal/intel/x86_pkg_temp_thermal.c

index 92d649a817b3e1f3cc972eed5241acf38cc84309,ae20dc002dcaf0e8f9ffdef1909b1c2833ff1057..7327fce87808d3b335e510291597c9e36a467d25
@@@ -208,7 -208,6 +208,7 @@@ CONFIG_PINCTRL_IMX8MQ=
  CONFIG_GPIO_SYSFS=y
  CONFIG_GPIO_MXC=y
  CONFIG_GPIO_SIOX=m
 +CONFIG_GPIO_VF610=y
  CONFIG_GPIO_MAX732X=y
  CONFIG_GPIO_PCA953X=y
  CONFIG_GPIO_PCF857X=y
@@@ -229,7 -228,6 +229,6 @@@ CONFIG_SENSORS_IIO_HWMON=
  CONFIG_SENSORS_PWM_FAN=y
  CONFIG_SENSORS_SY7636A=y
  CONFIG_THERMAL_STATISTICS=y
- CONFIG_THERMAL_WRITABLE_TRIPS=y
  CONFIG_CPU_THERMAL=y
  CONFIG_IMX_THERMAL=y
  CONFIG_WATCHDOG=y
@@@ -298,7 -296,6 +297,7 @@@ CONFIG_FB_MODE_HELPERS=
  CONFIG_LCD_CLASS_DEVICE=y
  CONFIG_LCD_L4F00242T03=y
  CONFIG_LCD_PLATFORM=y
 +CONFIG_BACKLIGHT_CLASS_DEVICE=y
  CONFIG_BACKLIGHT_PWM=y
  CONFIG_BACKLIGHT_GPIO=y
  CONFIG_FRAMEBUFFER_CONSOLE=y
index a10b48947bcac274fd416f17d3485eced05ef2ce,a618824f0b658ed2b025ad84033f837ccbfa0dd2..44571114fb154b39ab0e3be14aa41543241a980e
@@@ -1,6 -1,6 +1,6 @@@
  /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
  /*
 - * Copyright (C) 2012-2014, 2018-2023 Intel Corporation
 + * Copyright (C) 2012-2014, 2018-2024 Intel Corporation
   * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
   * Copyright (C) 2016-2017 Intel Deutschland GmbH
   */
@@@ -40,9 -40,8 +40,9 @@@
  #define IWL_MVM_MAX_ADDRESSES         5
  /* RSSI offset for WkP */
  #define IWL_RSSI_OFFSET 50
 +#define IWL_MVM_MISSED_BEACONS_SINCE_RX_THOLD 4
  #define IWL_MVM_MISSED_BEACONS_THRESHOLD 8
 -#define IWL_MVM_MISSED_BEACONS_THRESHOLD_LONG 16
 +#define IWL_MVM_MISSED_BEACONS_THRESHOLD_LONG 19
  
  /* A TimeUnit is 1024 microsecond */
  #define MSEC_TO_TU(_msec)     (_msec*1000/1024)
@@@ -106,7 -105,6 +106,7 @@@ struct iwl_mvm_phy_ctxt 
        /* track for RLC config command */
        u32 center_freq1;
        bool rlc_disabled;
 +      u32 channel_load_by_us;
  };
  
  struct iwl_mvm_time_event_data {
         * if the te is in the time event list or not (when id == TE_MAX)
         */
        u32 id;
 -      u8 link_id;
 +      s8 link_id;
  };
  
   /* Power management */
@@@ -361,7 -359,6 +361,7 @@@ struct iwl_mvm_vif_link_info 
   * @pm_enabled - indicate if MAC power management is allowed
   * @monitor_active: indicates that monitor context is configured, and that the
   *    interface should get quota etc.
 + * @bt_coex_esr_disabled: indicates if esr is disabled due to bt coex
   * @low_latency: bit flags for low latency
   *    see enum &iwl_mvm_low_latency_cause for causes.
   * @low_latency_actual: boolean, indicates low latency is set,
@@@ -392,7 -389,6 +392,7 @@@ struct iwl_mvm_vif 
        bool pm_enabled;
        bool monitor_active;
        bool esr_active;
 +      bool bt_coex_esr_disabled;
  
        u8 low_latency: 6;
        u8 low_latency_actual: 1;
@@@ -541,14 -537,12 +541,12 @@@ struct iwl_mvm_tt_mgmt 
  
  #ifdef CONFIG_THERMAL
  /**
 - *struct iwl_mvm_thermal_device - thermal zone related data
 - * @temp_trips: temperature thresholds for report
 + * struct iwl_mvm_thermal_device - thermal zone related data
 + * @trips: temperature thresholds for report
-  * @fw_trips_index: keep indexes to original array - temp_trips
   * @tzone: thermal zone device data
  */
  struct iwl_mvm_thermal_device {
        struct thermal_trip trips[IWL_MAX_DTS_TRIPS];
-       u8 fw_trips_index[IWL_MAX_DTS_TRIPS];
        struct thermal_zone_device *tzone;
  };
  
@@@ -852,9 -846,6 +850,9 @@@ struct iwl_mvm 
        spinlock_t async_handlers_lock;
        struct work_struct async_handlers_wk;
  
 +      /* For async rx handlers that require the wiphy lock */
 +      struct wiphy_work async_handlers_wiphy_wk;
 +
        struct work_struct roc_done_wk;
  
        unsigned long init_status;
   * @IWL_MVM_STATUS_IN_HW_RESTART: HW restart is active
   * @IWL_MVM_STATUS_ROC_AUX_RUNNING: AUX remain-on-channel is running
   * @IWL_MVM_STATUS_FIRMWARE_RUNNING: firmware is running
 - * @IWL_MVM_STATUS_NEED_FLUSH_P2P: need to flush P2P bcast STA
   * @IWL_MVM_STATUS_IN_D3: in D3 (or at least about to go into it)
   * @IWL_MVM_STATUS_SUPPRESS_ERROR_LOG_ONCE: suppress one error log
   *    if this is set, when intentionally triggered
@@@ -1236,6 -1228,7 +1234,6 @@@ enum iwl_mvm_status 
        IWL_MVM_STATUS_IN_HW_RESTART,
        IWL_MVM_STATUS_ROC_AUX_RUNNING,
        IWL_MVM_STATUS_FIRMWARE_RUNNING,
 -      IWL_MVM_STATUS_NEED_FLUSH_P2P,
        IWL_MVM_STATUS_IN_D3,
        IWL_MVM_STATUS_SUPPRESS_ERROR_LOG_ONCE,
        IWL_MVM_STATUS_STARTING,
@@@ -1572,17 -1565,13 +1570,17 @@@ static inline int iwl_mvm_max_active_li
                                           struct ieee80211_vif *vif)
  {
        struct iwl_trans *trans = mvm->fwrt.trans;
 +      struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
 +
 +      lockdep_assert_held(&mvm->mutex);
  
        if (vif->type == NL80211_IFTYPE_AP)
                return mvm->fw->ucode_capa.num_beacons;
  
 -      if (iwl_mvm_is_esr_supported(trans) ||
 -          (CSR_HW_RFID_TYPE(trans->hw_rf_id) == IWL_CFG_RF_TYPE_FM &&
 -           CSR_HW_RFID_IS_CDB(trans->hw_rf_id)))
 +      if ((iwl_mvm_is_esr_supported(trans) &&
 +           !mvmvif->bt_coex_esr_disabled) ||
 +          ((CSR_HW_RFID_TYPE(trans->hw_rf_id) == IWL_CFG_RF_TYPE_FM &&
 +           CSR_HW_RFID_IS_CDB(trans->hw_rf_id))))
                return IWL_MVM_FW_MAX_ACTIVE_LINKS_NUM;
  
        return 1;
  
  extern const u8 iwl_mvm_ac_to_tx_fifo[];
  extern const u8 iwl_mvm_ac_to_gen2_tx_fifo[];
 +extern const u8 iwl_mvm_ac_to_bz_tx_fifo[];
  
  static inline u8 iwl_mvm_mac_ac_to_tx_fifo(struct iwl_mvm *mvm,
                                           enum ieee80211_ac_numbers ac)
  {
 -      return iwl_mvm_has_new_tx_api(mvm) ?
 -              iwl_mvm_ac_to_gen2_tx_fifo[ac] : iwl_mvm_ac_to_tx_fifo[ac];
 +      if (mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_BZ)
 +              return iwl_mvm_ac_to_bz_tx_fifo[ac];
 +      if (iwl_mvm_has_new_tx_api(mvm))
 +              return iwl_mvm_ac_to_gen2_tx_fifo[ac];
 +      return iwl_mvm_ac_to_tx_fifo[ac];
  }
  
  struct iwl_rate_info {
@@@ -1814,20 -1799,18 +1812,20 @@@ void iwl_mvm_rx_shared_mem_cfg_notif(st
  /* MVM PHY */
  struct iwl_mvm_phy_ctxt *iwl_mvm_get_free_phy_ctxt(struct iwl_mvm *mvm);
  int iwl_mvm_phy_ctxt_add(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt,
 -                       struct cfg80211_chan_def *chandef,
 +                       const struct cfg80211_chan_def *chandef,
 +                       const struct cfg80211_chan_def *ap,
                         u8 chains_static, u8 chains_dynamic);
  int iwl_mvm_phy_ctxt_changed(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt,
 -                           struct cfg80211_chan_def *chandef,
 +                           const struct cfg80211_chan_def *chandef,
 +                           const struct cfg80211_chan_def *ap,
                             u8 chains_static, u8 chains_dynamic);
  void iwl_mvm_phy_ctxt_ref(struct iwl_mvm *mvm,
                          struct iwl_mvm_phy_ctxt *ctxt);
  void iwl_mvm_phy_ctxt_unref(struct iwl_mvm *mvm,
                            struct iwl_mvm_phy_ctxt *ctxt);
  int iwl_mvm_phy_ctx_count(struct iwl_mvm *mvm);
 -u8 iwl_mvm_get_channel_width(struct cfg80211_chan_def *chandef);
 -u8 iwl_mvm_get_ctrl_pos(struct cfg80211_chan_def *chandef);
 +u8 iwl_mvm_get_channel_width(const struct cfg80211_chan_def *chandef);
 +u8 iwl_mvm_get_ctrl_pos(const struct cfg80211_chan_def *chandef);
  int iwl_mvm_phy_send_rlc(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt,
                         u8 chains_static, u8 chains_dynamic);
  
@@@ -2131,12 -2114,6 +2129,12 @@@ bool iwl_mvm_bt_coex_is_tpc_allowed(str
  u8 iwl_mvm_bt_coex_get_single_ant_msk(struct iwl_mvm *mvm, u8 enabled_ants);
  u8 iwl_mvm_bt_coex_tx_prio(struct iwl_mvm *mvm, struct ieee80211_hdr *hdr,
                           struct ieee80211_tx_info *info, u8 ac);
 +bool iwl_mvm_bt_coex_calculate_esr_mode(struct iwl_mvm *mvm,
 +                                      struct ieee80211_vif *vif,
 +                                      int link_id, int primary_link);
 +void iwl_mvm_bt_coex_update_vif_esr(struct iwl_mvm *mvm,
 +                                  struct ieee80211_vif *vif,
 +                                  int link_id);
  
  /* beacon filtering */
  #ifdef CONFIG_IWLWIFI_DEBUGFS
@@@ -2150,9 -2127,11 +2148,9 @@@ iwl_mvm_beacon_filter_debugfs_parameter
  {}
  #endif
  int iwl_mvm_enable_beacon_filter(struct iwl_mvm *mvm,
 -                               struct ieee80211_vif *vif,
 -                               u32 flags);
 +                               struct ieee80211_vif *vif);
  int iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm,
 -                                struct ieee80211_vif *vif,
 -                                u32 flags);
 +                                struct ieee80211_vif *vif);
  /* SMPS */
  void iwl_mvm_update_smps(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
                                enum iwl_mvm_smps_type_request req_type,
@@@ -2385,7 -2364,7 +2383,7 @@@ u64 iwl_mvm_ptp_get_adj_time(struct iwl
  int iwl_mvm_sar_select_profile(struct iwl_mvm *mvm, int prof_a, int prof_b);
  int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm);
  int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm);
 -void iwl_mvm_get_acpi_tables(struct iwl_mvm *mvm);
 +void iwl_mvm_get_bios_tables(struct iwl_mvm *mvm);
  #ifdef CONFIG_IWLWIFI_DEBUGFS
  void iwl_mvm_link_sta_add_debugfs(struct ieee80211_hw *hw,
                                  struct ieee80211_vif *vif,
@@@ -2406,10 -2385,6 +2404,10 @@@ int iwl_mvm_sec_key_del(struct iwl_mvm 
                        struct ieee80211_vif *vif,
                        struct ieee80211_sta *sta,
                        struct ieee80211_key_conf *keyconf);
 +int iwl_mvm_sec_key_del_pasn(struct iwl_mvm *mvm,
 +                           struct ieee80211_vif *vif,
 +                           u32 sta_mask,
 +                           struct ieee80211_key_conf *keyconf);
  void iwl_mvm_sec_key_remove_ap(struct iwl_mvm *mvm,
                               struct ieee80211_vif *vif,
                               struct iwl_mvm_vif_link_info *link,
@@@ -2534,7 -2509,7 +2532,7 @@@ static inline void iwl_mvm_set_chan_inf
  static inline void
  iwl_mvm_set_chan_info_chandef(struct iwl_mvm *mvm,
                              struct iwl_fw_channel_info *ci,
 -                            struct cfg80211_chan_def *chandef)
 +                            const struct cfg80211_chan_def *chandef)
  {
        enum nl80211_band band = chandef->chan->band;
  
@@@ -2624,6 -2599,7 +2622,6 @@@ static inline bool iwl_mvm_mei_filter_s
  void iwl_mvm_send_roaming_forbidden_event(struct iwl_mvm *mvm,
                                          struct ieee80211_vif *vif,
                                          bool forbidden);
 -bool iwl_mvm_is_vendor_in_approved_list(void);
  
  /* Callbacks for ieee80211_ops */
  void iwl_mvm_mac_tx(struct ieee80211_hw *hw,
@@@ -2713,8 -2689,7 +2711,8 @@@ int iwl_mvm_pre_channel_switch(struct i
                               struct ieee80211_vif *vif,
                               struct ieee80211_channel_switch *chsw);
  void iwl_mvm_abort_channel_switch(struct ieee80211_hw *hw,
 -                                struct ieee80211_vif *vif);
 +                                struct ieee80211_vif *vif,
 +                                struct ieee80211_bss_conf *link_conf);
  void iwl_mvm_channel_switch_rx_beacon(struct ieee80211_hw *hw,
                                      struct ieee80211_vif *vif,
                                      struct ieee80211_channel_switch *chsw);
@@@ -2753,28 -2728,4 +2751,28 @@@ bool iwl_mvm_enable_fils(struct iwl_mv
                         struct ieee80211_chanctx_conf *ctx);
  void iwl_mvm_mld_select_links(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
                              bool valid_links_changed);
 +int iwl_mvm_mld_get_primary_link(struct iwl_mvm *mvm,
 +                               struct ieee80211_vif *vif,
 +                               unsigned long usable_links);
 +
 +bool iwl_mvm_is_ftm_responder_chanctx(struct iwl_mvm *mvm,
 +                                    struct ieee80211_chanctx_conf *ctx);
 +
 +static inline struct cfg80211_chan_def *
 +iwl_mvm_chanctx_def(struct iwl_mvm *mvm, struct ieee80211_chanctx_conf *ctx)
 +{
 +      bool use_def = iwl_mvm_is_ftm_responder_chanctx(mvm, ctx) ||
 +              iwl_mvm_enable_fils(mvm, ctx);
 +
 +      return use_def ? &ctx->def : &ctx->min_def;
 +}
 +
 +void iwl_mvm_roc_duration_and_delay(struct ieee80211_vif *vif,
 +                                  u32 duration_ms,
 +                                  u32 *duration_tu,
 +                                  u32 *delay);
 +int iwl_mvm_roc_add_cmd(struct iwl_mvm *mvm,
 +                      struct ieee80211_channel *channel,
 +                      struct ieee80211_vif *vif,
 +                      int duration, u32 activity);
  #endif /* __IWL_MVM_H__ */
index f6c2e5964b8f2e7ec0823097749013853b3e8016,22a1e3268a989d7c99094e3a669db41feeeb2e78..c0ca8e3ff2e78c137220a50076c0ee4d2544e391
@@@ -53,7 -53,6 +53,6 @@@ struct zone_device 
        u32                             msr_pkg_therm_high;
        struct delayed_work             work;
        struct thermal_zone_device      *tzone;
-       struct thermal_trip             *trips;
        struct cpumask                  cpumask;
  };
  
@@@ -108,11 -107,11 +107,11 @@@ static struct zone_device *pkg_temp_the
  static int sys_get_curr_temp(struct thermal_zone_device *tzd, int *temp)
  {
        struct zone_device *zonedev = thermal_zone_device_priv(tzd);
-       int val;
+       int val, ret;
  
-       val = intel_tcc_get_temp(zonedev->cpu, true);
-       if (val < 0)
-               return val;
+       ret = intel_tcc_get_temp(zonedev->cpu, &val, true);
+       if (ret < 0)
+               return ret;
  
        *temp = val * 1000;
        pr_debug("sys_get_curr_temp %d\n", *temp);
@@@ -167,7 -166,7 +166,7 @@@ sys_set_trip_temp(struct thermal_zone_d
  }
  
  /* Thermal zone callback registry */
- static struct thermal_zone_device_ops tzone_ops = {
+ static const struct thermal_zone_device_ops tzone_ops = {
        .get_temp = sys_get_curr_temp,
        .set_trip_temp = sys_set_trip_temp,
  };
@@@ -268,17 -267,13 +267,13 @@@ static int pkg_thermal_notify(u64 msr_v
        return 0;
  }
  
- static struct thermal_trip *pkg_temp_thermal_trips_init(int cpu, int tj_max, int num_trips)
+ static int pkg_temp_thermal_trips_init(int cpu, int tj_max,
+                                      struct thermal_trip *trips, int num_trips)
  {
-       struct thermal_trip *trips;
        unsigned long thres_reg_value;
        u32 mask, shift, eax, edx;
        int ret, i;
  
-       trips = kzalloc(sizeof(*trips) * num_trips, GFP_KERNEL);
-       if (!trips)
-               return ERR_PTR(-ENOMEM);
        for (i = 0; i < num_trips; i++) {
  
                if (i) {
  
                ret = rdmsr_on_cpu(cpu, MSR_IA32_PACKAGE_THERM_INTERRUPT,
                                   &eax, &edx);
-               if (ret < 0) {
-                       kfree(trips);
-                       return ERR_PTR(ret);
-               }
+               if (ret < 0)
+                       return ret;
  
                thres_reg_value = (eax & mask) >> shift;
  
                        tj_max - thres_reg_value * 1000 : THERMAL_TEMP_INVALID;
  
                trips[i].type = THERMAL_TRIP_PASSIVE;
+               trips[i].flags |= THERMAL_TRIP_FLAG_RW_TEMP;
  
                pr_debug("%s: cpu=%d, trip=%d, temp=%d\n",
                         __func__, cpu, i, trips[i].temperature);
        }
  
-       return trips;
+       return 0;
  }
  
  static int pkg_temp_thermal_device_add(unsigned int cpu)
  {
+       struct thermal_trip trips[MAX_NUMBER_OF_TRIPS] = { 0 };
        int id = topology_logical_die_id(cpu);
        u32 eax, ebx, ecx, edx;
        struct zone_device *zonedev;
        if (!zonedev)
                return -ENOMEM;
  
-       zonedev->trips = pkg_temp_thermal_trips_init(cpu, tj_max, thres_count);
-       if (IS_ERR(zonedev->trips)) {
-               err = PTR_ERR(zonedev->trips);
+       err = pkg_temp_thermal_trips_init(cpu, tj_max, trips, thres_count);
+       if (err)
                goto out_kfree_zonedev;
-       }
  
        INIT_DELAYED_WORK(&zonedev->work, pkg_temp_thermal_threshold_work_fn);
        zonedev->cpu = cpu;
        zonedev->tzone = thermal_zone_device_register_with_trips("x86_pkg_temp",
-                       zonedev->trips, thres_count,
-                       (thres_count == MAX_NUMBER_OF_TRIPS) ? 0x03 : 0x01,
+                       trips, thres_count,
                        zonedev, &tzone_ops, &pkg_temp_tz_params, 0, 0);
        if (IS_ERR(zonedev->tzone)) {
                err = PTR_ERR(zonedev->tzone);
-               goto out_kfree_trips;
+               goto out_kfree_zonedev;
        }
        err = thermal_zone_device_enable(zonedev->tzone);
        if (err)
  
  out_unregister_tz:
        thermal_zone_device_unregister(zonedev->tzone);
- out_kfree_trips:
-       kfree(zonedev->trips);
  out_kfree_zonedev:
        kfree(zonedev);
        return err;
@@@ -457,10 -447,9 +447,9 @@@ static int pkg_thermal_cpu_offline(unsi
        raw_spin_unlock_irq(&pkg_temp_lock);
  
        /* Final cleanup if this is the last cpu */
-       if (lastcpu) {
-               kfree(zonedev->trips);
+       if (lastcpu)
                kfree(zonedev);
-       }
        return 0;
  }
  
@@@ -494,7 -483,7 +483,7 @@@ static int __init pkg_temp_thermal_init
        if (!x86_match_cpu(pkg_temp_thermal_ids))
                return -ENODEV;
  
 -      max_id = topology_max_packages() * topology_max_die_per_package();
 +      max_id = topology_max_packages() * topology_max_dies_per_package();
        zones = kcalloc(max_id, sizeof(struct zone_device *),
                           GFP_KERNEL);
        if (!zones)
This page took 0.117628 seconds and 4 git commands to generate.