Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3685896rdb; Sun, 10 Dec 2023 16:53:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IG9tks5HUP7LEnA/Rbn+LZCgTjQrvGMn4UajcFcU+2vVEfaAwRt6TeWaEgnMs19kh3wF9Zg X-Received: by 2002:a05:6358:5e0f:b0:170:4205:a974 with SMTP id q15-20020a0563585e0f00b001704205a974mr5391245rwn.13.1702256031911; Sun, 10 Dec 2023 16:53:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702256031; cv=none; d=google.com; s=arc-20160816; b=CHKk05CzQ/iYGA5mlX4ky/DrE6hAieiz8nthy5CdtHkOxHB3tsTzADyK/7ZtNklb5W WexVG8OyYu7YhkiMosq4ANGnYIr8CUsL+Ubfhxk2Px+P7S7wDr4dniH1Yq4HlNvJOq0o aW91x8rLDV1FqMqRXcvBq/Oba52U2wPsBYz/U7ehOMRm447TFkJ2xB1UNxA6QvuQwtMi JWCikZesUhMrae0Bax0Tr9FSzyLK9spvdkXInbUA2SbRV3KbGWMaAdRX2c2jyPXm2KKw A+W9Umc/bojQV0ozIVBsdUGaM9C0ElTb6puBv6NcdYlqA9vW6wkO7kW4V5GwSmRZ9wPU XbYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:content-language:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from; bh=T0Ycas4dI/eE4ZeJUtcQqwoaHSTqxlb76q6K9ilV528=; fh=HT69UcIE/vFJm+BkMxlnTaRsq9tiWlE7ouTBaL6rQDQ=; b=GXmAeaCFpScuO5DDNoDHq3ss7BlJsilWbQWT1z5lG5t3cLH70p/94nccoA2rOmDcGV p1BmC+OT4bTSRNuosrH9iV3YeHlRkyjjso/47lV688UW+2talMa9S9rSOA18XV3wwsVj XFe7VJyiaYQ24R/qdg6C2vUaJyGAEWt2Oad/8coxGfZcmlqoz7lCOkftxmjkJrj4oXBY NvAbibHkihKDn5rEjLTSXCJ7NITFgqj0LPA/tADy5WII7OdETFj0q8QiRuRVAAIvYavx JTf+6AKlBtjcqTl4uq20/eRxaDJnIPnhcqsFElbbgojw/60kwV+BVpxatQwv+3pdGjy3 lrzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless+bounces-610-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-610-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id g16-20020a17090ace9000b00286550aeb78si6362729pju.102.2023.12.10.16.53.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 16:53:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-610-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless+bounces-610-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-610-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 52BD7280A89 for ; Mon, 11 Dec 2023 00:53:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F2A215A2; Mon, 11 Dec 2023 00:53:48 +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 B70C0EB for ; Sun, 10 Dec 2023 16:53:44 -0800 (PST) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 3BB0rG3L12277666, 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 3BB0rG3L12277666 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Dec 2023 08:53:16 +0800 Received: from RTEXDAG02.realtek.com.tw (172.21.6.101) 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; Mon, 11 Dec 2023 08:53:16 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXDAG02.realtek.com.tw (172.21.6.101) 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 08:53:16 +0800 Received: from RTEXMBS04.realtek.com.tw ([fe80::40c2:6c24:2df4:e6c7]) by RTEXMBS04.realtek.com.tw ([fe80::40c2:6c24:2df4:e6c7%5]) with mapi id 15.01.2375.007; Mon, 11 Dec 2023 08:53:16 +0800 From: Ping-Ke Shih To: Chris Morgan , Larry Finger CC: Chris Morgan , "linux-wireless@vger.kernel.org" , "kvalo@kernel.org" Subject: RE: [PATCH] wifi: rtw88: Use random MAC when efuse MAC invalid Thread-Topic: [PATCH] wifi: rtw88: Use random MAC when efuse MAC invalid Thread-Index: AQHaKehQK1uqTNLbjkO8z9YWXMxWYLCfCgQAgABHzgCAA/KewA== Date: Mon, 11 Dec 2023 00:53:16 +0000 Message-ID: <3b82cf39c388484aa43cd9c9b762bc42@realtek.com> References: <20231208150739.129753-1-macroalpha82@gmail.com> In-Reply-To: Accept-Language: en-US, zh-TW Content-Language: zh-TW x-kse-serverinfo: RTEXDAG02.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: quoted-printable Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-KSE-AntiSpam-Interceptor-Info: fallback > -----Original Message----- > From: Chris Morgan > Sent: Saturday, December 9, 2023 4:34 AM > To: Larry Finger > Cc: Chris Morgan ; linux-wireless@vger.kernel.org= ; kvalo@kernel.org; Ping-Ke Shih > > Subject: Re: [PATCH] wifi: rtw88: Use random MAC when efuse MAC invalid >=20 >=20 > On Fri, Dec 08, 2023 at 10:17:00AM -0600, Larry Finger wrote: > > On 12/8/23 09:07, Chris Morgan wrote: > > > From: Chris Morgan > > > > > > When the MAC address read from the efuse data is invalid, warn the > > > user and use a random MAC address instead. > > > > > > On a device I am currently using (Anbernic RG-ARC) with a rtw8821cs > > > the efuse appears to be incompletely/improperly programmed. The MAC > > > address reads as ff:ff:ff:ff:ff:ff. When networkmanager attempts to > > > initiate a connection (and I haven't hard-coded a MAC address or > > > set it to random) it fails to establish a connection. > > > > > > Signed-off-by: Chris Morgan > > > --- > > > drivers/net/wireless/realtek/rtw88/main.c | 5 +++++ > > > 1 file changed, 5 insertions(+) > > > > > > diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/= wireless/realtek/rtw88/main.c > > > index 4a33d2e47f33..6d22628129d0 100644 > > > --- a/drivers/net/wireless/realtek/rtw88/main.c > > > +++ b/drivers/net/wireless/realtek/rtw88/main.c > > > @@ -2008,6 +2008,11 @@ static int rtw_chip_efuse_info_setup(struct rt= w_dev *rtwdev) > > > efuse->ext_pa_5g =3D efuse->pa_type_5g & BIT(0) ? 1 : 0; > > > efuse->ext_lna_2g =3D efuse->lna_type_5g & BIT(3) ? 1 : 0; > > > + if (!is_valid_ether_addr(efuse->addr)) { > > > + eth_random_addr(efuse->addr); > > > + dev_warn(rtwdev->dev, "efuse MAC invalid, using random\n"= ); > > > + } > > > + > > > out_disable: > > > rtw_chip_efuse_disable(rtwdev); > > > > Reviewed by Larry Finger Acked-by: Ping-Ke Shih Patch looks good to me. At least, it can have a valid MAC address.=20 > > > > Thanks for this patch. > > > > There are a number of SDIO devices known to me with improperly coded EF= USE > > values. It seems that RTW8723DS chips perform poorly even when given a = valid > > MAC address. Is this also true for RTW8821CS chips? >=20 > The RTW8821CS I have in this specific case doesn't perform all that > well, but it also has sub-optimal antennas. I'm not noticing any major > performance difference between the devices with a valid MAC address > and the device I have without one. They're both pulling about 8MB/s > over scp on a 5GHz 802.11ac(ax wifi gateway) network. >=20 It seems like we still need to have a set of _default_ efuse values.