Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2971929rdb; Tue, 12 Sep 2023 19:31:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFex5mVHVsZK8NMW+6tWaiGt9J+0AJFUTX395HIZl5Z2hR8hC5j8dfljCTmMlXdihx4K6Li X-Received: by 2002:a05:6a20:158f:b0:154:8d7a:aeb3 with SMTP id h15-20020a056a20158f00b001548d7aaeb3mr1880639pzj.28.1694572302880; Tue, 12 Sep 2023 19:31:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694572302; cv=none; d=google.com; s=arc-20160816; b=OgD8HBJvDwrpQVaHah2jvSAUxwlehMF61cjBLFrWKfoaqbYNSTjOPnZSeEwZ6A2Mc5 d5YyjCfzMvu5ttCAaATr3K9fYIhiwZ/yfP1hRpiSmoODgFThHkYzUOQoIt6hhHJbtzYb DESKuSQRNjDU6n5E8hUMx8oHBoCF0o0+6TWDRI37OEoW+nmcrscw6eytckz8sfr7i6Ly UkHTWS7sg7eQswqqlBTL6M7VEb10685PGEYj3rlKv33HSomxXEqbWvNMg17ACwp7mWVk BkRZ7HmkaQB+ImTu/+5m0o1qm/WxMfr3juT+80p1cRApEcLzXZCZNXlNrfuRM0++L0DX vq8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=cfCG/C001JEwNnf/LCPGEOwEP9gCWBUScd9moe+3Km4=; fh=6IuQSvl4ey+TF545E+35FPgNRFKLA20IvREGr1bfVkA=; b=AhBQwjxLtgiGR0nmUyURVanm+FaWG3aR3my3bpdc7LD35cZc7dAEHHTxPbhvDT65vk fUIQ1OnQtqx33/l0e5s/KUhZkNuP0Pal0cSanrG4Acaatp/dz5gMwvMUqd1IFVqrswk0 QPFA5VQK/SEUbirT1RqDQB7F8tOhilPwvezlhkSdZuybF2wl1cvjkizkelAeAEuBgQOM XyLF1rJbvAf+tV4WAVrG9WKMCkRAzVNauUM1vylJ3e0KVhnOCOr2oJGRq4AYVbAbz9Wb 65EduNJeXfkYA6nzuV61Cj5wLJU4JI4EZt9+Rv57YZEp99/VjFQpHde7PLy20aLjDNTk hPiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=eNt1zy+6; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id q20-20020a056a00151400b0068beb5a0645si6001053pfu.227.2023.09.12.19.31.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 19:31:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=eNt1zy+6; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 8620880203DF; Tue, 12 Sep 2023 10:53:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237202AbjILRw5 (ORCPT + 56 others); Tue, 12 Sep 2023 13:52:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231989AbjILRwk (ORCPT ); Tue, 12 Sep 2023 13:52:40 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3505B1FE0 for ; Tue, 12 Sep 2023 10:52:11 -0700 (PDT) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38CGra9D005903; Tue, 12 Sep 2023 17:52:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=cfCG/C001JEwNnf/LCPGEOwEP9gCWBUScd9moe+3Km4=; b=eNt1zy+6MaA0x6xDkTAe2ASJowLEqy9yHLw2ai5TUY5pJLhCMnE2o5nXkRElyV0noRi/ HhcDST9gljRXJ0CD2YZVir0YhOmPKCmwteCP0A9PFF+emAFa6lWMRWsQ7mc+guHvuMh4 oFG6K6IXHrP0H27jLuypRfnMFxKvL8sUUo8229ohZZmWKMvsiXO51R28aKkEnbZMslrP T2KXJoV1kCuxDwjK7UrUOqWZCphD4fc2/VBew7+F9fbGU7PMYYFvbmBzBoFPNDDZOyKx IQ7SykKgFNH698RSYSt5BVJ1GvHpkOu/HNKx5PzjS6buKRreymzh06Zihk5hLH7K5OgX Jg== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3t2qkj95dq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Sep 2023 17:52:07 +0000 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 38CHq5OQ029487 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Sep 2023 17:52:06 GMT Received: from [10.111.183.71] (10.49.16.6) 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.36; Tue, 12 Sep 2023 10:52:05 -0700 Message-ID: <83e9db20-24c9-4a0e-a632-b40f37260c64@quicinc.com> Date: Tue, 12 Sep 2023 10:52:05 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/3] wifi: ath11k: fix Tx power value during active CAC Content-Language: en-US To: Aditya Kumar Singh , CC: , References: <20230912051857.2284-1-quic_adisi@quicinc.com> <20230912051857.2284-4-quic_adisi@quicinc.com> From: Jeff Johnson In-Reply-To: <20230912051857.2284-4-quic_adisi@quicinc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) 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: psEx7bDAuTZ3q5e0H4NwkqqTHFMlKr7U X-Proofpoint-GUID: psEx7bDAuTZ3q5e0H4NwkqqTHFMlKr7U X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-12_16,2023-09-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 impostorscore=0 suspectscore=0 spamscore=0 phishscore=0 malwarescore=0 lowpriorityscore=0 bulkscore=0 mlxlogscore=999 clxscore=1015 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309120151 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 12 Sep 2023 10:53:01 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email On 9/11/2023 10:18 PM, Aditya Kumar Singh wrote: > Tx power is fetched from firmware's pdev stats. However, during active > CAC, firmware does not fill the current Tx power and sends the max > initialised value filled during firmware init. If host sends this power > to user space, this is wrong since in certain situations, the Tx power > could be greater than the max allowed by the regulatory. Hence, host > should not be fetching the Tx power during an active CAC. > > Fix this issue by returning Tx power as 0 during active CAC since it > is known that during CAC, there will be no transmission happening. > > Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 > > Fixes: 9a2aa68afe3d ("wifi: ath11k: add get_txpower mac ops") > Signed-off-by: Aditya Kumar Singh Acked-by: Jeff Johnson > --- > drivers/net/wireless/ath/ath11k/mac.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c > index 6b5f032197ff..a36698688f89 100644 > --- a/drivers/net/wireless/ath/ath11k/mac.c > +++ b/drivers/net/wireless/ath/ath11k/mac.c > @@ -9045,6 +9045,14 @@ static int ath11k_mac_op_get_txpower(struct ieee80211_hw *hw, > if (ar->state != ATH11K_STATE_ON) > goto err_fallback; > > + /* Firmware doesn't provide Tx power during CAC hence no need to fetch > + * the stats. > + */ > + if (test_bit(ATH11K_CAC_RUNNING, &ar->dev_flags)) { > + mutex_unlock(&ar->conf_mutex); > + return -EAGAIN; > + } > + > req_param.pdev_id = ar->pdev->pdev_id; > req_param.stats_id = WMI_REQUEST_PDEV_STAT; >