Received: by 2002:ab2:3c46:0:b0:1f5:f2ab:c469 with SMTP id x6csp76740lqf; Thu, 25 Apr 2024 23:12:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVypyVfBV2ZACgD+X3KYwPdnVMAplxC2iFq0MkWTP1A1v5f08AyzdfhD4fgFcjIg/WF9BWAmgiBTJKJj7KcRC7bcajzDgLQD9maVz5znw== X-Google-Smtp-Source: AGHT+IGjzt0SoDrvHxURlDSEZlIGFsHdCIAMMgKnoz7bvDoM4QLfULcz2KKQ4NvifjUM0J5q6+JN X-Received: by 2002:a17:907:7f27:b0:a52:71d6:d605 with SMTP id qf39-20020a1709077f2700b00a5271d6d605mr1881837ejc.23.1714111949462; Thu, 25 Apr 2024 23:12:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714111949; cv=pass; d=google.com; s=arc-20160816; b=mkGiXtMMXzYFOMIeArlvJ3FvDhnDqdZxul2IPavy7vF6eDH4T5YN2qn+xmqMKtlXtt tPb6u0CPYJko6DHPEbBWwrW129SZc8ouzgZt1/Wh1DhTMiy4IUtyoM9A6m5z+ViRJoHc SMG0tPa7yLhwcPmbNZJI+WGXVWXnAYMDVsEL/pB1JiL7OQoHGwOJF+g7Dh6RzbR/aKvd gEERje4tjA3UcmG1PhWAw6foN2p3IKZxnixXHw3K1xLuayU8FIF/6EGAWArxOfE1Pmsm QPBxRp38BP9xqUp+g8BuEWzQTgsBhnycloAUjJ73NPhZCb3ChJ9yCU1dFUf56ZVd4xM8 AGnw== 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:message-id:date:subject:cc:to :from; bh=dwo0W6+2LKBjrOfijHqqAeEPt8QomlZy2Q/GwgY1syo=; fh=8wm86B6hZzTVT7uyofBnNJUYeYr15uonQ5C5s5lmjf8=; b=D6ujbtxvs/y3o2IMMHk2rxQv8KMhqaJY4Fdm92xJVJQEJjno3CxfcffCZHB5K6J9as PXl24fpVYkgEDC94fdCU7+fPsUkBqU75T4xCuGLxqsgDiSkDt/NoqAKLw+vy8kNsD/fK 99Ai6G1cgje9HJE+gUQGswCZg9MsUHRUwnXIm+wawt0MGU9fYz5QVHk5B5bF9MMHuv2A 8rdHM/23SaJm/3ZCrExDYHwK8xlhfjK3VAq+EdgZc8QQZWqTZKDwZhe3WLrsveQ4IsP7 PQHKmagrzrkiASRn0flVAx0Si0CMp76UzPd3JmkIc+P8XyfABC3jsSf6YcR9vl8w0z2O vG+g==; 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-6916-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6916-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ji10-20020a170907980a00b00a526fca3ca0si11490370ejc.122.2024.04.25.23.12.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 23:12:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6916-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-wireless+bounces-6916-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6916-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0ECC31F22ABF for ; Fri, 26 Apr 2024 06:12:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A45A313A404; Fri, 26 Apr 2024 06:12:25 +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 C30152F2F for ; Fri, 26 Apr 2024 06:12:22 +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=1714111945; cv=none; b=fiFwvmBmcTWwcZcg48rj5EeCJ3Lu5gztZ7YSYkIuc/g+MdwxsQQNxPk75qkHnoyMA9ODWiNBQ7u7GhkpuZQ8f9D6HbPSDiatADI/+5v0X9mlJnrN3mt8RTGsppprSkxEaXwlooCSpVYWIrA2MZNP7j4w1I5CMtpFwurfgzoMkYk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714111945; c=relaxed/simple; bh=oNwl4vsZvskc0XLnljYaN1bqV0eMd7sbfkxBYGiHKFY=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=bI37hIO2aTvopGJn2F8Gk/K3nJlJXeNUCKdmCGkLuGjRLlpfEjWuzLJOl8L1/ZZCQMrXbaOqMyEpmBedAuETy0TrUat8HI10sJOeOGkGLyQiEycPv6XT6Ztz+JvJKGS4zq7+2DsFE4G+pVvzPKUkqX6WRV5l3eZvSYo5ozOH3aw= 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 43Q6CJsjC161656, 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 43Q6CJsjC161656 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 26 Apr 2024 14:12:19 +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.35; Fri, 26 Apr 2024 14:12:19 +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; Fri, 26 Apr 2024 14:12:19 +0800 From: Ping-Ke Shih To: CC: , Subject: [PATCH 1/2] wifi: rtw89: reset AFEDIG register in power off sequence Date: Fri, 26 Apr 2024 14:11:59 +0800 Message-ID: <20240426061200.44262-1-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 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: Chin-Yen Lee Some Wi-Fi chips meet card lost issue due to unstable hardware signal of GPIO pins during power off. Reset AFEDIG register before BB reset in power off sequence could avoid unstable signal and fix the issue. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/rtw8851b.c | 1 + drivers/net/wireless/realtek/rtw89/rtw8852b.c | 2 ++ drivers/net/wireless/realtek/rtw89/rtw8852c.c | 2 ++ 3 files changed, 5 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw89/rtw8851b.c b/drivers/net/wireless/realtek/rtw89/rtw8851b.c index 2e89c18fbf19..87b51823244d 100644 --- a/drivers/net/wireless/realtek/rtw89/rtw8851b.c +++ b/drivers/net/wireless/realtek/rtw89/rtw8851b.c @@ -2320,6 +2320,7 @@ static int rtw8851b_mac_disable_bb_rf(struct rtw89_dev *rtwdev) u8 wl_rfc_s1; int ret; + rtw89_write32_clr(rtwdev, R_AX_WLRF_CTRL, B_AX_AFC_AFEDIG); rtw89_write8_clr(rtwdev, R_AX_SYS_FUNC_EN, B_AX_FEN_BBRSTB | B_AX_FEN_BB_GLB_RSTN); diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852b.c b/drivers/net/wireless/realtek/rtw89/rtw8852b.c index 85908c55baa9..eebff5e6b403 100644 --- a/drivers/net/wireless/realtek/rtw89/rtw8852b.c +++ b/drivers/net/wireless/realtek/rtw89/rtw8852b.c @@ -550,6 +550,7 @@ static int rtw8852b_pwr_off_func(struct rtw89_dev *rtwdev) return ret; rtw89_write32_set(rtwdev, R_AX_SYS_PW_CTRL, B_AX_EN_WLON); + rtw89_write32_clr(rtwdev, R_AX_WLRF_CTRL, B_AX_AFC_AFEDIG); rtw89_write8_clr(rtwdev, R_AX_SYS_FUNC_EN, B_AX_FEN_BB_GLB_RSTN | B_AX_FEN_BBRSTB); rtw89_write32_clr(rtwdev, R_AX_SYS_ADIE_PAD_PWR_CTRL, B_AX_SYM_PADPDN_WL_RFC_1P3); @@ -2469,6 +2470,7 @@ static int rtw8852b_mac_disable_bb_rf(struct rtw89_dev *rtwdev) u8 wl_rfc_s1; int ret; + rtw89_write32_clr(rtwdev, R_AX_WLRF_CTRL, B_AX_AFC_AFEDIG); rtw89_write8_clr(rtwdev, R_AX_SYS_FUNC_EN, B_AX_FEN_BBRSTB | B_AX_FEN_BB_GLB_RSTN); diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852c.c b/drivers/net/wireless/realtek/rtw89/rtw8852c.c index db354afc486e..efc772eb79a4 100644 --- a/drivers/net/wireless/realtek/rtw89/rtw8852c.c +++ b/drivers/net/wireless/realtek/rtw89/rtw8852c.c @@ -338,6 +338,7 @@ static int rtw8852c_pwr_off_func(struct rtw89_dev *rtwdev) return ret; rtw89_write32_set(rtwdev, R_AX_SYS_PW_CTRL, B_AX_EN_WLON); + rtw89_write32_clr(rtwdev, R_AX_WLRF_CTRL, B_AX_AFC_AFEDIG); rtw89_write8_clr(rtwdev, R_AX_SYS_FUNC_EN, B_AX_FEN_BB_GLB_RSTN | B_AX_FEN_BBRSTB); rtw89_write32_clr(rtwdev, R_AX_SYS_ISO_CTRL_EXTEND, B_AX_R_SYM_FEN_WLBBGLB_1 | B_AX_R_SYM_FEN_WLBBFUN_1); @@ -2816,6 +2817,7 @@ static int rtw8852c_mac_enable_bb_rf(struct rtw89_dev *rtwdev) static int rtw8852c_mac_disable_bb_rf(struct rtw89_dev *rtwdev) { + rtw89_write32_clr(rtwdev, R_AX_WLRF_CTRL, B_AX_AFC_AFEDIG); rtw89_write8_clr(rtwdev, R_AX_SYS_FUNC_EN, B_AX_FEN_BBRSTB | B_AX_FEN_BB_GLB_RSTN); -- 2.25.1