Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1495600rwl; Wed, 5 Apr 2023 18:56:21 -0700 (PDT) X-Google-Smtp-Source: AKy350YEfbJtcTkIuk7HJ/Co0LyelOhNI95RGJKXbpnLCJeG8ehuuEyFKwYqyKJBvSHWg6+Iw+cD X-Received: by 2002:a17:906:314c:b0:949:8772:8195 with SMTP id e12-20020a170906314c00b0094987728195mr2892059eje.38.1680746181338; Wed, 05 Apr 2023 18:56:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680746181; cv=none; d=google.com; s=arc-20160816; b=HIlLx5VwwVwgRacG6z9FyfWf6ztF5lwMpTfDfIMf/czXCpc/B4mjj9R+jLMXGYhCv4 NCttSpyjZiWPnRtrb05c4/uVlv+2DKoHS4DoAXntGx37BeXWyzA8jRB//Cth82NQzCo8 RAQCoGaIzJx45ASbgGFUDut0Nj6iELAiRoLVkmflh09s1ueh1DHGul3nQlV0r6oWc3AH YbWAg7UukO+oFeMhi+TvgwJPPFNuVuxeOv3VaMlALtQneZBGFXAGzH5MrpNvVzClarVp gXwV9vQ0m6ZDMgqyecXiBl9rBuzA+NCSe+HYPtR40DBe9OpIXJ6xFDH1+4MoxZbuYNDl TuQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:authenticated-by; bh=szPAnDcv5ppRWJDM5CYE5INibjYVpx/uVOUogmlVjW8=; b=fqbWACmf/K3PIgJmms1GGXZIL2N1Ew6IPlAHNlLU1PmzHfSBSaWzRe0WvcHxeoDzvj WM7jbpvPwpKGRdgSVC3Sp4iFqF+wdhR6WwPtRCCksq+RrcTFaeqYe2YXbj00OsDFPVDP +WANrke3IGciUnwtKMHJnCmvDBKkQ8FSszmukKUjpuiB3W7hEd0lxvB96N47Mv/pWaOp afVtdEr7PoS7YwbrAthalIglWovJX2kMpezSLsgOwTTR4BtMCnC6NSiKRCCXJZyyprla AdaFonyO0LJ4pUV//0TBGdG5gyTLeWrdkWnxzdWzyKMRG7vD9zCS/6rZ3P1GSJUVY75q CImw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j19-20020a170906255300b00947c532afa5si199553ejb.852.2023.04.05.18.56.04; Wed, 05 Apr 2023 18:56:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234149AbjDFBzz convert rfc822-to-8bit (ORCPT + 60 others); Wed, 5 Apr 2023 21:55:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbjDFBzy (ORCPT ); Wed, 5 Apr 2023 21:55:54 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2133383D2; Wed, 5 Apr 2023 18:55:35 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 3361saDlB028391, 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.81/5.90) with ESMTPS id 3361saDlB028391 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK); Thu, 6 Apr 2023 09:54:36 +0800 Received: from RTEXMBS05.realtek.com.tw (172.21.6.98) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 6 Apr 2023 09:54:56 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXMBS05.realtek.com.tw (172.21.6.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 6 Apr 2023 09:54:55 +0800 Received: from RTEXMBS04.realtek.com.tw ([fe80::b4a2:2bcc:48d1:8b02]) by RTEXMBS04.realtek.com.tw ([fe80::b4a2:2bcc:48d1:8b02%5]) with mapi id 15.01.2375.007; Thu, 6 Apr 2023 09:54:55 +0800 From: Ping-Ke Shih To: Sascha Hauer , linux-wireless CC: Hans Ulli Kroll , Larry Finger , Tim K , "Alex G ." , Nick Morrow , Viktor Petrenko , Andreas Henriksson , ValdikSS , "kernel@pengutronix.de" , "stable@vger.kernel.org" Subject: RE: [PATCH v2 2/2] wifi: rtw88: rtw8821c: Fix rfe_option field width Thread-Topic: [PATCH v2 2/2] wifi: rtw88: rtw8821c: Fix rfe_option field width Thread-Index: AQHZZsamg/4VwhlxlEqb+Fqs2PgqWa8dhrAA Date: Thu, 6 Apr 2023 01:54:55 +0000 Message-ID: References: <20230404072508.578056-1-s.hauer@pengutronix.de> <20230404072508.578056-3-s.hauer@pengutronix.de> In-Reply-To: <20230404072508.578056-3-s.hauer@pengutronix.de> Accept-Language: en-US, zh-TW Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.21.69.188] x-kse-serverinfo: RTEXMBS05.realtek.com.tw, 9 x-kse-antispam-interceptor-info: fallback x-kse-antivirus-interceptor-info: fallback Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=0.0 required=5.0 tests=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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org > -----Original Message----- > From: Sascha Hauer > Sent: Tuesday, April 4, 2023 3:25 PM > To: linux-wireless > Cc: Hans Ulli Kroll ; Larry Finger ; Ping-Ke Shih > ; Tim K ; Alex G . ; Nick Morrow > ; Viktor Petrenko ; Andreas Henriksson ; > ValdikSS ; kernel@pengutronix.de; Sascha Hauer ; > stable@vger.kernel.org > Subject: [PATCH v2 2/2] wifi: rtw88: rtw8821c: Fix rfe_option field width > > On my RTW8821CU chipset rfe_option reads as 0x22. Looking at the > downstream driver suggests that the field width of rfe_option is 5 bit, > so rfe_option should be masked with 0x1f. I don't aware of this. Could you point where you get it? As I check it internally, 0x22 is expected, so I suggest to have 0x22 entry as below - [34] = RTW_DEF_RFE(8821c, 0, 0), + [34] = RTW_DEF_RFE_EXT(8821c, 0, 0, 2), // copy from type 2 > > Without this the rfe_option comparisons with 2 further down the > driver evaluate as false when they should really evaluate as true. > The effect is that 2G channels do not work. > > rfe_option is also used as an array index into rtw8821c_rfe_defs[]. > rtw8821c_rfe_defs[34] (0x22) was added as part of adding USB support, > likely because rfe_option reads as 0x22. As this now becomes 0x2, > rtw8821c_rfe_defs[34] is no longer used and can be removed. > > Signed-off-by: Sascha Hauer > Tested-by: ValdikSS > Tested-by: Alexandru gagniuc > Tested-by: Larry Finger > Cc: stable@vger.kernel.org > --- > drivers/net/wireless/realtek/rtw88/rtw8821c.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821c.c > b/drivers/net/wireless/realtek/rtw88/rtw8821c.c > index 17f800f6efbd0..67efa58dd78ee 100644 > --- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c > +++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c > @@ -47,7 +47,7 @@ static int rtw8821c_read_efuse(struct rtw_dev *rtwdev, u8 *log_map) > > map = (struct rtw8821c_efuse *)log_map; > > - efuse->rfe_option = map->rfe_option; > + efuse->rfe_option = map->rfe_option & 0x1f; > efuse->rf_board_option = map->rf_board_option; > efuse->crystal_cap = map->xtal_k; > efuse->pa_type_2g = map->pa_type; > @@ -1537,7 +1537,6 @@ static const struct rtw_rfe_def rtw8821c_rfe_defs[] = { > [2] = RTW_DEF_RFE_EXT(8821c, 0, 0, 2), > [4] = RTW_DEF_RFE_EXT(8821c, 0, 0, 2), > [6] = RTW_DEF_RFE(8821c, 0, 0), > - [34] = RTW_DEF_RFE(8821c, 0, 0), > }; > > static struct rtw_hw_reg rtw8821c_dig[] = { > -- > 2.39.2