From patchwork Wed Dec 11 15:43:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 13903686 X-Patchwork-Delegate: quic_jjohnson@quicinc.com Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31F3B1D9A70 for ; Wed, 11 Dec 2024 15:44:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733931842; cv=none; b=pghHMOTthT+0LwzASMAuc3fFxRDr3DOhs4cI+fhEHvcHSDc1HHU+DC4HJ2SZPM6cUcIFoTO8RX2EUUhlKR8r/hSpSYEsVFA7r8OlCjw/cZk/1KHrxZduuc876nARHAAjssfM7cmt5epBULlCn9UcLZb5RoGGbgUUPDBPJLD1s9k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733931842; c=relaxed/simple; bh=Pg3VZnen9pod2yEoejxGZ+ectvVGrsvQKPjCyF3HelQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MfIzyY5nJj/Pa8hzueH9xAWZZsKh4sbzW2hKB7u35WpjeOszkK658BVF3j4jj+ve6yvIrcRtblX/yMXkCA/tjQrgf4iAAJJdlP9cfOLDLIXHO3vjw8jT+onwAP4ESa6c6ywHSbmmtNjnpuG4XhTK3P6W0coS8t3IPdvqNF8xowo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ig99/Zg2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ig99/Zg2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53787C4CED2; Wed, 11 Dec 2024 15:44:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733931842; bh=Pg3VZnen9pod2yEoejxGZ+ectvVGrsvQKPjCyF3HelQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ig99/Zg2/neKQdhq4NUaGCpr9hr/n1KlFZbdSPejcaoVYbAYTj25IXAxA8QOXEvaK FUeNusR0P7EzVtPh9UCQ5J7EXhBavpxEkkd6Y61I2k1d8jKy9AkcNrPMFOjkULFwr7 tEbNDpJ1PgvkSKEIeQ5gzsouahQ8SeNloRtAPEjVSarEBlApYmINVyu2jOhopN5uAE lbk1j6jw6rfpDybF+BRvvaYasfI19oz9q47PvckqTDopAAzYfaq9R4qWFXY/Ev25FA a2D6dnyJt/8YoxYhAN4GhuVVkDp492ntDD6R23eUihLhJMCVq6qNvwppKBDQWqjaQP 42t+TLCG71ebg== From: Kalle Valo To: ath12k@lists.infradead.org Cc: linux-wireless@vger.kernel.org Subject: [PATCH 1/7] wifi: ath12k: symmetrize scan vdev creation and deletion during HW scan Date: Wed, 11 Dec 2024 17:43:52 +0200 Message-Id: <20241211154358.776279-2-kvalo@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241211154358.776279-1-kvalo@kernel.org> References: <20241211154358.776279-1-kvalo@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Aditya Kumar Singh Currently, the hardware scan is initiated in the driver on scan link (15). After mapping to the appropriate radio based on the scan frequency, the vdev is created and the scan begins. However, the vdev is only deleted when channel assignment is about to occur after the scan. Additionally, it is also deleted if a new scan is requested on the same interface but the underlying radio differs in the new request. This imbalance leads to various hardware scan issues, especially when a non-MLO and MLO combination exists. In such cases, the latter tries to skip the scan and proceed with channel assignment while the former is still scanning, causing a firmware assert. To address this issue, symmetrize the scan vdev creation and deletion during hardware scan operations. This means creating a vdev when the scan starts and deleting it once the scan is completed or aborted. While at this, add a few debug prints in scan handling and a few empty lines for better code read. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Signed-off-by: Aditya Kumar Singh Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath12k/core.h | 3 +- drivers/net/wireless/ath/ath12k/mac.c | 120 +++++++++++++++++++------ drivers/net/wireless/ath/ath12k/wmi.c | 3 +- 3 files changed, 99 insertions(+), 27 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h index d09ebcdde94f..9aed24597548 100644 --- a/drivers/net/wireless/ath/ath12k/core.h +++ b/drivers/net/wireless/ath/ath12k/core.h @@ -603,9 +603,10 @@ struct ath12k { struct delayed_work timeout; enum ath12k_scan_state state; bool is_roc; - int vdev_id; int roc_freq; bool roc_notify; + struct wiphy_work vdev_clean_wk; + struct ath12k_link_vif *arvif; } scan; struct { diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 6f4a34c91038..bd5a3c790c3b 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -4000,22 +4000,9 @@ void __ath12k_mac_scan_finish(struct ath12k *ar) ieee80211_remain_on_channel_expired(hw); fallthrough; case ATH12K_SCAN_STARTING: - if (!ar->scan.is_roc) { - struct cfg80211_scan_info info = { - .aborted = ((ar->scan.state == - ATH12K_SCAN_ABORTING) || - (ar->scan.state == - ATH12K_SCAN_STARTING)), - }; - - ieee80211_scan_completed(hw, &info); - } - - ar->scan.state = ATH12K_SCAN_IDLE; - ar->scan_channel = NULL; - ar->scan.roc_freq = 0; cancel_delayed_work(&ar->scan.timeout); complete(&ar->scan.completed); + wiphy_work_queue(ar->ah->hw->wiphy, &ar->scan.vdev_clean_wk); break; } } @@ -4056,15 +4043,15 @@ static int ath12k_scan_stop(struct ath12k *ar) } out: - /* Scan state should be updated upon scan completion but in case - * firmware fails to deliver the event (for whatever reason) it is - * desired to clean up scan state anyway. Firmware may have just - * dropped the scan completion event delivery due to transport pipe - * being overflown with data and/or it can recover on its own before - * next scan request is submitted. + /* Scan state should be updated in scan completion worker but in + * case firmware fails to deliver the event (for whatever reason) + * it is desired to clean up scan state anyway. Firmware may have + * just dropped the scan completion event delivery due to transport + * pipe being overflown with data and/or it can recover on its own + * before next scan request is submitted. */ spin_lock_bh(&ar->data_lock); - if (ar->scan.state != ATH12K_SCAN_IDLE) + if (ret) __ath12k_mac_scan_finish(ar); spin_unlock_bh(&ar->data_lock); @@ -4115,6 +4102,53 @@ static void ath12k_scan_timeout_work(struct work_struct *work) wiphy_unlock(ath12k_ar_to_hw(ar)->wiphy); } +static void ath12k_scan_vdev_clean_work(struct wiphy *wiphy, struct wiphy_work *work) +{ + struct ath12k *ar = container_of(work, struct ath12k, + scan.vdev_clean_wk); + struct ath12k_hw *ah = ar->ah; + struct ath12k_link_vif *arvif; + + lockdep_assert_wiphy(wiphy); + + arvif = ar->scan.arvif; + + /* The scan vdev has already been deleted. This can occur when a + * new scan request is made on the same vif with a different + * frequency, causing the scan arvif to move from one radio to + * another. Or, scan was abrupted and via remove interface, the + * arvif is already deleted. Alternatively, if the scan vdev is not + * being used as an actual vdev, then do not delete it. + */ + if (!arvif || arvif->is_started) + goto work_complete; + + ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac clean scan vdev (link id %u)", + arvif->link_id); + + ath12k_mac_remove_link_interface(ah->hw, arvif); + ath12k_mac_unassign_link_vif(arvif); + +work_complete: + spin_lock_bh(&ar->data_lock); + ar->scan.arvif = NULL; + if (!ar->scan.is_roc) { + struct cfg80211_scan_info info = { + .aborted = ((ar->scan.state == + ATH12K_SCAN_ABORTING) || + (ar->scan.state == + ATH12K_SCAN_STARTING)), + }; + + ieee80211_scan_completed(ar->ah->hw, &info); + } + + ar->scan.state = ATH12K_SCAN_IDLE; + ar->scan_channel = NULL; + ar->scan.roc_freq = 0; + spin_unlock_bh(&ar->data_lock); +} + static int ath12k_start_scan(struct ath12k *ar, struct ath12k_wmi_scan_req_arg *arg) { @@ -4208,6 +4242,9 @@ static int ath12k_mac_op_hw_scan(struct ieee80211_hw *hw, link_id = ath12k_mac_find_link_id_by_ar(ahvif, ar); arvif = ath12k_mac_assign_link_vif(ah, vif, link_id); + ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac link ID %d selected for scan", + arvif->link_id); + /* If the vif is already assigned to a specific vdev of an ar, * check whether its already started, vdev which is started * are not allowed to switch to a new radio. @@ -4231,6 +4268,7 @@ static int ath12k_mac_op_hw_scan(struct ieee80211_hw *hw, create = false; } } + if (create) { /* Previous arvif would've been cleared in radio switch block * above, assign arvif again for create. @@ -4251,7 +4289,7 @@ static int ath12k_mac_op_hw_scan(struct ieee80211_hw *hw, reinit_completion(&ar->scan.completed); ar->scan.state = ATH12K_SCAN_STARTING; ar->scan.is_roc = false; - ar->scan.vdev_id = arvif->vdev_id; + ar->scan.arvif = arvif; ret = 0; break; case ATH12K_SCAN_STARTING: @@ -4313,6 +4351,8 @@ static int ath12k_mac_op_hw_scan(struct ieee80211_hw *hw, spin_unlock_bh(&ar->data_lock); } + ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac scan started"); + /* As per cfg80211/mac80211 scan design, it allows only one * scan at a time. Hence last_scan link id is used for * tracking the link id on which the scan is been done on @@ -4346,7 +4386,7 @@ static void ath12k_mac_op_cancel_hw_scan(struct ieee80211_hw *hw, lockdep_assert_wiphy(hw->wiphy); arvif = wiphy_dereference(hw->wiphy, ahvif->link[link_id]); - if (!arvif || !arvif->is_created) + if (!arvif || arvif->is_started) return; ar = arvif->ar; @@ -7404,6 +7444,7 @@ static void ath12k_mac_stop(struct ath12k *ar) clear_bit(ATH12K_CAC_RUNNING, &ar->dev_flags); cancel_delayed_work_sync(&ar->scan.timeout); + wiphy_work_cancel(ath12k_ar_to_hw(ar)->wiphy, &ar->scan.vdev_clean_wk); cancel_work_sync(&ar->regd_update_work); cancel_work_sync(&ar->ab->rfkill_work); @@ -8033,7 +8074,7 @@ static struct ath12k *ath12k_mac_assign_vif_to_vdev(struct ieee80211_hw *hw, scan_arvif = wiphy_dereference(hw->wiphy, ahvif->link[ATH12K_DEFAULT_SCAN_LINK]); if (scan_arvif && scan_arvif->ar == ar) { - ar->scan.vdev_id = -1; + ar->scan.arvif = NULL; ath12k_mac_remove_link_interface(hw, scan_arvif); ath12k_mac_unassign_link_vif(scan_arvif); } @@ -8234,6 +8275,7 @@ static void ath12k_mac_op_remove_interface(struct ieee80211_hw *hw, { struct ath12k_vif *ahvif = ath12k_vif_to_ahvif(vif); struct ath12k_link_vif *arvif; + struct ath12k *ar; u8 link_id; lockdep_assert_wiphy(hw->wiphy); @@ -8247,6 +8289,31 @@ static void ath12k_mac_op_remove_interface(struct ieee80211_hw *hw, if (!arvif || !arvif->is_created) continue; + ar = arvif->ar; + + /* Scan abortion is in progress since before this, cancel_hw_scan() + * is expected to be executed. Since link is anyways going to be removed + * now, just cancel the worker and send the scan aborted to user space + */ + if (ar->scan.arvif == arvif) { + wiphy_work_cancel(hw->wiphy, &ar->scan.vdev_clean_wk); + + spin_lock_bh(&ar->data_lock); + ar->scan.arvif = NULL; + if (!ar->scan.is_roc) { + struct cfg80211_scan_info info = { + .aborted = true, + }; + + ieee80211_scan_completed(ar->ah->hw, &info); + } + + ar->scan.state = ATH12K_SCAN_IDLE; + ar->scan_channel = NULL; + ar->scan.roc_freq = 0; + spin_unlock_bh(&ar->data_lock); + } + ath12k_mac_remove_link_interface(hw, arvif); ath12k_mac_unassign_link_vif(arvif); } @@ -9952,6 +10019,7 @@ static int ath12k_mac_op_cancel_remain_on_channel(struct ieee80211_hw *hw, ath12k_scan_abort(ar); cancel_delayed_work_sync(&ar->scan.timeout); + wiphy_work_cancel(hw->wiphy, &ar->scan.vdev_clean_wk); return 0; } @@ -10035,7 +10103,7 @@ static int ath12k_mac_op_remain_on_channel(struct ieee80211_hw *hw, reinit_completion(&ar->scan.on_channel); ar->scan.state = ATH12K_SCAN_STARTING; ar->scan.is_roc = true; - ar->scan.vdev_id = arvif->vdev_id; + ar->scan.arvif = arvif; ar->scan.roc_freq = chan->center_freq; ar->scan.roc_notify = true; ret = 0; @@ -10952,6 +11020,7 @@ static void ath12k_mac_setup(struct ath12k *ar) ar->cfg_rx_chainmask = pdev->cap.rx_chain_mask; ar->num_tx_chains = hweight32(pdev->cap.tx_chain_mask); ar->num_rx_chains = hweight32(pdev->cap.rx_chain_mask); + ar->scan.arvif = NULL; spin_lock_init(&ar->data_lock); INIT_LIST_HEAD(&ar->arvifs); @@ -10969,6 +11038,7 @@ static void ath12k_mac_setup(struct ath12k *ar) init_completion(&ar->mlo_setup_done); INIT_DELAYED_WORK(&ar->scan.timeout, ath12k_scan_timeout_work); + wiphy_work_init(&ar->scan.vdev_clean_wk, ath12k_scan_vdev_clean_work); INIT_WORK(&ar->regd_update_work, ath12k_regd_update_work); wiphy_work_init(&ar->wmi_mgmt_tx_work, ath12k_mgmt_over_wmi_tx_work); diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c index 10a6ba926343..e9bda625e9a7 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.c +++ b/drivers/net/wireless/ath/ath12k/wmi.c @@ -6338,7 +6338,8 @@ static struct ath12k *ath12k_get_ar_on_scan_state(struct ath12k_base *ab, spin_lock_bh(&ar->data_lock); if (ar->scan.state == state && - ar->scan.vdev_id == vdev_id) { + ar->scan.arvif && + ar->scan.arvif->vdev_id == vdev_id) { spin_unlock_bh(&ar->data_lock); return ar; } From patchwork Wed Dec 11 15:43:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 13903687 X-Patchwork-Delegate: quic_jjohnson@quicinc.com Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F06C1D9A70 for ; Wed, 11 Dec 2024 15:44:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733931843; cv=none; b=HL45AmetksV+Su8/8n0DGC70E+GOftPma6nnF+l86bJw+Ez6m4SHEwZJ8efFqGiNOU6Eub7lTfESHd49w2nIiM9C1IIMshlxo5ds9FLUNmw+0K3+r4IsJO1T0p8dp6U0c6HzWBsucPmltWT0PVH/FdiBinmA4c7UAyqFftl2PW8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733931843; c=relaxed/simple; bh=tboF5zHLY+awhgwSforkB0qKkI0bgoMMkM7j9lFOmSk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bTPaVnSi76k6P+sb811rRcjq9Kq/t1/SeiguArfoWm/lhcHLjzfK/IoeSXhO6fVoqt+HPhbkigXD6AVdq4HZVbG2fmAzfGafKlqlOdoMx9V5QzxbOj5VFcKf2WamHPIKf3vqYAQ/h0fA3qXljGfp6VARYUW4/3AeChqGFz6nfXE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mvesHzbl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mvesHzbl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EAB7C4CED4; Wed, 11 Dec 2024 15:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733931843; bh=tboF5zHLY+awhgwSforkB0qKkI0bgoMMkM7j9lFOmSk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mvesHzblt61sucaDo3KfWUzSH0vNIQLvUZ3zdFmrMZB72UidWNE9TipesK9hxaeXI BF98FgquR1Gdh9+XajqVPzgmzooWR7cEbbPR59GHzDYbkoMkHi54kfjBvKNCTQ9F4Q rhWs/773ZliEctwPbGtt3l7Hi0MZa0QjJHKKum61jHHpHUakcbCmyIIXIHV6jAXkEe bstg9Zh+x0QKD3WfX8DjAeTpJzLj5TWr26v8xlFgTJgnKJSoD0SAnaW8sFZ/pQzrf/ P6NT3HTXCjWcgv3i/ruzhlsL1xU0MikMWr89NlJVHaj1OHsVZEyP4ntw4VWYJmmBrP THVliyEIQ8PHw== From: Kalle Valo To: ath12k@lists.infradead.org Cc: linux-wireless@vger.kernel.org Subject: [PATCH 2/7] wifi: ath12k: add can_activate_links mac operation Date: Wed, 11 Dec 2024 17:43:53 +0200 Message-Id: <20241211154358.776279-3-kvalo@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241211154358.776279-1-kvalo@kernel.org> References: <20241211154358.776279-1-kvalo@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Aditya Kumar Singh When operating as an ML station, mac80211 initially activates only one link in the driver until the peer is authorized. Once the state changes to authorized, the driver should call mac80211 API to activate all other partner links. Before doing so, mac80211 checks if the driver supports activating links via the can_activate_links mac80211_ops. Therefore, add support for this mac80211_ops and call the API to activate the links once the state changes to authorized. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Signed-off-by: Aditya Kumar Singh Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath12k/mac.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index bd5a3c790c3b..7962bfa955ba 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -5645,6 +5645,19 @@ static int ath12k_mac_op_sta_state(struct ieee80211_hw *hw, } } + /* In the ML station scenario, activate all partner links once the + * client is transitioning to the associated state. + * + * FIXME: Ideally, this activation should occur when the client + * transitions to the authorized state. However, there are some + * issues with handling this in the firmware. Until the firmware + * can manage it properly, activate the links when the client is + * about to move to the associated state. + */ + if (ieee80211_vif_is_mld(vif) && vif->type == NL80211_IFTYPE_STATION && + old_state == IEEE80211_STA_AUTH && new_state == IEEE80211_STA_ASSOC) + ieee80211_set_active_links(vif, ieee80211_vif_usable_links(vif)); + /* Handle all the other state transitions in generic way */ valid_links = ahsta->links_map; for_each_set_bit(link_id, &valid_links, IEEE80211_MLD_MAX_NUM_LINKS) { @@ -5939,6 +5952,15 @@ static int ath12k_mac_op_change_sta_links(struct ieee80211_hw *hw, return 0; } +static bool ath12k_mac_op_can_activate_links(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + u16 active_links) +{ + /* TODO: Handle recovery case */ + + return true; +} + static int ath12k_conf_tx_uapsd(struct ath12k_link_vif *arvif, u16 ac, bool enable) { @@ -10249,6 +10271,7 @@ static const struct ieee80211_ops ath12k_ops = { .remain_on_channel = ath12k_mac_op_remain_on_channel, .cancel_remain_on_channel = ath12k_mac_op_cancel_remain_on_channel, .change_sta_links = ath12k_mac_op_change_sta_links, + .can_activate_links = ath12k_mac_op_can_activate_links, #ifdef CONFIG_PM .suspend = ath12k_wow_op_suspend, .resume = ath12k_wow_op_resume, From patchwork Wed Dec 11 15:43:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 13903688 X-Patchwork-Delegate: quic_jjohnson@quicinc.com Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8CFAD1DA2F6 for ; Wed, 11 Dec 2024 15:44:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733931844; cv=none; b=rMOmnswDLKALfsSPrTm2I48PsQQL6wjeMA7/CiV+BmTqYAoCXB1C53cthdTC4Bz7MOxaSsi2zGb98XrNX3Ezbvr7l1bQ0zifrOUnLC/A7aodF3JnBV9jGzV3G4uuV/SMkl3ItFmEB+EiXMU1pCZ0iZ+asdm2OqCnQP7iIWyBjKg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733931844; c=relaxed/simple; bh=MMyJbEcUHzrIKi7CjVCmfdUa1sE8p9dCS1p8++sK2r4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=Az3gAsW32WIQ7CYjSTPbXn5sLi69BbDDpVh5lWvfFCq4itahYJz0uxd6L0r6AJNbN85CmKk0Bczd2SVroTQ7kqPwGAMq2FhdILmpIUTpfzHQ5scrOdTxN5lxvIVVK51BX/yvmiZP0RxtjM1qffcyJaBzOzx7w6ZEbpvM8J/X7jA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ggnc1NYM; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ggnc1NYM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A58DC4CED2; Wed, 11 Dec 2024 15:44:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733931844; bh=MMyJbEcUHzrIKi7CjVCmfdUa1sE8p9dCS1p8++sK2r4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ggnc1NYMuAqQ+Z9tiDUvQWzPpf4ju8Pyx+yEl8holSsbLhxgwXuTmno3ERZ78ugTf Y232nD/LPRI+r+G9imG420E1MWrOyxPKJQFn0ror7tHnwVlRk6pr3g0rhfgBQbCg4O Nv4OZFQc/vy+sdTppsxECvjflkbNhepj/Ubm+Tt8BN+52kyPuqqHqdRAQ8iqjj/E0p zPMPERnM55vKsSKw3jd64xHP2eNlZ1yuM6TUERxtf4PgDgjwyZICUGXmdxX+Vl+ziF 77gZs4QQIbfaVkhRTeWrNGDgAdYeiPOBwcjEfmtH7f1ND0kvn/LiINBVDweXz1HLGz 0PNWP0fy/7AJQ== From: Kalle Valo To: ath12k@lists.infradead.org Cc: linux-wireless@vger.kernel.org Subject: [PATCH 3/7] wifi: ath12k: add no-op without debug print in WMI Rx event Date: Wed, 11 Dec 2024 17:43:54 +0200 Message-Id: <20241211154358.776279-4-kvalo@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241211154358.776279-1-kvalo@kernel.org> References: <20241211154358.776279-1-kvalo@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Aditya Kumar Singh Currently, certain WMI events are frequently received by the host. Since the host lacks the logic to process these events, the console is flooded with ‘Unknown eventid:’ debug messages. To address this, handle these events gracefully without printing debug messages. There is already a block of event IDs that are ignored with a debug print. However, this new type of event occurs more frequently, so no debug print is necessary, and handling it should be a no-op. While at it, re-arrange the code so that all Unknown event IDs are towards the end of the switch block. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Signed-off-by: Aditya Kumar Singh Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath12k/wmi.c | 20 +++++++++++++------- drivers/net/wireless/ath/ath12k/wmi.h | 5 +++++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c index e9bda625e9a7..cf5c3efec4b7 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.c +++ b/drivers/net/wireless/ath/ath12k/wmi.c @@ -7505,13 +7505,6 @@ static void ath12k_wmi_op_rx(struct ath12k_base *ab, struct sk_buff *skb) case WMI_P2P_NOA_EVENTID: ath12k_wmi_p2p_noa_event(ab, skb); break; - /* add Unsupported events here */ - case WMI_TBTTOFFSET_EXT_UPDATE_EVENTID: - case WMI_PEER_OPER_MODE_CHANGE_EVENTID: - case WMI_PDEV_DMA_RING_CFG_RSP_EVENTID: - ath12k_dbg(ab, ATH12K_DBG_WMI, - "ignoring unsupported event 0x%x\n", id); - break; case WMI_PDEV_DFS_RADAR_DETECTION_EVENTID: ath12k_wmi_pdev_dfs_radar_detected_event(ab, skb); break; @@ -7533,6 +7526,19 @@ static void ath12k_wmi_op_rx(struct ath12k_base *ab, struct sk_buff *skb) case WMI_MLO_TEARDOWN_COMPLETE_EVENTID: ath12k_wmi_event_teardown_complete(ab, skb); break; + /* add Unsupported events (rare) here */ + case WMI_TBTTOFFSET_EXT_UPDATE_EVENTID: + case WMI_PEER_OPER_MODE_CHANGE_EVENTID: + case WMI_PDEV_DMA_RING_CFG_RSP_EVENTID: + ath12k_dbg(ab, ATH12K_DBG_WMI, + "ignoring unsupported event 0x%x\n", id); + break; + /* add Unsupported events (frequent) here */ + case WMI_PDEV_GET_HALPHY_CAL_STATUS_EVENTID: + case WMI_MGMT_RX_FW_CONSUMED_EVENTID: + case WMI_OBSS_COLOR_COLLISION_DETECTION_EVENTID: + /* debug might flood hence silently ignore (no-op) */ + break; /* TODO: Add remaining events */ default: ath12k_dbg(ab, ATH12K_DBG_WMI, "Unknown eventid: 0x%x\n", id); diff --git a/drivers/net/wireless/ath/ath12k/wmi.h b/drivers/net/wireless/ath/ath12k/wmi.h index 270ed458302e..cd3de0a65543 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.h +++ b/drivers/net/wireless/ath/ath12k/wmi.h @@ -711,6 +711,8 @@ enum wmi_tlv_event_id { WMI_PDEV_RAP_INFO_EVENTID, WMI_CHAN_RF_CHARACTERIZATION_INFO_EVENTID, WMI_SERVICE_READY_EXT2_EVENTID, + WMI_PDEV_GET_HALPHY_CAL_STATUS_EVENTID = + WMI_SERVICE_READY_EXT2_EVENTID + 4, WMI_VDEV_START_RESP_EVENTID = WMI_TLV_CMD(WMI_GRP_VDEV), WMI_VDEV_STOPPED_EVENTID, WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID, @@ -752,6 +754,7 @@ enum wmi_tlv_event_id { WMI_TBTTOFFSET_EXT_UPDATE_EVENTID, WMI_OFFCHAN_DATA_TX_COMPLETION_EVENTID, WMI_HOST_FILS_DISCOVERY_EVENTID, + WMI_MGMT_RX_FW_CONSUMED_EVENTID = WMI_HOST_FILS_DISCOVERY_EVENTID + 3, WMI_TX_DELBA_COMPLETE_EVENTID = WMI_TLV_CMD(WMI_GRP_BA_NEG), WMI_TX_ADDBA_COMPLETE_EVENTID, WMI_BA_RSP_SSN_EVENTID, @@ -850,6 +853,8 @@ enum wmi_tlv_event_id { WMI_MDNS_STATS_EVENTID = WMI_TLV_CMD(WMI_GRP_MDNS_OFL), WMI_SAP_OFL_ADD_STA_EVENTID = WMI_TLV_CMD(WMI_GRP_SAP_OFL), WMI_SAP_OFL_DEL_STA_EVENTID, + WMI_OBSS_COLOR_COLLISION_DETECTION_EVENTID = + WMI_EVT_GRP_START_ID(WMI_GRP_OBSS_OFL), WMI_OCB_SET_CONFIG_RESP_EVENTID = WMI_TLV_CMD(WMI_GRP_OCB), WMI_OCB_GET_TSF_TIMER_RESP_EVENTID, WMI_DCC_GET_STATS_RESP_EVENTID, From patchwork Wed Dec 11 15:43:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 13903689 X-Patchwork-Delegate: quic_jjohnson@quicinc.com Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 993801DE2C5 for ; Wed, 11 Dec 2024 15:44:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733931845; cv=none; b=G6d7WqSfb5BFEcRWi/vOB51BmirWDLdzwwnD1jSgvGZM3J1wONuCSkjEbye9xBfHqZ1975Eit+XlEg7wXCmPeAbZ7mc4TblhhG1c4RAQ23lmi7VQqd703qTWt/xviyXO3xBxId2Hor1/xykKaeW1lF2NdX7RfTwQjZrD+314wSE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733931845; c=relaxed/simple; bh=I4xxAW21GFTuI4CUQmeQKcvHy+yndUU+jz/ZTGh9zCU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pO/WF7xZzv/B6gxK0dpq/0BhF7um8M+dI7w5jVLuvS0riBgRs5M7xWytz8Z/Vu947goDQP0izGpQ5xTFhIkse3QD/nhtdNM7TRkpM4mgbbMJgOSPM9BALExHlq3Q7z41llD34igOcTHbuJE+vIYqeSZzUpG30mWzN7kAY+obvJw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jxAMv7Pf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jxAMv7Pf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 965A1C4CED7; Wed, 11 Dec 2024 15:44:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733931845; bh=I4xxAW21GFTuI4CUQmeQKcvHy+yndUU+jz/ZTGh9zCU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jxAMv7Pf79YYiBU/4FFjsbBK4YSBwKxzLYBX8GTC3tN3d0ZsIQctk51IL+5jSoD+6 7MBhTz+U1KwGGzV53AiC6Pp8oXMG8EsYJj9npc7lApiyVtdDyMNssLaNLIAz/TgXT5 MeL646+rvB6biFOvt7t7K5P5xNtuv3WRzURUnVHCPieK1Q37wGc4QtDnbD6Bz6Z4NW HKq3CE20ywpBDpjCd7qj0PDZrX40JRPK5kFsRRht0WhpZBrmQ3BAipUS0OR2eicyxc RfJ2jI9IkS7OSViC5m0CE0Mv/V3nsg5/0cfeXJOTPYNBiMBOzlSxQpNy0fs2bRSBT+ EBm3pxEL4TrZA== From: Kalle Valo To: ath12k@lists.infradead.org Cc: linux-wireless@vger.kernel.org Subject: [PATCH 4/7] wifi: ath12k: remove warning print in htt mlo offset event message Date: Wed, 11 Dec 2024 17:43:55 +0200 Message-Id: <20241211154358.776279-5-kvalo@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241211154358.776279-1-kvalo@kernel.org> References: <20241211154358.776279-1-kvalo@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Aditya Kumar Singh In the function ath12k_htt_mlo_offset_event_handler(), it is possible that the ar is not yet active (started). The function ath12k_mac_get_ar_by_pdev_id() only searches for active pdev, so a NULL return is possible. Therefore, there is no need to print a warning, instead, just silently discard the message. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Signed-off-by: Aditya Kumar Singh Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath12k/dp_rx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c index 1cc7f6ce55b9..a05384288b5a 100644 --- a/drivers/net/wireless/ath/ath12k/dp_rx.c +++ b/drivers/net/wireless/ath/ath12k/dp_rx.c @@ -1697,7 +1697,11 @@ static void ath12k_htt_mlo_offset_event_handler(struct ath12k_base *ab, rcu_read_lock(); ar = ath12k_mac_get_ar_by_pdev_id(ab, pdev_id); if (!ar) { - ath12k_warn(ab, "invalid pdev id %d on htt mlo offset\n", pdev_id); + /* It is possible that the ar is not yet active (started). + * The above function will only look for the active pdev + * and hence %NULL return is possible. Just silently + * discard this message + */ goto exit; } From patchwork Wed Dec 11 15:43:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 13903690 X-Patchwork-Delegate: quic_jjohnson@quicinc.com Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCED21DE2D7 for ; Wed, 11 Dec 2024 15:44:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733931846; cv=none; b=DjClpDk4RU7rRwGc00brsTFvT027TWCpQ4sEZt9F4cW7s2G8u91B4uFXsUJLbtaAd7NnX0EjCY9iiUVzAdfh7R/Zo0W82Mz54O6q6r9hDSs25zxHI7mdpLIAm4BSeFZ3H8/r40TkbyUt4mLjnCi+Jm/4rQ58tWUMqoy0dPVME9A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733931846; c=relaxed/simple; bh=7mKNlD/JX6tFo+pUM3mK0HTaLKCi/W316Selsy7IXGk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=l5AOa7eh7lVi9AwI5yHIotEABuku5i9L2sJARbfC8uKWDNR6sCRy7eRv9ZPI0n6BRsxgkOWQpnWE5W8U+m7lyBW1EhdWoWAkMikPXD3Vk6V1pP4Ou37PmbN26e0UW88Kyx0tiSE2Xe/LU1s+jJliWuH3/sBLNkp2cdu+LhMxbC4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bbiU8mAC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bbiU8mAC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A20E4C4CED4; Wed, 11 Dec 2024 15:44:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733931846; bh=7mKNlD/JX6tFo+pUM3mK0HTaLKCi/W316Selsy7IXGk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bbiU8mACVVCnsAl9vrxjdbZRgm11ISXKZscoIwm+0sANU6DJf6qpHb5AHVtz2vclV iH2kRidbSszQovCFdd1QYr8K+9UTv0dWYCm1fwDxyKniaaFETOW8zmfTayj3XhusCG o2jE97RARQzLnZ/VnuIinG7Q8RP7w+RH2XRR6BwdZdTtgfJ+s38tGxW8HhGhRBh49P e3JFBZbjwriUIudMnlHEpj4IBD1NK5dvFCfVEep3I55JaJHx8nU0o16O3bMGVY3G95 VDtsuAxos8zU+Cn4DpuosX/dIAfpO+K5oyWnjATVZL9aE30a8UYFZ6Zk720jFAIzkQ w0HD4JXg/mxEw== From: Kalle Valo To: ath12k@lists.infradead.org Cc: linux-wireless@vger.kernel.org Subject: [PATCH 5/7] wifi: ath12k: add ATH12K_FW_FEATURE_MLO capability firmware feature Date: Wed, 11 Dec 2024 17:43:56 +0200 Message-Id: <20241211154358.776279-6-kvalo@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241211154358.776279-1-kvalo@kernel.org> References: <20241211154358.776279-1-kvalo@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Aditya Kumar Singh To maintain backward compatibility with older firmware versions, introduce a new feature bit, ATH12K_FW_FEATURE_MLO, to identify whether the firmware supports MLO. If the firmware-X.bin does not have this bit advertised in the feature, then MLO capability in the host will be disabled. This applies only for QCN9274 chipsets. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Signed-off-by: Aditya Kumar Singh Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath12k/core.c | 34 +++++++++++++++++++++++--- drivers/net/wireless/ath/ath12k/fw.h | 3 +++ 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c index ff79cb910523..0c6b35aac96e 100644 --- a/drivers/net/wireless/ath/ath12k/core.c +++ b/drivers/net/wireless/ath/ath12k/core.c @@ -1782,6 +1782,9 @@ static int ath12k_core_hw_group_create(struct ath12k_hw_group *ag) void ath12k_core_hw_group_set_mlo_capable(struct ath12k_hw_group *ag) { + struct ath12k_base *ab; + int i; + lockdep_assert_held(&ag->mutex); /* If more than one devices are grouped, then inter MLO @@ -1790,10 +1793,35 @@ void ath12k_core_hw_group_set_mlo_capable(struct ath12k_hw_group *ag) * Only when there is one device, then it depends whether the * device can support intra chip MLO or not */ - if (ag->num_devices > 1) + if (ag->num_devices > 1) { ag->mlo_capable = true; - else - ag->mlo_capable = ag->ab[0]->single_chip_mlo_supp; + } else { + ab = ag->ab[0]; + ag->mlo_capable = ab->single_chip_mlo_supp; + + /* WCN chipsets does not advertise in firmware features + * hence skip checking + */ + if (ab->hw_params->def_num_link) + return; + } + + if (!ag->mlo_capable) + return; + + for (i = 0; i < ag->num_devices; i++) { + ab = ag->ab[i]; + if (!ab) + continue; + + /* even if 1 device's firmware feature indicates MLO + * unsupported, make MLO unsupported for the whole group + */ + if (!test_bit(ATH12K_FW_FEATURE_MLO, ab->fw.fw_features)) { + ag->mlo_capable = false; + return; + } + } } int ath12k_core_init(struct ath12k_base *ab) diff --git a/drivers/net/wireless/ath/ath12k/fw.h b/drivers/net/wireless/ath/ath12k/fw.h index 3ff041f15fa0..273c003eff3b 100644 --- a/drivers/net/wireless/ath/ath12k/fw.h +++ b/drivers/net/wireless/ath/ath12k/fw.h @@ -23,6 +23,9 @@ enum ath12k_fw_features { */ ATH12K_FW_FEATURE_MULTI_QRTR_ID = 0, + /* The firmware supports MLO capability */ + ATH12K_FW_FEATURE_MLO, + /* keep last */ ATH12K_FW_FEATURE_COUNT, }; From patchwork Wed Dec 11 15:43:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 13903691 X-Patchwork-Delegate: quic_jjohnson@quicinc.com Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 644CE1DE3A8 for ; Wed, 11 Dec 2024 15:44:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733931847; cv=none; b=PTRWdh80OozGr6C+23Uu3CSuGTRbsoio72ddP2ePJ5z4te2/ueK0Lo1SejXcnREqkLYEUJSJTrYvAvvYxT4sE/lI8xZ0IFu6Tre4mpccvvXEtL7dV+zwutkV6Si3p+B5PjvxxsUyADnJgIBn2HJSI8LsKrM3ow6oTwyFJNLzk0k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733931847; c=relaxed/simple; bh=Hfyh1P1T8PnNyeOa9NdDUZS6hQpbgTvD+7AaZSzOHqg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kS6JHcx+kwZoKVguF33C//7McvPRa41F8yWFN2m8pdlQCx9BAbTu8X/eA/2xK9NrDRFO3ZxYdSIepYJP5zF+kn/b3fg+sYWBGBw2QPGVPA/GpSlUPMc9NLtYUV6EYGfLxWjk0Gc5ahuWM1FA/7KxtI1OZyAeIgeuPz/JcKzJH5Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lIFDGkSa; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lIFDGkSa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE0F0C4CED2; Wed, 11 Dec 2024 15:44:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733931847; bh=Hfyh1P1T8PnNyeOa9NdDUZS6hQpbgTvD+7AaZSzOHqg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lIFDGkSax7ODMOIuFeVzzjYgYR9Rds7BDNJqnCo0jtGlfoJubxt2L/20T3DgU2tJi C0Ev9IJZf3pUa2UPpxTD8VhSxp3u+Lyve2wEmr0L2kDTVmEyI1XjSHg9OSc88eGSx9 vlNT3vGAAT7X8PGPTgPUZtJ/ggZJJBkYDD7f2xvfwmBsIF1XKBs0/kRpIbBSeRk9h2 1ei7wuipOB22M7xb+7r/6CPN/z09zw4jaStru7zOgeFu0yf6SoHggrOyHguA/AFeCx H/IpjGOMXydft5f2zeE9f1yszTxyCIFIo/Pe3d2ImAeLfUAwqaa2IB8qzcjvTE3w6T GYgrUTZ2yoKuQ== From: Kalle Valo To: ath12k@lists.infradead.org Cc: linux-wireless@vger.kernel.org Subject: [PATCH 6/7] wifi: ath12k: assign unique hardware link IDs during QMI host cap Date: Wed, 11 Dec 2024 17:43:57 +0200 Message-Id: <20241211154358.776279-7-kvalo@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241211154358.776279-1-kvalo@kernel.org> References: <20241211154358.776279-1-kvalo@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Aditya Kumar Singh Currently, in the QMI host capability, the device index, the number of local links, and the corresponding hardware link IDs are sent. The hardware link ID assignment is based on the local variable `hw_link_id`, which starts from 0 and ranges up to `num_local_links` in the device. Starting from 0 is not ideal because it can result in the same link ID being assigned to different devices in certain scenarios (e.g., split MAC). Additionally, for multi link operations the firmware expects the hardware link IDs in the same order as the Wireless Serial Interface (WSI) connection. Hence, for MLO to function seamlessly, the hardware link IDs across devices need to be unique and should follow the order of the WSI connection. To address this, a previous change read the WSI index from the Device Tree (DT) and stored it. Use this WSI index to determine the starting hardware link IDs for each device, ensuring uniqueness and correct order across all devices. While at it, add debug prints to clearly show the MLO capability advertisement sent during QMI host capability exchange. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Signed-off-by: Aditya Kumar Singh Co-developed-by: Raj Kumar Bhagat Signed-off-by: Raj Kumar Bhagat Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath12k/core.h | 2 ++ drivers/net/wireless/ath/ath12k/qmi.c | 35 +++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h index 9aed24597548..d07b54f441c3 100644 --- a/drivers/net/wireless/ath/ath12k/core.h +++ b/drivers/net/wireless/ath/ath12k/core.h @@ -863,11 +863,13 @@ struct ath12k_hw_group { struct device_node *wsi_node[ATH12K_MAX_SOCS]; struct ath12k_mlo_memory mlo_mem; struct ath12k_hw_link hw_links[ATH12K_GROUP_MAX_RADIO]; + bool hw_link_id_init_done; }; /* Holds WSI info specific to each device, excluding WSI group info */ struct ath12k_wsi_info { u32 index; + u32 hw_link_id_base; }; /* Master structure to hold the hw data which may be used in core module */ diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c index 964d350be748..a8ed86a294c3 100644 --- a/drivers/net/wireless/ath/ath12k/qmi.c +++ b/drivers/net/wireless/ath/ath12k/qmi.c @@ -2016,6 +2016,30 @@ static const struct qmi_elem_info qmi_wlanfw_wlan_ini_resp_msg_v01_ei[] = { }, }; +static void ath12k_host_cap_hw_link_id_init(struct ath12k_hw_group *ag) +{ + struct ath12k_base *ab, *partner_ab; + int i, j, hw_id_base; + + for (i = 0; i < ag->num_devices; i++) { + hw_id_base = 0; + ab = ag->ab[i]; + + for (j = 0; j < ag->num_devices; j++) { + partner_ab = ag->ab[j]; + + if (partner_ab->wsi_info.index >= ab->wsi_info.index) + continue; + + hw_id_base += partner_ab->qmi.num_radios; + } + + ab->wsi_info.hw_link_id_base = hw_id_base; + } + + ag->hw_link_id_init_done = true; +} + static int ath12k_host_cap_parse_mlo(struct ath12k_base *ab, struct qmi_wlanfw_host_cap_req_msg_v01 *req) { @@ -2059,8 +2083,14 @@ static int ath12k_host_cap_parse_mlo(struct ath12k_base *ab, req->mlo_num_chips_valid = 1; req->mlo_num_chips = ag->num_devices; + ath12k_dbg(ab, ATH12K_DBG_QMI, "mlo capability advertisement device_id %d group_id %d num_devices %d", + req->mlo_chip_id, req->mlo_group_id, req->mlo_num_chips); + mutex_lock(&ag->mutex); + if (!ag->hw_link_id_init_done) + ath12k_host_cap_hw_link_id_init(ag); + for (i = 0; i < ag->num_devices; i++) { info = &req->mlo_chip_info[i]; partner_ab = ag->ab[i]; @@ -2078,9 +2108,12 @@ static int ath12k_host_cap_parse_mlo(struct ath12k_base *ab, info->chip_id, info->num_local_links); for (j = 0; j < info->num_local_links; j++) { - info->hw_link_id[j] = hw_link_id; + info->hw_link_id[j] = partner_ab->wsi_info.hw_link_id_base + j; info->valid_mlo_link_id[j] = 1; + ath12k_dbg(ab, ATH12K_DBG_QMI, "mlo hw_link_id %d\n", + info->hw_link_id[j]); + hw_link_id++; } } From patchwork Wed Dec 11 15:43:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 13903692 X-Patchwork-Delegate: quic_jjohnson@quicinc.com Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3AA71DE2D2 for ; Wed, 11 Dec 2024 15:44:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733931848; cv=none; b=BP/k0ossmXwsnpt7LJRCcgzhpcPoRhNjWHZ4P2Il1USceV05+kXKtEto69OgT8iZLZi1AEXq8JW/Mj8wqy4EjU83mYnDbbzmHo8Q6NdEbdML6TIk4jEbpWVtB/5EyNxCvLFsBLh0u2p8efRyZUbEFLWBxCwRxPnnn7zShNdHnqc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733931848; c=relaxed/simple; bh=DqTLVZV8zhZm7A0j4ZOugixaSJ2bB+fdZrrezCoitM0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pfZMhbNBoHuoZP9ZXo6jXutThCOnoxVaQxBO9DvdjwjdIWBYM99Sr8O8SGeaRMOiTehUH7pypekOutZvBIrrPsAhwR+VnUv/GLOdGS7Da8L1+1T4oA3dFma4LFz02ctiVFMY7ExPW78pbcThI17CK8LBWpfss+213KJhF8g33S0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FZ80JkXI; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FZ80JkXI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BAD36C4CED2; Wed, 11 Dec 2024 15:44:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733931848; bh=DqTLVZV8zhZm7A0j4ZOugixaSJ2bB+fdZrrezCoitM0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FZ80JkXIANerCjMjx2RphwRXmPF3UmXgh4OF0iXi1G81SZ8RqOhD+TJtlKcXqQ1J9 3Z+mfDJXfEx+hPZHI2JBsM9729ox5LkSrqzo+4RnvPcQOIMBeV6GHChTPOscnUjepI ZSZ2qn5zOWeLEuhxqnD6WHDgRzxUo1qHuC01fHrE0qxz9wjs835NN68mRBQxzaJjYz PJjwXieUgXX8iu0IAmbar57/xlJVa++E68TWTFrIahs6Kdqwe8yvtQH9B6d4zJNsRW gdNeI64ixHbuSyuXXF5aJNaj6vaA3H5AMfO1rVu9x46qZG4YrJO9VL9+bxtHyTA0Yc nfxxPiDdmJ2Cw== From: Kalle Valo To: ath12k@lists.infradead.org Cc: linux-wireless@vger.kernel.org Subject: [PATCH 7/7] wifi: ath12k: advertise MLO support and capabilities Date: Wed, 11 Dec 2024 17:43:58 +0200 Message-Id: <20241211154358.776279-8-kvalo@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241211154358.776279-1-kvalo@kernel.org> References: <20241211154358.776279-1-kvalo@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Rameshkumar Sundaram Now everything in ath12k is in place and we can enable Multi-Link Operation (MLO) in the driver. For now it's only enabled for QCN9274 with firmware having ATH12K_FW_FEATURE_MLO feature bit set. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Signed-off-by: Rameshkumar Sundaram Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath12k/core.h | 2 ++ drivers/net/wireless/ath/ath12k/mac.c | 13 ++++++++++++- drivers/net/wireless/ath/ath12k/wmi.c | 3 +++ drivers/net/wireless/ath/ath12k/wmi.h | 2 ++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h index d07b54f441c3..ec61ad3d82c3 100644 --- a/drivers/net/wireless/ath/ath12k/core.h +++ b/drivers/net/wireless/ath/ath12k/core.h @@ -773,6 +773,8 @@ struct ath12k_pdev_cap { u32 tx_chain_mask_shift; u32 rx_chain_mask_shift; struct ath12k_band_cap band[NUM_NL80211_BANDS]; + u32 eml_cap; + u32 mld_cap; }; struct mlo_timestamp { diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 7962bfa955ba..6c20c71ada62 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -10693,7 +10693,7 @@ static const u8 ath12k_if_types_ext_capa_ap[] = { [10] = WLAN_EXT_CAPA11_EMA_SUPPORT, }; -static const struct wiphy_iftype_ext_capab ath12k_iftypes_ext_capa[] = { +static struct wiphy_iftype_ext_capab ath12k_iftypes_ext_capa[] = { { .extended_capabilities = ath12k_if_types_ext_capa, .extended_capabilities_mask = ath12k_if_types_ext_capa, @@ -10710,6 +10710,8 @@ static const struct wiphy_iftype_ext_capab ath12k_iftypes_ext_capa[] = { .extended_capabilities_mask = ath12k_if_types_ext_capa_ap, .extended_capabilities_len = sizeof(ath12k_if_types_ext_capa_ap), + .eml_capabilities = 0, + .mld_capa_and_ops = 0, }, }; @@ -10919,6 +10921,15 @@ static int ath12k_mac_hw_register(struct ath12k_hw *ah) */ wiphy->flags |= WIPHY_FLAG_DISABLE_WEXT; + /* Copy over MLO related capabilities received from + * WMI_SERVICE_READY_EXT2_EVENT if single_chip_mlo_supp is set. + */ + if (ab->ag->mlo_capable) { + ath12k_iftypes_ext_capa[2].eml_capabilities = cap->eml_cap; + ath12k_iftypes_ext_capa[2].mld_capa_and_ops = cap->mld_cap; + wiphy->flags |= WIPHY_FLAG_SUPPORTS_MLO; + } + hw->queues = ATH12K_HW_MAX_QUEUES; wiphy->tx_queue_len = ATH12K_QUEUE_LEN; hw->offchannel_tx_hw_queue = ATH12K_HW_MAX_QUEUES - 1; diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c index cf5c3efec4b7..7b3597061b34 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.c +++ b/drivers/net/wireless/ath/ath12k/wmi.c @@ -4662,6 +4662,9 @@ ath12k_wmi_tlv_mac_phy_caps_ext_parse(struct ath12k_base *ab, caps->eht_cap_info_internal); } + pdev->cap.eml_cap = le32_to_cpu(caps->eml_capability); + pdev->cap.mld_cap = le32_to_cpu(caps->mld_capability); + return 0; } diff --git a/drivers/net/wireless/ath/ath12k/wmi.h b/drivers/net/wireless/ath/ath12k/wmi.h index cd3de0a65543..b6a197389277 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.h +++ b/drivers/net/wireless/ath/ath12k/wmi.h @@ -2716,6 +2716,8 @@ struct ath12k_wmi_caps_ext_params { __le32 eht_cap_info_internal; __le32 eht_supp_mcs_ext_2ghz[WMI_MAX_EHT_SUPP_MCS_2G_SIZE]; __le32 eht_supp_mcs_ext_5ghz[WMI_MAX_EHT_SUPP_MCS_5G_SIZE]; + __le32 eml_capability; + __le32 mld_capability; } __packed; /* 2 word representation of MAC addr */