From: Ping-Ke Shih <pkshih@realtek.com>
To: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] wifi: rtw89: 8922a: set random mac if efuse contains zeroes
Date: Wed, 26 Nov 2025 00:43:59 +0000 [thread overview]
Message-ID: <25d22682d36444cf8093076bf551a50e@realtek.com> (raw)
In-Reply-To: <20251125120350.228288-1-jtornosm@redhat.com>
Jose Ignacio Tornos Martinez <jtornosm@redhat.com> wrote:
> I have some rtl8952ae devices with no permanent mac stored in efuse.
I think rtl8952ae is NOT a typo, but it is surprising me that this driver can
bring it up. Does it really work well? And where did you get the hardware?
>
> It could be properly saved and/or configured from user tools like
> NetworkManager, but it would be desirable to be able to initialize it
> somehow to get the device working by default.
>
> So, in the same way as with other devices, if the mac address read from
> efuse contains zeros, a random mac address is assigned to at least allow
> operation, and the user is warned about this in case any action needs to
> be considered.
>
> Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
> ---
> drivers/net/wireless/realtek/rtw89/rtw8922a.c | 22 +++++++++++++++----
> 1 file changed, 18 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtw89/rtw8922a.c
> b/drivers/net/wireless/realtek/rtw89/rtw8922a.c
> index 6aa19ad259ac..050307fa16d2 100644
> --- a/drivers/net/wireless/realtek/rtw89/rtw8922a.c
> +++ b/drivers/net/wireless/realtek/rtw89/rtw8922a.c
> @@ -636,16 +636,30 @@ static int rtw8922a_read_efuse_rf(struct rtw89_dev *rtwdev, u8 *log_map)
> static int rtw8922a_read_efuse(struct rtw89_dev *rtwdev, u8 *log_map,
> enum rtw89_efuse_block block)
> {
> + struct rtw89_efuse *efuse = &rtwdev->efuse;
> + int ret;
> +
> switch (block) {
> case RTW89_EFUSE_BLOCK_HCI_DIG_PCIE_SDIO:
> - return rtw8922a_read_efuse_pci_sdio(rtwdev, log_map);
> + ret = rtw8922a_read_efuse_pci_sdio(rtwdev, log_map);
> + break;
> case RTW89_EFUSE_BLOCK_HCI_DIG_USB:
> - return rtw8922a_read_efuse_usb(rtwdev, log_map);
> + ret = rtw8922a_read_efuse_usb(rtwdev, log_map);
> + break;
> case RTW89_EFUSE_BLOCK_RF:
> - return rtw8922a_read_efuse_rf(rtwdev, log_map);
> + ret = rtw8922a_read_efuse_rf(rtwdev, log_map);
> + break;
> default:
> - return 0;
> + ret = 0;
> + break;
> + }
> +
> + if (!ret && is_zero_ether_addr(efuse->addr)) {
> + rtw89_warn(rtwdev,"efuse mac address is zero, using random mac");
I think rtw89_info() is more suitable.
Need a '\n' at end of the message, and you missed a space after comma.
> + eth_random_addr(efuse->addr);
> }
> +
> + return ret;
> }
>
> #define THM_TRIM_POSITIVE_MASK BIT(6)
> --
> 2.51.1
next prev parent reply other threads:[~2025-11-26 0:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-25 12:03 [PATCH] wifi: rtw89: 8922a: set random mac if efuse contains zeroes Jose Ignacio Tornos Martinez
2025-11-26 0:43 ` Ping-Ke Shih [this message]
2025-11-26 9:06 ` Jose Ignacio Tornos Martinez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=25d22682d36444cf8093076bf551a50e@realtek.com \
--to=pkshih@realtek.com \
--cc=jtornosm@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox