From: Paul Menzel <pmenzel@molgen.mpg.de>
To: Abel Vesa <abel.vesa@oss.qualcomm.com>
Cc: Srinivas Kandagatla <srini@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Bartosz Golaszewski <brgl@kernel.org>,
Marcel Holtmann <marcel@holtmann.org>,
Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
Jeff Johnson <jjohnson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Abel Vesa <abelvesa@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org, linux-bluetooth@vger.kernel.org,
linux-wireless@vger.kernel.org, ath12k@lists.infradead.org
Subject: Re: [PATCH RFC 4/5] wifi: ath12k: Support MAC address from the firmware node
Date: Thu, 15 Oct 2026 08:18:55 +0200 [thread overview]
Message-ID: <f63f8f6d-54b8-4f0d-bc4a-fdb9cdefaba2@molgen.mpg.de> (raw)
In-Reply-To: <20261014-b4-nvmem-efivar-v1-4-187c85f65018@oss.qualcomm.com>
Dear Abel,
Thank you for your patch.
Am 14.10.26 um 15:02 schrieb Abel Vesa:
> Read a MAC address from the device's firmware node (a DT "mac-address"/
> "local-mac-address" property, or an nvmem cell named "mac-address" via
> device_get_mac_address()), and use it in preference to the address from
> the firmware board data. This mirrors what ath10k and ath11k already do
> and lets the WLAN MAC be sourced from firmware-provisioned storage such
> as a UEFI variable exposed through nvmem.
>
> A device tree / nvmem address takes precedence over the board-data MAC,
> so an explicitly provisioned address wins even when the firmware reports
> a valid per-pdev address. An all-zero (absent) address is ignored.
>
> Note: the provisioned address must be a valid unicast MAC; a multicast
> address (odd first octet) is rejected by nvmem_get_mac_address().
Please add a paragraph how you tested this.
> Assisted-by: LLM
> Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
> ---
> drivers/net/wireless/ath/ath12k/mac.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
> index 01f8c6572f65..f4d2d0377c8e 100644
> --- a/drivers/net/wireless/ath/ath12k/mac.c
> +++ b/drivers/net/wireless/ath/ath12k/mac.c
> @@ -14878,15 +14878,27 @@ static int ath12k_mac_hw_register(struct ath12k_hw *ah)
> u32 ht_cap = U32_MAX, antennas_rx = 0, antennas_tx = 0;
> bool is_6ghz = false, is_raw_mode = false, is_monitor_disable = false;
> u8 *mac_addr = NULL;
> + u8 mac_from_dt[ETH_ALEN] = {};
> u8 mbssid_max_interfaces = 0;
>
> wiphy->max_ap_assoc_sta = 0;
>
> + /*
> + * Allow a MAC address provided through the device tree (directly or
> + * via an nvmem cell named "mac-address") to override the one from the
> + * firmware board data.
> + */
> + device_get_mac_address(ab->dev, mac_from_dt);
> +
> for_each_ar(ah, ar, i) {
> u32 ht_cap_info = 0;
>
> pdev = ar->pdev;
> - if (ar->ab->pdevs_macaddr_valid) {
> + if (!is_zero_ether_addr(mac_from_dt)) {
> + /* A device tree / nvmem address takes precedence. */
The comment is redundant as the code ordering shows exactly this.
> + ether_addr_copy(ar->mac_addr, mac_from_dt);
> + ar->mac_addr[4] += ar->pdev_idx;
> + } else if (ar->ab->pdevs_macaddr_valid) {
> ether_addr_copy(ar->mac_addr, pdev->mac_addr);
> } else {
> ether_addr_copy(ar->mac_addr, ar->ab->mac_addr);
>
With the commit message extended, and the comment removed:
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Kind regards,
Paul
next prev parent reply other threads:[~2026-10-15 6:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-14 13:02 [PATCH RFC 0/5] nvmem: Add a UEFI variable backed NVMEM provider Abel Vesa
2026-10-14 13:02 ` [PATCH RFC 1/5] dt-bindings: nvmem: Add UEFI variable " Abel Vesa
2026-10-14 13:02 ` [PATCH RFC 2/5] " Abel Vesa
2026-10-15 6:29 ` Uwe Kleine-König
2026-10-15 13:22 ` Bartosz Golaszewski
2026-10-15 21:41 ` Jeff Johnson
2026-10-14 13:02 ` [PATCH RFC 3/5] Bluetooth: hci_qca: Support BD address from an nvmem cell Abel Vesa
2026-10-14 13:02 ` [PATCH RFC 4/5] wifi: ath12k: Support MAC address from the firmware node Abel Vesa
2026-10-15 6:18 ` Paul Menzel [this message]
2026-10-14 13:02 ` [PATCH RFC 5/5] arm64: dts: qcom: glymur-crd: Source MAC addresses from a UEFI variable Abel Vesa
2026-10-14 14:05 ` Konrad Dybcio
2026-10-15 13:22 ` Bartosz Golaszewski
2026-10-14 14:05 ` [PATCH RFC 0/5] nvmem: Add a UEFI variable backed NVMEM provider Konrad Dybcio
2026-10-15 16:27 ` Stephan Gerhold
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=f63f8f6d-54b8-4f0d-bc4a-fdb9cdefaba2@molgen.mpg.de \
--to=pmenzel@molgen.mpg.de \
--cc=abel.vesa@oss.qualcomm.com \
--cc=abelvesa@kernel.org \
--cc=andersson@kernel.org \
--cc=ath12k@lists.infradead.org \
--cc=brgl@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=jjohnson@kernel.org \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
--cc=robh@kernel.org \
--cc=srini@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
all inboxes | Powered by JetHome®