Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp1633407lqz; Mon, 1 Apr 2024 12:05:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXedAGVGygRNyYtyTaQWtuTIrE1Ijl6w1cZ8m6L/bPmoVtQaDn/JH56COhdY/xw0BecHFtoBZ71jnttMwcm+qe7CEap3Le/L3iLD6sWtA== X-Google-Smtp-Source: AGHT+IEBEMd6n2SgtjyBe8VdEKF/VSTE4sxkw31sWnGBiF/Vy1pq1R0DVEVzoAGPBTRbT6cA2ts6 X-Received: by 2002:a17:906:54cf:b0:a4e:99a:960d with SMTP id c15-20020a17090654cf00b00a4e099a960dmr5883230ejp.63.1711998327771; Mon, 01 Apr 2024 12:05:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711998327; cv=pass; d=google.com; s=arc-20160816; b=pinVw5jGfFVhUPaXt8b0u1ZG7YHjBAGLAgVOYPhY4ZkiMdQmp8exGeq513qDI24DTq tgJSZftHs5JgUr17FWJy8RaL+echyZDa2XktgsjCpmVl2LQVvwxdhVz0GJR/+hpziztY xO3Ore7ktqOgFebU7Q0WFomwQ+Vif32bH615pExyV7pQHgUpNnlxUJWohsHWapIEY9pL zZNQl4rbpPO2MzXkFHky7xBEAEAtmJleWYs8hD+KhUojxweHxqUD0eabUUtI71XowR9U n4GzpCLfrJsFWtZ1NDUWR07z3MtVyfoOso86qgf4z2IYcoCNQz1nxFY/svZypvJ2qpWH Ec1g== 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=YOvFbvbunUHIkvG45kRH7qRYCL2dxL/HNgVqr2lJcjA=; fh=hXmvBwTcrACbulhadJq4aGomw93PvN9px3WarQqqC4o=; b=a7fwEfKgufLYxpqZGB+BiDzQlRIT8534DBHRwvqgEqX6cdlH+FpUrKYXmj2Ul9Gsqp mkS2emgFAXbwX0OJr5km/dSUx/ZSgbCF/mlC3XlGhbDddzi2ikZJNNehuzJUUvhigOtU Xe1nZRf9w4oulbZ83+R5MEavI8PeqGb2W+RWiePPiQNJsG8c4xW21tDf4dXWaW3yBQc6 pShhAPfHw1oardYsDDTR9KnjQ7v/oqjAiKI2CDFoh8198zy1dF2fbTwyE+mQM8uHEpW4 oIKP+evefNfIlr01YSM1qHuVfyzkgvsNmTOnSVskfe3dW5jNLZxXRUNKnhgF5zFPfhw5 BgXA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=PZ5KXmZp; 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-5724-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5724-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id hp17-20020a1709073e1100b00a4e65b20b9fsi1509369ejc.78.2024.04.01.12.05.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 12:05:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5724-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=PZ5KXmZp; 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-5724-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5724-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 588621F21CAE for ; Mon, 1 Apr 2024 19:05:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD31C53370; Mon, 1 Apr 2024 19:05:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="PZ5KXmZp" X-Original-To: linux-wireless@vger.kernel.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 141EC5024E for ; Mon, 1 Apr 2024 19:05:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711998318; cv=none; b=tuiGi52t0NfU3bHYdzoi/HUsam4eLcoT5OcDUccWq/UJVr4uE2jQh7xvp5xpmnQ9noZHtuBfvBGD31ot47/h40gIwBDtm+4TAIhM6zYMX1emipEmFiFx/fbIDHkUn5bNPRzYaCS2QybmqToSI8OCsy6pnyw2ScwlDOqNqAW6po4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711998318; c=relaxed/simple; bh=TvK8Bfg8mmXsizvacRSd/Pn7e/UbefnVgOqwToAJX6E=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SzF5PndHbyRFpBAT42E1YiOuFXC0sxRcbrFnmnMSKv2AL9nVzWaOebNcIY8t7DMW4DQvjzl7cHic7fLvdUhFjWYRKwnq7gdqnMI8fZ9s4ui+rkdSpGMJih2sptjU7aiu3nXDxWFDeBeUU6MilVMWIERxT12HXyd4x0nZi8q304w= 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=PZ5KXmZp; arc=none smtp.client-ip=205.220.180.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 (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 431J2F23020675; Mon, 1 Apr 2024 19:05:06 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=YOvFbvbunUHIkvG45kRH7qRYCL2dxL/HNgVqr2lJcjA=; b=PZ 5KXmZpjkaIER62SKe9dAwReljkCPModhodPfXdcqnoCu9Hb8it5U9pQwMbwljYax Zc72q1O6+HWkGiLd2kivph5aDbGCGVoFqLLa/MB3U2VdW0dyB5JD29sRq9H4kXfQ r6kPGKH163+zxfR3ETkIWlFKwzRrm5p2aeYuokbZcj3gdh8x1OFvYQuEebQPjo9u n2bKDF+4e2N4AtqITFNVdMSD1tfAN4Lr1chGrMkH7qvue22qmS+FeoncdXYhqUwv CI++sFL+Hq6yvdZT96E/lQB0WLYnwwiqh8Hr4fHIY/qyZr3dksjAIIhxWe+eeqoz 2uF7ugJb/jI/3otDmNkg== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3x7qgw9ks9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 01 Apr 2024 19:05:05 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 431J55jt006845 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 1 Apr 2024 19:05:05 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; Mon, 1 Apr 2024 12:05:02 -0700 From: Rameshkumar Sundaram To: CC: , Sriram R , Rameshkumar Sundaram , Jeff Johnson Subject: [PATCH v6 03/12] wifi: ath12k: modify ath12k mac start/stop ops for single wiphy Date: Tue, 2 Apr 2024 00:34:00 +0530 Message-ID: <20240401190409.2461819-4-quic_ramess@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240401190409.2461819-1-quic_ramess@quicinc.com> References: <20240401190409.2461819-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: nasanex01b.na.qualcomm.com (10.46.141.250) 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: taVrTq5G1okxStmq455EHOQaxgxH0z0- X-Proofpoint-GUID: taVrTq5G1okxStmq455EHOQaxgxH0z0- 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-04-01_13,2024-04-01_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=830 clxscore=1015 priorityscore=1501 bulkscore=0 adultscore=0 suspectscore=0 impostorscore=0 spamscore=0 lowpriorityscore=0 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2403210001 definitions=main-2404010134 From: Sriram R When mac80211 does drv start/stop, apply the state change for all the radios within the wiphy in ath12k. 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 Acked-by: Jeff Johnson --- drivers/net/wireless/ath/ath12k/mac.c | 43 +++++++++++++++++++-------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 0fce3e7e06a4..cbe83578b81d 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -243,6 +243,7 @@ static const u32 ath12k_smps_map[] = { static int ath12k_start_vdev_delay(struct ath12k *ar, struct ath12k_vif *arvif); +static void ath12k_mac_stop(struct ath12k *ar); static const char *ath12k_mac_phymode_str(enum wmi_phy_mode mode) { @@ -5472,23 +5473,39 @@ static int ath12k_mac_start(struct ath12k *ar) return ret; } +static void ath12k_drain_tx(struct ath12k_hw *ah) +{ + struct ath12k *ar; + int i; + + for_each_ar(ah, ar, i) + ath12k_mac_drain_tx(ar); +} + static int ath12k_mac_op_start(struct ieee80211_hw *hw) { struct ath12k_hw *ah = ath12k_hw_to_ah(hw); - struct ath12k *ar = ath12k_ah_to_ar(ah, 0); - struct ath12k_base *ab = ar->ab; - int ret; + struct ath12k *ar; + int ret, i; - ath12k_mac_drain_tx(ar); + ath12k_drain_tx(ah); - ret = ath12k_mac_start(ar); - if (ret) { - ath12k_err(ab, "fail to start mac operations in pdev idx %d ret %d\n", - ar->pdev_idx, ret); - return ret; + for_each_ar(ah, ar, i) { + ret = ath12k_mac_start(ar); + if (ret) { + ath12k_err(ar->ab, "fail to start mac operations in pdev idx %d ret %d\n", + ar->pdev_idx, ret); + goto fail_start; + } } return 0; +fail_start: + for (; i > 0; i--) { + ar = ath12k_ah_to_ar(ah, i - 1); + ath12k_mac_stop(ar); + } + return ret; } int ath12k_mac_rfkill_config(struct ath12k *ar) @@ -5584,11 +5601,13 @@ static void ath12k_mac_stop(struct ath12k *ar) static void ath12k_mac_op_stop(struct ieee80211_hw *hw) { struct ath12k_hw *ah = ath12k_hw_to_ah(hw); - struct ath12k *ar = ath12k_ah_to_ar(ah, 0); + struct ath12k *ar; + int i; - ath12k_mac_drain_tx(ar); + ath12k_drain_tx(ah); - ath12k_mac_stop(ar); + for_each_ar(ah, ar, i) + ath12k_mac_stop(ar); } static u8 -- 2.25.1