Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2444919rdb; Fri, 8 Dec 2023 08:17:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IFM4H6iZt8WwJLH3GCMpcDwjLudGppvy1wDoy3imsS86ZNdsUwm2AlCEVSLicCI4kHfifBa X-Received: by 2002:a05:6871:611:b0:1fb:15c3:2884 with SMTP id w17-20020a056871061100b001fb15c32884mr357944oan.39.1702052233549; Fri, 08 Dec 2023 08:17:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702052233; cv=none; d=google.com; s=arc-20160816; b=Va4mUs98zWxm3EGBaa3/RtSBH7TZhkexoMEt61NMQpbSNZaN7FeO6hiX0JxKkM9dj2 WzzF6GnVQ34WS31oWb1XGx9ynUoRIPf4xkxkEcOzBONVAf4cboId3Y+yTmHLhB2mJb8F ngijaldLzWu9RCRyCu1/d7dVYAH0Tm7Qq4U0MRzonne8ZTBfDZMwW/RiwF9TFwn75mnZ 0viWrDYRQg5AtCtPvTz7fc8fvHT9VUZvsMilSzBVUmjINzQLOzmdgUeyeqcR6OvvTCA3 Mo2hV2yh60FDhsFi8IMHBmI7e7khfqQ2C3RQfUGrQLctmDRGb7xy/co/v7hwJFDXlBiM 7T/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:sender :dkim-signature; bh=KqLOEpU6i4cWRcRsrFgCO2vfOp2+vlSaElORfK5x/U0=; fh=JWfR4BpZkDWI5A8bDN3Tte7HP/iiVHpDCfisMVEYpN4=; b=otACpQbLQW/KcOTzwLS9MyieVscFyQm4ixjNflBKySSZmB2qE7WOFJ6TdTa3fZ4D2B JZW9k0dozjqss2vKRefNIvS6CPnJC/wpKSeAxKLVwdjY6X37WB0TP6qofp+6g+fEvOA7 iYYaWFCDjYP9vr5GqRDIFuZK2lmTOR9ogpGv6JM9pyCmyMhBgNwZispm9JRhC+auCg27 n61t7QPMe3ldMGeDuV6iHMeI2qnI1wpc8ITQz4NQmdCthBDPEDo2VK3Snv2x+t06PanR MEfD0TmuHcZ73Ip1SqbETLllKvApFkpgmwOdMyfunQedZdHoI74F4OZfLLzp7BkAYCtC twcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WOshdzg0; spf=pass (google.com: domain of linux-wireless+bounces-581-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-581-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e18-20020a0cd652000000b0067a90d3023esi2459361qvj.279.2023.12.08.08.17.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 08:17:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-581-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WOshdzg0; spf=pass (google.com: domain of linux-wireless+bounces-581-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-581-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 0A16F1C208C6 for ; Fri, 8 Dec 2023 16:17:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6110532C9B; Fri, 8 Dec 2023 16:17:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WOshdzg0" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A77E19A1 for ; Fri, 8 Dec 2023 08:17:07 -0800 (PST) Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3b2e330033fso1643661b6e.3 for ; Fri, 08 Dec 2023 08:17:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702052226; x=1702657026; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=KqLOEpU6i4cWRcRsrFgCO2vfOp2+vlSaElORfK5x/U0=; b=WOshdzg02Xe+Ky0tInrvKWzX1SYqh/v1JvSOLh1euF+r73MUzkwHgBYYDRG43yr8xI TtsfAW/OSvCwStqWVEnHL04nkMfPRK8hXQyrbG3oBHWYN6yUajaTL0UfORbaMGswBsvw JRncjACCcKoF6OGuYVIPhC3ft2GNM50wGow/Lrk4EG7I78IOuExeLk+o6jrcUh2RkwHW brj2UHm9Ulk/V2/HdJZ1A0S3RgNC9wwfiZt51f+1mAmrfEOet44u7kyvZaHzzGYj1I+A 1gQBsSy0ayHWVbtzfUHxg+ivfpnsnzcZ1g9cqCpJsa/2Ex7oqMOY/uhH51oYyyMl7EkN EV8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702052226; x=1702657026; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KqLOEpU6i4cWRcRsrFgCO2vfOp2+vlSaElORfK5x/U0=; b=ehHpJqqogvfbpISJpXjqtbIRjZhTQoH+Qxm0yIvyMXXpS41CoL2WnNTmrQ0hNR+b7C CU3qI3lG1YDQ9m6miscjTCWhD/QsEjTIU6010YyNDPEoJYKisQQo5ivLgn6K10zQu6g+ HFHxVpr8pRCjIRrwx42QrfBptZysY6jIAVYAQTwvvb3nZ73NtnwXp36nk45DWzTcV9U2 LIrCm/bHGRcUxKmE+awy/n6hrqNlIcAR/hqv0apNMtcAFqptFeI8cp/0ohne36/zyCur MJCm1iH+mP7cSIm3+eLQv3P7+xizaT3cOk5Tc3Vghc0gGN8WFZtHczJN8OC4kNWCXXlI pidw== X-Gm-Message-State: AOJu0YxA8QZc/N9GxWgWJdZX81CNvXnRm6kAMyd+tScdl/R+2BzFEs+C LL97JXO31KfbnyF+s5NYGz0= X-Received: by 2002:a05:6870:f806:b0:1fb:75a:de79 with SMTP id fr6-20020a056870f80600b001fb075ade79mr358489oab.103.1702052221818; Fri, 08 Dec 2023 08:17:01 -0800 (PST) Received: from [192.168.0.162] ([216.130.59.33]) by smtp.gmail.com with ESMTPSA id qb7-20020a056871e78700b001fac77ee907sm455790oac.33.2023.12.08.08.17.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Dec 2023 08:17:01 -0800 (PST) Sender: Larry Finger Message-ID: Date: Fri, 8 Dec 2023 10:17:00 -0600 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] wifi: rtw88: Use random MAC when efuse MAC invalid Content-Language: en-US To: Chris Morgan , linux-wireless@vger.kernel.org Cc: kvalo@kernel.org, pkshih@realtek.com, Chris Morgan References: <20231208150739.129753-1-macroalpha82@gmail.com> From: Larry Finger In-Reply-To: <20231208150739.129753-1-macroalpha82@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 rtw_dev *rtwdev) > efuse->ext_pa_5g = efuse->pa_type_5g & BIT(0) ? 1 : 0; > efuse->ext_lna_2g = 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 Thanks for this patch. There are a number of SDIO devices known to me with improperly coded EFUSE values. It seems that RTW8723DS chips perform poorly even when given a valid MAC address. Is this also true for RTW8821CS chips? Larry