Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp318744rbe; Wed, 28 Feb 2024 23:47:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXI/MKXKK+varQPInrIKD8WU8nVySPg67m5KcKxB/8+sviPFlV9pJ+5q8d1Vh7WOISiYNrg3ROUP36KBOixJ6iSKqjuMqRbKdAiNFhNFA== X-Google-Smtp-Source: AGHT+IFggw+FSQwEvhDXWNUdotYaQcfsiVuJn9ax7tq7JtshEe87PCxpxhZ9BFcJ6V0has8Bt2k2 X-Received: by 2002:a05:6808:5ce:b0:3c1:ad98:6a6b with SMTP id d14-20020a05680805ce00b003c1ad986a6bmr1338547oij.22.1709192872224; Wed, 28 Feb 2024 23:47:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709192872; cv=pass; d=google.com; s=arc-20160816; b=zh7DXOA7z11umlqSpcYDa5ppg9k88JRtVaFP1x49+oI2LndQalwMm2io1CdU5s2RDe GpS1K7ULYHOSsRNhj8c0pOxxxwCsiD4StjDzmSDR1fZK7+PPksWIMPp5XsTGM5YJwG6Q WD1w4gDerJF00PC+aKiy4r+8tp1SnoIXhCPhsOFtmLXluQ9ye8CPGtngZRA4EshzVhGF h3zmoOtPbVSe+N5Psk0mesV/rYwi//8Oz8NereQqgOL2F+BxZwdlakWODXRPVJkcjcob xSGZXGv0HtfdRiCDZNLCv9eFxVe7b+D1tbsyFhodTjeCXExpiFmgMk9garQWTa/kSM03 DUwg== 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; bh=6UcPBg3YUqSu6E3+y+11QIT9mkIxh4t1MEplEK13wl4=; fh=4papc12ra5onpkTOe/ePxQsLw2Ob2gsKo8Ya+y1zEDA=; b=fk6GkO1340dK1QVx9J+TbAO0xxg94qLEgCZCvovx3ZxKPJ082tAWUnAUKZKHU26hIx MpWWg3POoGVL3RncXhq6BFot1d1Bravo882olblI/1HxGdqvmt6+7t1r1f8ol8pa2FpY J315hC8FUYp8iM8CMhaZ64af2mxBiFPO82hqoDqZKtq+OfyE27dXmUARHljZfdj5avwT cyUjVF5ofX2iBy9tEA+Z4z1WMU0/XtMxxzpOWEH9TSt1XA+nnKromxMiX4yPSKsUDWxQ MiC45Bc3V0zd0q0Z+AFdHtJmwDzzetqAmZo9Lyu4ZU8TD7TWxPdPGIGn140bmNjBmJpP Uo5A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-wireless+bounces-4236-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4236-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id r18-20020a632b12000000b005dc98d91163si865863pgr.56.2024.02.28.23.47.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 23:47:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-4236-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-wireless+bounces-4236-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4236-linux.lists.archive=gmail.com@vger.kernel.org" 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 E322628253E for ; Thu, 29 Feb 2024 07:47:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB2CA482C3; Thu, 29 Feb 2024 07:46:46 +0000 (UTC) X-Original-To: linux-wireless@vger.kernel.org Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE063481AD for ; Thu, 29 Feb 2024 07:46:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709192806; cv=none; b=DZwCfny1b4zVriP1FUUIcDYJ2CUR77j/+E+j2rbwbgh7O/fGxH/8qc8DXQ4ifmICtAkNnUr6eRLDuiGELPL/lVAaqsd7N2Ag4Qh50yehUcLBWAVV8z3VGBKjrokZ1Ot56JzF37+m4/ATdFeCeqWrC8OqIl5wXk6yqzmjRzKZsrQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709192806; c=relaxed/simple; bh=YYdxuXtXqP4cWKVCkh0xqe/cZ5WuyD4CeKotnntjEjw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=a8VxQywrNxg39n4OW3r/nCCyqRzDxr28GT6DVsXtENOcTaK+qDeUDlQzc7QyxhHTzOQQMFdX07Kn2NNKd5ujlkIPCW+EPyPCA/C85zvxQIYSDcB0XPjjWtjEIz4gaVOhvdjp2L3JomJA1gzG4DhUwPElVd4Gg6P9hTejXPwjSAI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 41T7kdLG31229918, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.95/5.92) with ESMTPS id 41T7kdLG31229918 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Feb 2024 15:46:39 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.17; Thu, 29 Feb 2024 15:46:40 +0800 Received: from [127.0.1.1] (172.21.69.94) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 29 Feb 2024 15:46:39 +0800 From: Ping-Ke Shih To: CC: , Subject: [PATCH 7/8] wifi: rtw89: coex: When Bluetooth not available don't set power/gain Date: Thu, 29 Feb 2024 15:45:13 +0800 Message-ID: <20240229074514.219276-8-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240229074514.219276-1-pkshih@realtek.com> References: <20240229074514.219276-1-pkshih@realtek.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: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) From: Ching-Te Ku If Bluetooth is working, it will update their info regularly. And the code will increase the counters while the info updating. Use this counter to judge is Bluetooth working or not. Don't need to set Bluetooth power or gain when it is not working. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/coex.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw89/coex.c b/drivers/net/wireless/realtek/rtw89/coex.c index c74b1b6be2d3..6a1f9a555ce7 100644 --- a/drivers/net/wireless/realtek/rtw89/coex.c +++ b/drivers/net/wireless/realtek/rtw89/coex.c @@ -2311,6 +2311,9 @@ static void _set_bt_tx_power(struct rtw89_dev *rtwdev, u8 level) int ret; u8 buf; + if (btc->cx.cnt_bt[BTC_BCNT_INFOUPDATE] == 0) + return; + if (bt->rf_para.tx_pwr_freerun == level) return; @@ -2333,6 +2336,9 @@ static void _set_bt_rx_gain(struct rtw89_dev *rtwdev, u8 level) struct rtw89_btc *btc = &rtwdev->btc; struct rtw89_btc_bt_info *bt = &btc->cx.bt; + if (btc->cx.cnt_bt[BTC_BCNT_INFOUPDATE] == 0) + return; + if ((bt->rf_para.rx_gain_freerun == level || level > BTC_BT_RX_NORMAL_LVL) && (!rtwdev->chip->scbd || bt->lna_constrain == level)) -- 2.25.1