Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2916561rdb; Tue, 6 Feb 2024 01:23:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IGZPViNvaylZUya3qE2NSNTr6rxe5YGMwE0Wz0dw8CmcvMYtizgKP/ZRevlRzcVh7n12GJI X-Received: by 2002:a0c:f082:0:b0:68c:a7da:7285 with SMTP id g2-20020a0cf082000000b0068ca7da7285mr1340989qvk.40.1707211392505; Tue, 06 Feb 2024 01:23:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707211392; cv=pass; d=google.com; s=arc-20160816; b=oeBVx5tpp1Flu1B5h3lfXgWY5L6heXJymRb1bO8lMrXpsfvOmdKQ9NnWaSEloA4oOT 28BS2D15H7HibrPEaEhqbqJTmhhcy4AXGy46KpYra6NJGAvcijcrl16WcMlziTaPqHfA 0GfBc4fieKW9CSzxbfRg2Wd875vZWcAT/Z1hkPrQqyNKqSU6U4i0wJELIPwmYO9DdZls 1EbZBlLtv5FRn5DcjaHBzlYW4iFGn5WG5RsEUQhLrneHkBBIvQMidC+O1ntH+jE2zugT Xmqit3hZi6vUFlK8qtllaYs1czSc4X7HxPVWM5L+aUgCWBcXI77tM1UgroEeUN30oF8x 8qjA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=tHkWseutCdgNyUruY5Alxo1qwcln4362ES9gewgFg8A=; fh=p4LxRB1/gwpU5qSmurVZLGKFLR5M8+iabBjLYYT9EB0=; b=z82DilQRsCIsA8uKi9bFcTmx4qy9ItOZXzluS1K7zC2d91nOsb6yPq4Nbod6TDuHw0 +REALZCSq/iInBtPu4TpWYbVkYWvZ3MFAeRVLZLP6LrG9UHiGVu/1Lsw0dAf5qJtl/Gb ioHpsOBqfs7V4J11dOK/1mZc2DckT/X+NowaYVg9H8XKbbEHN+6Md4FVId2VwQrRwxG3 SArV32nz+5oua2vlp+mgIG5QCfoKvBPakID6Vcp3nEIOv05pudMOBccWIpVyII8gz5pr UNWqKMvj9XWEQq3lbOKmP6vHCrb5m7NJZk29EFFCp1R14/Yl2mvW2df06Wh9FMzsoIQ5 UeIg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=H8J8UiNq; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-3205-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3205-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=1; AJvYcCWcoSKN9g3mGzF+QCqdjOGjyZJD+UdG+I5FIarJ/KDNgvcvrDAcYzAwqy0hJRTu29LLr1dkVsDovoe2mtNaW8qCTQraFOpj/lLT5mbyQw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id cz3-20020a056214088300b0068c544178c7si1935614qvb.465.2024.02.06.01.23.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 01:23:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3205-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=H8J8UiNq; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-3205-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3205-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2EFB81C22901 for ; Tue, 6 Feb 2024 09:23:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA5F812E1FF; Tue, 6 Feb 2024 09:22:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="H8J8UiNq" X-Original-To: linux-wireless@vger.kernel.org Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 22E6812D142 for ; Tue, 6 Feb 2024 09:21:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707211321; cv=none; b=SIg4goYccLnK3Feu7v4KGAQGEBfpOK1iDoftfEVHPbw5S/HAXyZYHfgSs+T43VVDPtPtLcsVhQap6Ln9yoC3kOh8b/rXs1S4bW+HNM1hoObt0NIteZNnP2XsACbEwkqOoMu+FW5g6BZ+JNurTAI8idyhlJzm9vSrPGKXahS9KmU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707211321; c=relaxed/simple; bh=AXhOwg6esfWlwknCnpB7OoSbnpPDfLBzC/nAtYiKQpI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Hz6ru8H/ZtIAKdaIGmP7BtBcnPcVdSn+5/BVFHKBm1iArMoCI0YN9BvGCdjL645Ulahu/0YkEcEHoszq4saprbegV6Y0fIsVlJ7mO2WSc1wTu8TDQieTE5hFEBRwgYsd2sfKpdR46e/hDpavzN6p7k3qbeBHNszkhe3gRNugveQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=H8J8UiNq; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4169L9pb023425; Tue, 6 Feb 2024 09:21:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=tHkWseutCdgNyUruY5Alxo1qwcln4362ES9gewgFg8A=; b=H8 J8UiNqqegISvlT0abIDjzJbNfgF49akGG2zZUqJYe7cDambUAT1Ij5sOYdH7fSUl +wy6P3/XhiEdN2eeBdCQlb/P2f1G8G5EDeiGU1GgKtv/Pa5X6KICY0klMY9L963z vIsSvzXzKGwWHyZtjzdPvX90VRRwyrU8EWGdfDmihiO+1z5dw9ia4ncp1Uh8dnWL gDEgeuUXI2R2zcR8PWm8xkqCznziCgLdpaI2+sJbGCy1T82sCRMkDKhyKkk+Ftwn n/w1oadYWn67PXy22JHic3q7ECAMoYeVMB50oPWwA4RuVvmZCW/0jZu6CCWoOOZU fGQslqNidpsAOdREh9dA== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w3apjgut9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 06 Feb 2024 09:21:53 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 4169Lq1v006845 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 6 Feb 2024 09:21:52 GMT Received: from hu-ramess-blr.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 6 Feb 2024 01:21:50 -0800 From: Rameshkumar Sundaram To: CC: , Sriram R , Rameshkumar Sundaram Subject: [PATCH v2 08/12] wifi: ath12k: Add additional checks for vif and sta iterators Date: Tue, 6 Feb 2024 14:49:50 +0530 Message-ID: <20240206091954.4144454-9-quic_ramess@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240206091954.4144454-1-quic_ramess@quicinc.com> References: <20240206091954.4144454-1-quic_ramess@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 81ASiM8WVZw6MQV1WS2o86JjgmQ3CCPn X-Proofpoint-GUID: 81ASiM8WVZw6MQV1WS2o86JjgmQ3CCPn X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-06_02,2024-01-31_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=654 mlxscore=0 phishscore=0 priorityscore=1501 bulkscore=0 suspectscore=0 adultscore=0 clxscore=1015 lowpriorityscore=0 spamscore=0 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401310000 definitions=main-2402060064 From: Sriram R Since vif and sta objects of different radios are added to same local hw list in mac80211, additional checks need to be done in driver to ensure we are processing the intended vif and sta corresponding to the radio when the vif and sta mac80211 iterator utils are used from driver. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-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: Sriram R Signed-off-by: Rameshkumar Sundaram --- drivers/net/wireless/ath/ath12k/core.h | 1 + drivers/net/wireless/ath/ath12k/mac.c | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h index 009d7b50b5a0..d41f8e5915f6 100644 --- a/drivers/net/wireless/ath/ath12k/core.h +++ b/drivers/net/wireless/ath/ath12k/core.h @@ -290,6 +290,7 @@ struct ath12k_vif { struct ath12k_vif_iter { u32 vdev_id; + struct ath12k *ar; struct ath12k_vif *arvif; }; diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 618c75d50547..631b24c6e435 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -533,7 +533,8 @@ static void ath12k_get_arvif_iter(void *data, u8 *mac, struct ath12k_vif_iter *arvif_iter = data; struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif); - if (arvif->vdev_id == arvif_iter->vdev_id) + if (arvif->vdev_id == arvif_iter->vdev_id && + arvif->ar == arvif_iter->ar) arvif_iter->arvif = arvif; } @@ -543,6 +544,7 @@ struct ath12k_vif *ath12k_mac_get_arvif(struct ath12k *ar, u32 vdev_id) u32 flags; arvif_iter.vdev_id = vdev_id; + arvif_iter.ar = ar; flags = IEEE80211_IFACE_ITER_RESUME_ALL; ieee80211_iterate_active_interfaces_atomic(ath12k_ar_to_hw(ar), @@ -6678,14 +6680,19 @@ struct ath12k_mac_change_chanctx_arg { struct ieee80211_vif_chanctx_switch *vifs; int n_vifs; int next_vif; + struct ath12k *ar; }; static void ath12k_mac_change_chanctx_cnt_iter(void *data, u8 *mac, struct ieee80211_vif *vif) { + struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif); struct ath12k_mac_change_chanctx_arg *arg = data; + if (arvif->ar != arg->ar) + return; + if (rcu_access_pointer(vif->bss_conf.chanctx_conf) != arg->ctx) return; @@ -6696,9 +6703,13 @@ static void ath12k_mac_change_chanctx_fill_iter(void *data, u8 *mac, struct ieee80211_vif *vif) { + struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif); struct ath12k_mac_change_chanctx_arg *arg = data; struct ieee80211_chanctx_conf *ctx; + if (arvif->ar != arg->ar) + return; + ctx = rcu_access_pointer(vif->bss_conf.chanctx_conf); if (ctx != arg->ctx) return; @@ -6815,7 +6826,7 @@ static void ath12k_mac_update_active_vif_chan(struct ath12k *ar, struct ieee80211_chanctx_conf *ctx) { - struct ath12k_mac_change_chanctx_arg arg = { .ctx = ctx }; + struct ath12k_mac_change_chanctx_arg arg = { .ctx = ctx, .ar = ar }; struct ieee80211_hw *hw = ath12k_ar_to_hw(ar); lockdep_assert_held(&ar->conf_mutex); @@ -7391,6 +7402,9 @@ static void ath12k_mac_set_bitrate_mask_iter(void *data, struct ath12k_sta *arsta = ath12k_sta_to_arsta(sta); struct ath12k *ar = arvif->ar; + if (arsta->arvif != arvif) + return; + spin_lock_bh(&ar->data_lock); arsta->changed |= IEEE80211_RC_SUPP_RATES_CHANGED; spin_unlock_bh(&ar->data_lock); @@ -7401,10 +7415,14 @@ static void ath12k_mac_set_bitrate_mask_iter(void *data, static void ath12k_mac_disable_peer_fixed_rate(void *data, struct ieee80211_sta *sta) { + struct ath12k_sta *arsta = ath12k_sta_to_arsta(sta); struct ath12k_vif *arvif = data; struct ath12k *ar = arvif->ar; int ret; + if (arsta->arvif != arvif) + return; + ret = ath12k_wmi_set_peer_param(ar, sta->addr, arvif->vdev_id, WMI_PEER_PARAM_FIXED_RATE, -- 2.25.1