Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3827677rdb; Mon, 11 Dec 2023 00:35:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IG2S/uKMFKv0z0f69EdGJEab7whsxO/qBsfFJfx3vqSxD+Azv3w4Tc3Ll1PTMvRbCcSVmzG X-Received: by 2002:a25:ae4f:0:b0:db7:dacf:6fdf with SMTP id g15-20020a25ae4f000000b00db7dacf6fdfmr2977294ybe.103.1702283732015; Mon, 11 Dec 2023 00:35:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702283732; cv=none; d=google.com; s=arc-20160816; b=TvH99D3KBh95hyO2S6pfVmKkNGov4qzMfO8b/NwePR/nV7+nECdrrS4uA9FfTTWl7b kEt7EAHv0Cl+9Fvle3xnujm3aa7jguLgnuysyDbphbIMwSeNf2PUv0FMLdhl4kVpLKfV 5CSxUx28ydZPnbZct7neKfVUyiUtsrIlc/yh8hfy6b1givSSJPsdrniAyN2iRBNDQis6 zu4s4kuOo3VyIP7AtdyhYFl/TDEa3nIB6ZH91UH17Rm6luyi1aWE0uWHrmI68rIbbNPj Sp3iP3rB5v47DS98StHV1mw+Jmhgd+intXyd/4UXN7z7d/27yUudqJnWbRcKyfrM6/kL cjIQ== ARC-Message-Signature: i=1; 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=559i6RJnpH6IEXO+e1POQJG+K/HKiaFfJXQ2OQZCMtU=; fh=119R0DZRwIns1LRpqAK2A6izyPVjL4TEe6VydCwW0T8=; b=seghIQcl/8Vek0zBJ49OB5BxsDFtJ8xypxgx2wXW7xst88Vc2/Ou1bPff3zmzcRk7O qN5TiS9XA7jUCZ2mifg59aBIczdv7PaD9kegoQogQeQcXc/VRcjLOA04KNZwhnPjQywf HRkF6YA786iMEBh3lX78FOQv7fG06vq3eMAdlKFC7fMAn3lXwZWlz93T3Q2IS9pn9f86 t7pBR++8Bx6KYGtxWH3db3cPbYiWdQ3LuCZjHOy5CmjduUn8988NMQKYC+t5GuUxbOs6 lqJVWUE+Gwm0AppNw4nEEhmrBDcpZlq9ci8T2hdDdMLEGQPe4nuF5Q8YUDMiAQFXhWBd VuFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless+bounces-638-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-638-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id q7-20020ad44027000000b0067ed674a857si1309312qvp.522.2023.12.11.00.35.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 00:35:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-638-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless+bounces-638-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-638-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id BEDE81C2093F for ; Mon, 11 Dec 2023 08:35:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF00F2110D; Mon, 11 Dec 2023 08:35:09 +0000 (UTC) X-Original-To: linux-wireless@vger.kernel.org Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F0A3ED for ; Mon, 11 Dec 2023 00:35:06 -0800 (PST) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 3BB8Z1W802598543, 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.95/5.92) with ESMTPS id 3BB8Z1W802598543 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Dec 2023 16:35:01 +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, 11 Dec 2023 16:35:01 +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_128_GCM_SHA256) id 15.1.2375.7; Mon, 11 Dec 2023 16:35:00 +0800 From: Ping-Ke Shih To: CC: Subject: [PATCH 6/6] wifi: rtw89: only reset BB/RF for existing WiFi 6 chips while starting up Date: Mon, 11 Dec 2023 16:33:41 +0800 Message-ID: <20231211083341.118047-7-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231211083341.118047-1-pkshih@realtek.com> References: <20231211083341.118047-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) 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 The new WiFi 7 chips change the design, so no need to disable/enable BB/RF when core_start(). Keep the same logic for existing chips. Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/core.c | 5 +---- drivers/net/wireless/realtek/rtw89/mac.h | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c index d5ee2aa053d4..fd527a249996 100644 --- a/drivers/net/wireless/realtek/rtw89/core.c +++ b/drivers/net/wireless/realtek/rtw89/core.c @@ -3956,10 +3956,7 @@ int rtw89_core_start(struct rtw89_dev *rtwdev) /* efuse process */ /* pre-config BB/RF, BB reset/RFC reset */ - ret = rtw89_chip_disable_bb_rf(rtwdev); - if (ret) - return ret; - ret = rtw89_chip_enable_bb_rf(rtwdev); + ret = rtw89_chip_reset_bb_rf(rtwdev); if (ret) return ret; diff --git a/drivers/net/wireless/realtek/rtw89/mac.h b/drivers/net/wireless/realtek/rtw89/mac.h index 56cd81347784..ed98b49809a4 100644 --- a/drivers/net/wireless/realtek/rtw89/mac.h +++ b/drivers/net/wireless/realtek/rtw89/mac.h @@ -1108,6 +1108,23 @@ static inline int rtw89_chip_disable_bb_rf(struct rtw89_dev *rtwdev) return chip->ops->disable_bb_rf(rtwdev); } +static inline int rtw89_chip_reset_bb_rf(struct rtw89_dev *rtwdev) +{ + int ret; + + if (rtwdev->chip->chip_gen != RTW89_CHIP_AX) + return 0; + + ret = rtw89_chip_disable_bb_rf(rtwdev); + if (ret) + return ret; + ret = rtw89_chip_enable_bb_rf(rtwdev); + if (ret) + return ret; + + return 0; +} + u32 rtw89_mac_get_err_status(struct rtw89_dev *rtwdev); int rtw89_mac_set_err_status(struct rtw89_dev *rtwdev, u32 err); bool rtw89_mac_c2h_chk_atomic(struct rtw89_dev *rtwdev, u8 class, u8 func); -- 2.25.1