Received: by 2002:a05:7208:70d5:b0:7f:5597:fa5c with SMTP id q21csp101565rba; Wed, 20 Mar 2024 12:11:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX3DyyjWJz5xTtvog+xOnD9nn54s0K7FFgi4qRfHIqa1SgDluKF+fSv/TJHC0SndGq+M8heQUQIevri5ZLqV9mPC5BIdQWavi0ctOyAOw== X-Google-Smtp-Source: AGHT+IGRyj4cXm6HeVdBBfMz7h6EqGjhWfuprVlK6AlQJ2W2gXrhEOwpDg5uCQL0Ov8pKPQNpCa0 X-Received: by 2002:a17:90a:9603:b0:29c:403b:ea2e with SMTP id v3-20020a17090a960300b0029c403bea2emr2524140pjo.49.1710961861191; Wed, 20 Mar 2024 12:11:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710961861; cv=pass; d=google.com; s=arc-20160816; b=SKAetzYDKYCoRLIvAihOAuvIfCqEXx25s91iAg+AN6urBoEt1KcwWcc3RD3sSN+8sf 7mMBap1JU7Hdqigl3rKo5KmESZOtIU+PeqkmnjArcs++oFl97ptTAtZ4/O2UJ3n3HDDO /yDJBAOut79qrLZPXnKz6w1cp7pmyf2PPvAbniDoFZyc39mjkG8s67GVJrVPE73CN7/e UU7jXfiuqpvN23I+li8j8Zkt+ccrMHfd5wWWq/jEwchgZr8UqvAOesTnse2oOg1+T0Iw lgP5uELuXgHWqu32F/mLMotzLZXj2bvNFBQRuvmTPXNrquT2LeeyRlBnEvR2lUnVEi0I t6lw== 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=YNbAeSB5pKnnIsGCNpqnjV4MTY2nS/jpxs0ms/mBFZU=; fh=woZAKccQQLpsH+ifgAFl/ubgLBC7CdNtwbjjrWqWXi0=; b=ASIpdpmvM654WLFJXoeEMLiDezOFM4tlXtoQ0Bi1yrVbCXjJ0OoaCKPiGCKiptfYCn tyKiQvIGrgzaU+3jX1fd5alQed8NCGDOO3DkQaWagVcVeyGt3ll4kaZfItAyFXIoxkuQ ecO5UKyiGm+okLSTLUGin2SpaW7jiVjn97CYwrEgSVcbuW+FDBbezPvNC7gryJMxi3LA uU+yPLnBxsHFHphH3c3+2plnQBXbRRAKkFyzKlphPHhTlVj4E2g4UQ5QibhL86FtmVBV g9aqvf6JxAHDA+k4jJIsHn+4lWCblfq98z6gtZwoLKfdkGMvWLtdiRc+ktXJ5kHugPHL 7iUg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Ha2nIL1L; 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-5013-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5013-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id p20-20020a17090ad31400b0029f9b018d31si1890522pju.75.2024.03.20.12.11.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 12:11:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5013-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Ha2nIL1L; 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-5013-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5013-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 1F20FB22731 for ; Wed, 20 Mar 2024 19:10:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F1C9B85646; Wed, 20 Mar 2024 19:10:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Ha2nIL1L" 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 3EFF385626 for ; Wed, 20 Mar 2024 19:10:39 +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=1710961841; cv=none; b=FNcQzahtYdUFfeaEUMmiLrTI9j+IPyD9nnWK/rQWA1DcufKW9PA0QkwhvHMPlizwREOIh08+A0cj1zxnssLHeQuQBCCHyH9xxTzZ+n2SzaXWn4ZJ0m6ciRZlsGeMM9dtUBUW+TkUWCVRY4Xfi+WOnKo7uTzmPLMgFFmfpvICiGY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710961841; c=relaxed/simple; bh=o36GSZHxUbIbvPMSNikBabsoPmL3SXOMt+4xAnLZH0w=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mCePLKJ3vPMfWhIx24ettxzO/Plq1ScibF+NMQqQMKxkpP8JAb91/OX1WCns73SOQr2eMYqqUxhI1wXz4ks/gOmSv2I9/Fl3xkIY5p5/IeASXzsYdzvGaSdlpbXwJt+LgVCJ/XNfup3C+gcIgyBYEDCVliPJUz9D59Twyf2bZGE= 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=Ha2nIL1L; 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 (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 42KI7OmC001449; Wed, 20 Mar 2024 19:10: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=YNbAeSB5pKnnIsGCNpqnjV4MTY2nS/jpxs0ms/mBFZU=; b=Ha 2nIL1LuLC865G+kgOz8DFcsnDIkV9DuR68nHZn8E9v/QgNjiUxJXwDg4LRxF7Ji6 v5wRDelZYc4o3IB4klI8dzxXXdDP6EYoG/XFfwC1PE/M5H798v9Bcgp6f/jE84Zi qFv0bFioJBTEtWroexS2Fzt18GR1ZSIDyUWMS0ubbAWvqDjW2l3CnAJegMEk+Fi4 pF6xau1jCc3CAPqzvvEB666ptEBIGp1YASlW0zoWH2vHTFyAmNm7SIY7Cl7Cfqa2 IpKJIHonlOZFlUa8I6itI7PYAbaFb1BpN9AQcn7Iv/UPdMKEQ+T8xqKPHaqs4PIH wEEL7M6Vser+GX5I6cTQ== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3x04ar8763-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Mar 2024 19:10:06 +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 42KJA54D023824 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Mar 2024 19:10: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; Wed, 20 Mar 2024 12:10:03 -0700 From: Rameshkumar Sundaram To: CC: , Sriram R , Rameshkumar Sundaram Subject: [PATCH v5 03/12] wifi: ath12k: modify ath12k mac start/stop ops for single wiphy Date: Thu, 21 Mar 2024 00:39:34 +0530 Message-ID: <20240320190943.3850106-4-quic_ramess@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240320190943.3850106-1-quic_ramess@quicinc.com> References: <20240320190943.3850106-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: oByxkz0nC7mD9b1B5jVU2m0LiiG6AI0x X-Proofpoint-ORIG-GUID: oByxkz0nC7mD9b1B5jVU2m0LiiG6AI0x 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-03-20_10,2024-03-18_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 spamscore=0 lowpriorityscore=0 clxscore=1015 mlxscore=0 suspectscore=0 malwarescore=0 impostorscore=0 mlxlogscore=810 adultscore=0 bulkscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2403140001 definitions=main-2403200154 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 --- 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