]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: iwlwifi: remove fw_running op
authorShahar S Matityahu <shahar.s.matityahu@intel.com>
Fri, 10 May 2024 14:06:40 +0000 (17:06 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Sep 2024 09:06:41 +0000 (11:06 +0200)
[ Upstream commit 37733bffda3285d18bd1d72c14b3a1cf39c56a5e ]

fw_running assumes that memory can be retrieved only after alive.
This assumption is no longer true as we support dump before alive.
To avoid invalid access to the NIC, check that STATUS_DEVICE_ENABLED
bit in trans status is set before dumping instead of the prior check.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240510170500.ca07138cedeb.I090e31d3eaeb4ba19f5f84aba997ccd36927e9ac@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/intel/iwlwifi/fw/debugfs.c
drivers/net/wireless/intel/iwlwifi/fw/runtime.h
drivers/net/wireless/intel/iwlwifi/mvm/ops.c

index 24d6ed3513ce57332156b84e4c42092098d5e794..c09a736f87e68cadfe710c40000598daed4a8892 100644 (file)
@@ -275,8 +275,7 @@ static ssize_t iwl_dbgfs_send_hcmd_write(struct iwl_fw_runtime *fwrt, char *buf,
                .data = { NULL, },
        };
 
-       if (fwrt->ops && fwrt->ops->fw_running &&
-           !fwrt->ops->fw_running(fwrt->ops_ctx))
+       if (!iwl_trans_fw_running(fwrt->trans))
                return -EIO;
 
        if (count < header_size + 1 || count > 1024 * 4)
index cddcb4d9a264c51443778557a19a14ecb9294695..79ab8ef78f67a38783e2ae7c1396b4206bb4e109 100644 (file)
@@ -72,7 +72,6 @@
 struct iwl_fw_runtime_ops {
        int (*dump_start)(void *ctx);
        void (*dump_end)(void *ctx);
-       bool (*fw_running)(void *ctx);
        int (*send_hcmd)(void *ctx, struct iwl_host_cmd *host_cmd);
        bool (*d3_debug_enable)(void *ctx);
 };
index 3548eb57f1f305015c529658ff3eb77e332593bf..9b1a1455a7d517c52f3d7c8f11830ccbe12a61b1 100644 (file)
@@ -577,11 +577,6 @@ static void iwl_mvm_fwrt_dump_end(void *ctx)
        mutex_unlock(&mvm->mutex);
 }
 
-static bool iwl_mvm_fwrt_fw_running(void *ctx)
-{
-       return iwl_mvm_firmware_running(ctx);
-}
-
 static int iwl_mvm_fwrt_send_hcmd(void *ctx, struct iwl_host_cmd *host_cmd)
 {
        struct iwl_mvm *mvm = (struct iwl_mvm *)ctx;
@@ -602,7 +597,6 @@ static bool iwl_mvm_d3_debug_enable(void *ctx)
 static const struct iwl_fw_runtime_ops iwl_mvm_fwrt_ops = {
        .dump_start = iwl_mvm_fwrt_dump_start,
        .dump_end = iwl_mvm_fwrt_dump_end,
-       .fw_running = iwl_mvm_fwrt_fw_running,
        .send_hcmd = iwl_mvm_fwrt_send_hcmd,
        .d3_debug_enable = iwl_mvm_d3_debug_enable,
 };