All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wifi: iwlwifi: mvm: fix link ID management
@ 2024-04-20 13:44 Johannes Berg
  2024-04-24 12:26 ` Tor Vic
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2024-04-20 13:44 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

On older (pre-MLD API) devices, we started also calling
iwl_mvm_set_link_mapping()/iwl_mvm_unset_link_mapping(),
but of course not also iwl_mvm_remove_link(). Since the
link ID was only released in iwl_mvm_remove_link() this
causes us to run out of FW link IDs very quickly. Fix
it by releasing the link ID correctly.

Fixes: a8b5d4809b50 ("wifi: iwlwifi: mvm: Configure the link mapping for non-MLD FW")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/link.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/link.c b/drivers/net/wireless/intel/iwlwifi/mvm/link.c
index 9f69e04594e4..fe5bba8561d0 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/link.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/link.c
@@ -279,6 +279,7 @@ int iwl_mvm_unset_link_mapping(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 
 	RCU_INIT_POINTER(mvm->link_id_to_link_conf[link_info->fw_link_id],
 			 NULL);
+	iwl_mvm_release_fw_link_id(mvm, link_info->fw_link_id);
 	return 0;
 }
 
@@ -296,7 +297,6 @@ int iwl_mvm_remove_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 		return 0;
 
 	cmd.link_id = cpu_to_le32(link_info->fw_link_id);
-	iwl_mvm_release_fw_link_id(mvm, link_info->fw_link_id);
 	link_info->fw_link_id = IWL_MVM_FW_LINK_ID_INVALID;
 	cmd.spec_link_id = link_conf->link_id;
 	cmd.phy_id = cpu_to_le32(FW_CTXT_INVALID);
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] wifi: iwlwifi: mvm: fix link ID management
  2024-04-20 13:44 [PATCH] wifi: iwlwifi: mvm: fix link ID management Johannes Berg
@ 2024-04-24 12:26 ` Tor Vic
  0 siblings, 0 replies; 2+ messages in thread
From: Tor Vic @ 2024-04-24 12:26 UTC (permalink / raw)
  To: Johannes Berg, linux-wireless; +Cc: Johannes Berg



On 4/20/24 15:44, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> On older (pre-MLD API) devices, we started also calling
> iwl_mvm_set_link_mapping()/iwl_mvm_unset_link_mapping(),
> but of course not also iwl_mvm_remove_link(). Since the
> link ID was only released in iwl_mvm_remove_link() this
> causes us to run out of FW link IDs very quickly. Fix
> it by releasing the link ID correctly.
> 
> Fixes: a8b5d4809b50 ("wifi: iwlwifi: mvm: Configure the link mapping for non-MLD FW")
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
>   drivers/net/wireless/intel/iwlwifi/mvm/link.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/link.c b/drivers/net/wireless/intel/iwlwifi/mvm/link.c
> index 9f69e04594e4..fe5bba8561d0 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mvm/link.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/link.c
> @@ -279,6 +279,7 @@ int iwl_mvm_unset_link_mapping(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
>   
>   	RCU_INIT_POINTER(mvm->link_id_to_link_conf[link_info->fw_link_id],
>   			 NULL);
> +	iwl_mvm_release_fw_link_id(mvm, link_info->fw_link_id);
>   	return 0;
>   }
>   
> @@ -296,7 +297,6 @@ int iwl_mvm_remove_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
>   		return 0;
>   
>   	cmd.link_id = cpu_to_le32(link_info->fw_link_id);
> -	iwl_mvm_release_fw_link_id(mvm, link_info->fw_link_id);
>   	link_info->fw_link_id = IWL_MVM_FW_LINK_ID_INVALID;
>   	cmd.spec_link_id = link_conf->link_id;
>   	cmd.phy_id = cpu_to_le32(FW_CTXT_INVALID);


Hi,

this patch fixes the issue on my old ThinkPad with

   Network controller: Intel Corporation Wireless 8265 / 8275 (rev 78)

Tested-by: Tor Vic <torvic9@mailbox.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-24 12:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-20 13:44 [PATCH] wifi: iwlwifi: mvm: fix link ID management Johannes Berg
2024-04-24 12:26 ` Tor Vic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.