Centos-kernel-stream-9/drivers/net/wireless/intel/iwlwifi/mvm
David Arcari 73087d2ade thermal: core: Allow thermal zones to tell the core to ignore them
JIRA: https://issues.redhat.com/browse/RHEL-61357
Conflicts: 3f3126515fbe ("wifi: iwlwifi: mvm: add mvm-specific guard") is
	   not in RHEL

commit e528be3c87be953b73e7826a2d7e4b837cbad39d
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date:   Wed Jul 17 21:45:02 2024 +0200

    thermal: core: Allow thermal zones to tell the core to ignore them

    The iwlwifi wireless driver registers a thermal zone that is only needed
    when the network interface handled by it is up and it wants that thermal
    zone to be effectively ignored by the core otherwise.

    Before commit a8a261774466 ("thermal: core: Call monitor_thermal_zone()
    if zone temperature is invalid") that could be achieved by returning
    an error code from the thermal zone's .get_temp() callback because the
    core did not really handle errors returned by it almost at all.
    However, commit a8a261774466 made the core attempt to recover from the
    situation in which the temperature of a thermal zone cannot be
    determined due to errors returned by its .get_temp() and is always
    invalid from the core's perspective.

    That was done because there are thermal zones in which .get_temp()
    returns errors to start with due to some difficulties related to the
    initialization ordering, but then it will start to produce valid
    temperature values at one point.

    Unfortunately, the simple approach taken by commit a8a261774466,
    which is to poll the thermal zone periodically until its .get_temp()
    callback starts to return valid temperature values, is at odds with
    the special thermal zone in iwlwifi in which .get_temp() may always
    return an error because its network interface may always be down.  If
    that happens, every attempt to invoke the thermal zone's .get_temp()
    callback resulting in an error causes the thermal core to print a
    dev_warn() message to the kernel log which is super-noisy.

    To address this problem, make the core handle the case in which
    .get_temp() returns 0, but the temperature value returned by it
    is not actually valid, in a special way.  Namely, make the core
    completely ignore the invalid temperature value coming from
    .get_temp() in that case, which requires folding in
    update_temperature() into its caller and a few related changes.

    On the iwlwifi side, modify iwl_mvm_tzone_get_temp() to return 0
    and put THERMAL_TEMP_INVALID into the temperature return memory
    location instead of returning an error when the firmware is not
    running or it is not of the right type.

    Also, to clearly separate the handling of invalid temperature
    values from the thermal zone initialization, introduce a special
    THERMAL_TEMP_INIT value specifically for the latter purpose.

    Fixes: a8a261774466 ("thermal: core: Call monitor_thermal_zone() if zone temperature is invalid")
    Closes: https://lore.kernel.org/linux-pm/20240715044527.GA1544@sol.localdomain/
    Reported-by: Eric Biggers <ebiggers@kernel.org>
    Reported-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=201761
    Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
    Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
    Cc: 6.10+ <stable@vger.kernel.org> # 6.10+
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Link: https://patch.msgid.link/4950004.31r3eYUQgx@rjwysocki.net
    [ rjw: Rebased on top of the current mainline ]
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2025-02-17 13:35:04 -05:00
..
tests
Makefile wifi: iwlwifi: mvm: replace CONFIG_PM by CONFIG_PM_SLEEP 2024-11-22 10:58:09 +01:00
binding.c
coex.c wifi: iwlwiif: mvm: handle the new BT notif 2024-11-22 10:57:57 +01:00
constants.h wifi: iwlwifi: mvm: exit EMLSR if both links are missing beacons 2024-11-22 10:57:59 +01:00
d3.c wifi: iwlwifi: mvm: Fix __counted_by usage in cfg80211_wowlan_nd_* 2025-01-15 17:26:21 +01:00
debugfs-vif.c
debugfs.c
debugfs.h
ftm-initiator.c wifi: iwlwifi: mvm: set the cipher for secured NDP ranging 2024-11-22 10:57:57 +01:00
ftm-responder.c
fw-api.h
fw.c wifi: iwlwifi: mvm: Fix response handling in iwl_mvm_send_recovery_cmd() 2024-11-22 10:58:20 +01:00
led.c
link.c wifi: iwlwifi: mvm: properly set the rates in link cmd 2024-11-22 10:58:05 +01:00
mac-ctxt.c wifi: mac80211: fix a queue stall in certain cases of CSA 2025-01-15 17:26:24 +01:00
mac80211.c wifi: iwlwifi: mvm: tell iwlmei when we finished suspending 2025-01-15 17:26:23 +01:00
mld-key.c wifi: iwlwifi: mvm: use correct key iteration 2024-11-22 10:57:56 +01:00
mld-mac.c
mld-mac80211.c wifi: iwlwifi: mvm: don't add default link in fw restart flow 2024-11-22 10:58:20 +01:00
mld-sta.c wifi: iwlwifi: s/iwl_mvm_remove_sta_cmd/iwl_remove_sta_cmd 2024-11-22 10:58:04 +01:00
mvm.h wifi: iwlwifi: mvm: replace CONFIG_PM by CONFIG_PM_SLEEP 2024-11-22 10:58:09 +01:00
nvm.c wifi: iwlwifi: mvm: Stop processing MCC update if there was no change 2024-11-22 10:58:00 +01:00
offloading.c
ops.c wifi: iwlwifi: mvm: replace CONFIG_PM by CONFIG_PM_SLEEP 2024-11-22 10:58:09 +01:00
phy-ctxt.c wifi: iwlwifi: mvm: Offload RLC/SMPS functionality to firmware 2024-11-22 10:57:59 +01:00
power.c
ptp.c
quota.c
rfi.c
rs-fw.c
rs.c
rs.h
rx.c wifi: iwlwifi: s/IWL_MVM_STATION_COUNT_MAX/IWL_STATION_COUNT_MAX 2024-11-22 10:58:04 +01:00
rxmq.c wifi: iwlwifi: mvm: Remove unused last_sub_index from reorder buffer 2024-11-22 10:58:04 +01:00
scan.c wifi: iwlwifi: mvm: fix 6 GHz scan construction 2024-11-22 10:58:20 +01:00
sf.c
sta.c wifi: iwlwifi: s/IWL_MVM_STATION_COUNT_MAX/IWL_STATION_COUNT_MAX 2024-11-22 10:58:04 +01:00
sta.h wifi: iwlwifi: s/IWL_MVM_STATION_COUNT_MAX/IWL_STATION_COUNT_MAX 2024-11-22 10:58:04 +01:00
tdls.c
testmode.h
time-event.c wifi: iwlwifi: mvm: allow ESR when we the ROC expires 2024-11-22 10:58:01 +01:00
time-event.h
time-sync.c
time-sync.h
tt.c thermal: core: Allow thermal zones to tell the core to ignore them 2025-02-17 13:35:04 -05:00
tx.c wifi: iwlwifi: mvm: remove mvm prefix from iwl_mvm_tx_resp* 2024-11-22 10:58:04 +01:00
utils.c wifi: iwlwifi: mvm: cleanup iwl_mvm_get_wd_timeout 2024-11-22 10:58:00 +01:00
vendor-cmd.c