]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iwlwifi: mvm: Populate trip table before registering thermal zone
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 7 Feb 2024 19:10:24 +0000 (20:10 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 8 Feb 2024 13:54:55 +0000 (14:54 +0100)
commit61d88437546f5f40b6411aac17c55d0298c7a19d
treed6a441c61333e65dc7a6e9ac8d5db35c3c6223ff
parent2e171a57c312cb732d633c5ccc51551588b7a855
iwlwifi: mvm: Populate trip table before registering thermal zone

The trip table in iwl_mvm_thermal_zone_register() is populated after
passing it to thermal_zone_device_register_with_trips(), so it may be
accessed (for instance, via sysfs) before it is ready.

To prevent that from happening, modify the function to populate the
trip table before calling thermal_zone_device_register_with_trips().

Also make the code use THERMAL_TEMP_INVALID as the "invalid temperature"
value which is also meaningful for the core.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Miri Korenblit <Miriam.rachel.korenblit@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/tt.c