Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp64949lqe; Fri, 5 Apr 2024 12:46:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVZsnAqtXctGtkwHofordtCzICYrVtG54pbUfLaAb67Mudpmsrdzy0pnLVZb5TbY5RTDtjGRcWrpb8TJbEhXhJ5hJNooOsbJhraTOBDRw== X-Google-Smtp-Source: AGHT+IGPPgmFrrZAfat5Ei1X/OQa9hJVseOWOueVsBw3G4BmFy3PA9LHlvIJeeNEUVekdj0ehE7a X-Received: by 2002:a05:6e02:1a88:b0:369:fbcf:5ddd with SMTP id k8-20020a056e021a8800b00369fbcf5dddmr2924720ilv.26.1712346359771; Fri, 05 Apr 2024 12:45:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712346359; cv=pass; d=google.com; s=arc-20160816; b=Kuvp2I+ZONV/KdKOCyvK7NWiBANgCGGS425HETCosdtw4pUPxgyIedcUEFv4TJpPIb 2qITpdZaHOTP9oGZSN85oux9QcL7raAh/PYa/UsJGM/If6PfS8uW9XOLA5vdEXCwkgaj 80xRIq/n98wefvhOntWFAS3URcIXRK5EG/PKLaQ0cNFT1AqJJomEDXjKhQyvw5JlzVVK gYxyEZR3BY4IhRxDVMI0WHGDvZL6yaBn4pUrV9zo/20C2slFmidSMvKQCjLeUGEcflmM 4Aq1afFFn5fzf3JfelUkE0cfU+3QVNatbNQ1EXhJ/lMIh1ZTQBMZKDyZZoOp9JDeaE4C k1+A== 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=98JnifdVFVGpEQ8gldNNmfDqWEwesjebUG0hrKa/d50=; fh=hXmvBwTcrACbulhadJq4aGomw93PvN9px3WarQqqC4o=; b=pQR+nHZUZPTHHVOVG5ycIBC7YIOZejh53M35X82IE4I0urDb3r1T0UrwCWNyOcwM12 l5rglxTinSF3ptGC1yq/vCfWSbwNOCqLYZtfLOfL/torQb1+Kv+RFuzN4Nu4dIYpwQNh rLnrr1tv4h0Dqs15am/tX0RRVyjjcUNzfpLraJvhMetd2gstNv1owfOicTxJpIAmwN6N YrbDXH5UeUebEvjoIczNQtjCVjtk1shy/qPQHU9e1FEcI7q2M+QvhZMf/a0x65yNrkRR lYRWJ+ZDzR7PIGxV2wGLkp1e0WtsqRYrgryrbMRbmmi5Zt1QxEKdGH0KXyjDtq/BM28v wwgQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=IlsjScMh; 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-5921-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5921-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 140-20020a630092000000b005ce087e004dsi1859533pga.799.2024.04.05.12.45.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 12:45:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5921-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=IlsjScMh; 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-5921-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5921-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 68CBA283987 for ; Fri, 5 Apr 2024 19:45:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 37A14173343; Fri, 5 Apr 2024 19:45:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="IlsjScMh" 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 A468317335B for ; Fri, 5 Apr 2024 19:45:45 +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=1712346347; cv=none; b=U5MVgi0yMChtgaqJNjGVouFlMSj4qiK++T8erfgsre0g/C0WYO0NydxrIsKEXSIHoUWd77wTht7+ES8Vmr35wD2cRL7GgLYouH79XLrBXVrdajmyJAxVoZHlf5jI0JcP65UJ+fVAlRKowl1LEfkC8Fu6FlGkoZ9AybYzSqgkZq0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712346347; c=relaxed/simple; bh=FxibY1LuXHj/7cxNeChykDgoRNNwAfNqpVGluMdS1Dc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=f0nk0DT9F53g++XEg4LJc3KEBdY0sbuV103m1YKkFCqgJ84433eiGQSysIWhiGjasknvBAuFeYsPiAJmBUvD51jwOykNFVIKZ9OwlJbk1E8eg/wvkWy01kzQkICw81dhnrCN3Q4CC6T+dEebBuE1Hb9/6haYzQcyigKg5houy54= 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=IlsjScMh; 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 435I8Z4X015140; Fri, 5 Apr 2024 19:45:42 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=98JnifdVFVGpEQ8gldNNmfDqWEwesjebUG0hrKa/d50=; b=Il sjScMhtohaE1Ppia6crTh7wSFpe9ogRdUr8h4ggM4q/HM4IQKIH1Ro+4KMyFWFMp MGzOVtedEPjKcN8UjVB2Zx9ebb9cqTWIKhUGnLeleO7+UxDz8SVrCdHpMlgEXmmG bpxybUbbOIY9nHd8q6svQXq0yZ2UyaAN+90/tKOKavC8x/K9WTYOljKuGk7dGXdb 2+YdqVL8Fy55LyvZ7iJYE6cB+GuQwG54JtXYYmv+f0dRH0SRnHP4bLB3oG+6qzuM VBDZgvn5Wpre9jZSxAlwhjpnL/FeB9XOx54M4VvJUhgaGDB1yXUBTPHIvOky2hH8 YkNtW2qRW0A2IYyROOMQ== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xahgt0y0c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 05 Apr 2024 19:45:42 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 435JjfMb016612 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 5 Apr 2024 19:45:41 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.1544.4; Fri, 5 Apr 2024 12:45:38 -0700 From: Rameshkumar Sundaram To: CC: , Sriram R , Rameshkumar Sundaram , Jeff Johnson Subject: [PATCH v7 03/12] wifi: ath12k: modify ath12k mac start/stop ops for single wiphy Date: Sat, 6 Apr 2024 01:15:10 +0530 Message-ID: <20240405194519.1337906-4-quic_ramess@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240405194519.1337906-1-quic_ramess@quicinc.com> References: <20240405194519.1337906-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-GUID: nKFi_0bOF6C_dw8D8gDzbVeblEJtxQzM X-Proofpoint-ORIG-GUID: nKFi_0bOF6C_dw8D8gDzbVeblEJtxQzM 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-05_21,2024-04-05_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=828 clxscore=1015 lowpriorityscore=0 suspectscore=0 mlxscore=0 malwarescore=0 phishscore=0 impostorscore=0 adultscore=0 bulkscore=0 spamscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404050138 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 1a4e35d0d582..acd7b07ee6bb 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -244,6 +244,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) { @@ -5473,23 +5474,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) @@ -5585,11 +5602,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