lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250811203451.3763-1-rosenp@gmail.com>
Date: Mon, 11 Aug 2025 13:34:51 -0700
From: Rosen Penev <rosenp@...il.com>
To: linux-wireless@...r.kernel.org
Cc: Jeff Johnson <jjohnson@...nel.org>,
	miquel.raynal@...tlin.com,
	ath10k@...ts.infradead.org (open list:QUALCOMM ATHEROS ATH10K WIRELESS DRIVER),
	linux-kernel@...r.kernel.org (open list)
Subject: [PATCHv2 ath-next] wifi: ath10k: add nvmem support for mac address

device_get_mac_address is a generic way to get the MAC address which
lacks NVMEM support, which tends to be used on embedded platforms.

In case device_get_mac_address fails, try of_get_mac_address_nvmem and
handle EPROBE_DEFER to wait for the nvmem driver to initialize.

Signed-off-by: Rosen Penev <rosenp@...il.com>
---
 v2: keep device_get_mac_address and use of_get_mac_address_nvmem
 added Miquel to CC. Maybe he has insight.
 drivers/net/wireless/ath/ath10k/core.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 6f78f1752cd6..8214b0c0ea80 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -11,6 +11,7 @@
 #include <linux/module.h>
 #include <linux/firmware.h>
 #include <linux/of.h>
+#include <linux/of_net.h>
 #include <linux/property.h>
 #include <linux/dmi.h>
 #include <linux/ctype.h>
@@ -3456,7 +3457,11 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
 		ath10k_debug_print_board_info(ar);
 	}
 
-	device_get_mac_address(ar->dev, ar->mac_addr);
+	if (device_get_mac_address(ar->dev, ar->mac_addr)) {
+		ret = of_get_mac_address_nvmem(ar->dev->of_node, ar->mac_addr);
+		if (ret == -EPROBE_DEFER)
+			goto err_free_firmware_files;
+	}
 
 	ret = ath10k_core_init_firmware_features(ar);
 	if (ret) {
-- 
2.50.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ