Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2321405rdg; Sun, 15 Oct 2023 23:52:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHJPE5nxLLuoswW41/3gbfJZE2xyRZh0gI73s5JtADTJOMDAxrTxQKgh03ZdtMuiIcn6X95 X-Received: by 2002:a17:90a:fc96:b0:27d:7f23:9b66 with SMTP id ci22-20020a17090afc9600b0027d7f239b66mr2731835pjb.9.1697439133055; Sun, 15 Oct 2023 23:52:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697439133; cv=none; d=google.com; s=arc-20160816; b=J/Gaaqxa377vFkhTJcczSjfBvFf/exXrXfbZvi/7Z13Velgu2nNNy4N9IgDhw7jT7C JconY1MJ4fnRp84JKBOJF23jxfikxbM9csUE/S0LFe8+K3EBzyhLhbCTYR0Svk7wqCPs hj9IrVE8bQ4voSlunh2oiLWNsDmE01DMNoAn6KuPCmKCsdcqM55Zo58HVJrAz7Psj4Kc YmKmD9CBd2FQUYFwO8gnrPC+wzxgFWH6VRp8oROt4GopypmhY/ca+HVj29izB0FraWQi wx+jQBAtQ6lTvoMYbLT+/+bUdlxLFSqTTBy9O5iYi6J83ZTKjUe9eu1gKLShTswT5j/9 rruQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Pv3aEX94lPeEl+Lz188p2SlEPkvJefb18vRX9M/5QUE=; fh=4TwZRPLNtLn/VqA3P2pgPgY9r+920GaYRrLXbPJjOsY=; b=bGdOuvRmFHRfJ0iQdM1nREoFbWcCE2QDdbu8G3pr/DnacfgU2abVJjGAF0j1v/5dOt 31xP8V67eJhwzzy9oGcg7GVHV8OqoyXezKl618RiZ9OCsy6liDb+PF3kIWz2VHkesXpL vGxMkU4cQkOs+LsLYl2HtsBuz+9mDUEnC14mJ7txfzgYjXi8sYrPDilkvu1DFCe7OfVl vuXipZ3wLVk/MqaEioGVh//WsbJj6PwxtXkzl5cj0cbS7jPky+E+Nk+QPUBOki8jr0/Q 2K028nQkzDC0kHATWkEMQd8qQ7rAOUpDn9aP1JZTKP2WiZus07N7hmelJmCp843DfvVq twdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id z60-20020a17090a6d4200b00274cd766a42si5208672pjj.171.2023.10.15.23.52.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Oct 2023 23:52:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 2D53B8080EEB; Sun, 15 Oct 2023 23:52:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231844AbjJPGwD (ORCPT + 52 others); Mon, 16 Oct 2023 02:52:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231796AbjJPGwB (ORCPT ); Mon, 16 Oct 2023 02:52:01 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 807B7C5 for ; Sun, 15 Oct 2023 23:51:57 -0700 (PDT) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 39G6pmOwB2264252, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.93/5.92) with ESMTPS id 39G6pmOwB2264252 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Oct 2023 14:51:48 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.32; Mon, 16 Oct 2023 14:51:49 +0800 Received: from [127.0.1.1] (172.21.71.113) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Mon, 16 Oct 2023 14:51:48 +0800 From: Ping-Ke Shih To: CC: , , Subject: [PATCH 4/5] wifi: rtw89: correct the DCFO tracking flow to improve CFO compensation Date: Mon, 16 Oct 2023 14:51:14 +0800 Message-ID: <20231016065115.751662-5-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231016065115.751662-1-pkshih@realtek.com> References: <20231016065115.751662-1-pkshih@realtek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.21.71.113] X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXMBS04.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-ServerInfo: RTEXH36505.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 (groat.vger.email [0.0.0.0]); Sun, 15 Oct 2023 23:52:09 -0700 (PDT) From: Cheng-Chieh Hsieh DCFO tracking compensate the CFO (carrier frequency offset) by digital hardware that provides fine CFO estimation. Although the avg_cfo which is a coarse information becomes zero, still we need DCFO tracking to compensate the residual CFO. However, the original flow skips the case when avg_cfo is zero, so we fix it to have expected performance. Signed-off-by: Cheng-Chieh Hsieh Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/phy.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw89/phy.c b/drivers/net/wireless/realtek/rtw89/phy.c index c7d8faa6265c..3b671a314e60 100644 --- a/drivers/net/wireless/realtek/rtw89/phy.c +++ b/drivers/net/wireless/realtek/rtw89/phy.c @@ -2634,6 +2634,10 @@ static void rtw89_phy_cfo_crystal_cap_adjust(struct rtw89_dev *rtwdev, s32 cfo_abs = abs(curr_cfo); int sign; + if (curr_cfo == 0) { + rtw89_debug(rtwdev, RTW89_DBG_CFO, "curr_cfo=0\n"); + return; + } if (!cfo->is_adjust) { if (cfo_abs > CFO_TRK_ENABLE_TH) cfo->is_adjust = true; @@ -2830,10 +2834,6 @@ static void rtw89_phy_cfo_dm(struct rtw89_dev *rtwdev) new_cfo = rtw89_phy_average_cfo_calc(rtwdev); else new_cfo = rtw89_phy_multi_sta_cfo_calc(rtwdev); - if (new_cfo == 0) { - rtw89_debug(rtwdev, RTW89_DBG_CFO, "curr_cfo=0\n"); - return; - } if (cfo->divergence_lock_en) { cfo->lock_cnt++; if (cfo->lock_cnt > CFO_PERIOD_CNT) { -- 2.25.1