]> www.infradead.org Git - users/jedix/linux-maple.git/commit
wifi: iwlwifi: mld: call thermal exit without wiphy lock held
authorBenjamin Berg <benjamin.berg@intel.com>
Tue, 6 May 2025 19:40:58 +0000 (22:40 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Fri, 9 May 2025 12:36:52 +0000 (15:36 +0300)
commit83128399f3b4926ab73ce8e5081ce6595e9230e9
treeb3d1413eb6eea057d516900bd2f5a14f451d8828
parent1437d6c4f2e098ce993f3b69f42b6a04e474cc11
wifi: iwlwifi: mld: call thermal exit without wiphy lock held

The driver must not hold the wiphy mutex when unregistering the thermal
devices. Do not hold the lock for the call to iwl_mld_thermal_exit and
only do a lock/unlock to cancel the ct_kill_exit_wk work.

The problem is that iwl_mld_tzone_get_temp needs to take the wiphy lock
while the thermal code is holding its own locks already. When
unregistering the device, the reverse would happen as the driver was
calling thermal_cooling_device_unregister with the wiphy mutex already
held.

It is not likely to trigger this deadlock as it can only happen if the
thermal code is polling the temperature while the driver is being
unloaded. However, lockdep reported it so fix it.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-12-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
drivers/net/wireless/intel/iwlwifi/mld/mld.c
drivers/net/wireless/intel/iwlwifi/mld/thermal.c