Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 1/1] wifi: ath12k: support calibration-variant from device tree
@ 2026-01-31  0:32 Andrew LaMarche
  2026-05-27 16:12 ` Andrew LaMarche
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew LaMarche @ 2026-01-31  0:32 UTC (permalink / raw)
  To: Jeff Johnson; +Cc: linux-wireless, ath12k, linux-kernel, andrewjlamarche

ath10k and ath11k support reading calibration variants from the device
tree to locate the correct Board Description File (BDF). The ath12k-wsi
binding already describes using qcom,calibration-variant and
qcom,ath12k-calibration-variant, but it is not implemented in the code.

Many ath12k designs expose all the radios under a single phy, each of
which typically require a separate BDF. Without this, the radios may not
come up or will not be calibrated correctly.

Fix this by parsing the device tree for the generation-agnostic
qcom,calibration-variant node or ath12k-specific
qcom,ath12k-calibration-variant node. This allows the driver to properly
select, read and apply the correct BDF.

Signed-off-by: Andrew LaMarche <andrewjlamarche@gmail.com>
---
 drivers/net/wireless/ath/ath12k/core.c | 25 +++++++++++++++++++++++++
 drivers/net/wireless/ath/ath12k/core.h |  2 +-
 drivers/net/wireless/ath/ath12k/qmi.c  |  4 ++++
 3 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
index cc352eef1939..e45f76d81337 100644
--- a/drivers/net/wireless/ath/ath12k/core.c
+++ b/drivers/net/wireless/ath/ath12k/core.c
@@ -806,6 +806,31 @@ int ath12k_core_check_smbios(struct ath12k_base *ab)
 	return 0;
 }
 
+int ath12k_core_check_dt(struct ath12k_base *ab)
+{
+	size_t max_len = sizeof(ab->qmi.target.bdf_ext);
+	const char *variant = NULL;
+	struct device_node *node;
+
+	node = ab->dev->of_node;
+	if (!node)
+		return -ENOENT;
+
+	of_property_read_string(node, "qcom,calibration-variant",
+			&variant);
+	if (!variant)
+		of_property_read_string(node, "qcom,ath12k-calibration-variant",
+				&variant);
+	if (!variant)
+		return -ENODATA;
+
+	if (strscpy(ab->qmi.target.bdf_ext, variant, max_len) < 0)
+		ath12k_dbg(ab, ATH12K_DBG_BOOT,
+				"bdf variant string is longer than the buffer can accommodate (variant: %s)\n", variant);
+
+	return 0;
+}
+
 static int ath12k_core_soc_create(struct ath12k_base *ab)
 {
 	int ret;
diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h
index 3c1e0069be1e..39700a780ee2 100644
--- a/drivers/net/wireless/ath/ath12k/core.h
+++ b/drivers/net/wireless/ath/ath12k/core.h
@@ -1352,7 +1352,7 @@ int ath12k_core_fetch_bdf(struct ath12k_base *ath12k,
 			  struct ath12k_board_data *bd);
 void ath12k_core_free_bdf(struct ath12k_base *ab, struct ath12k_board_data *bd);
 int ath12k_core_fetch_regdb(struct ath12k_base *ab, struct ath12k_board_data *bd);
-int ath12k_core_check_dt(struct ath12k_base *ath12k);
+int ath12k_core_check_dt(struct ath12k_base *ab);
 int ath12k_core_check_smbios(struct ath12k_base *ab);
 void ath12k_core_halt(struct ath12k *ar);
 int ath12k_core_resume_early(struct ath12k_base *ab);
diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c
index b7c48b6706df..22ef5aab871f 100644
--- a/drivers/net/wireless/ath/ath12k/qmi.c
+++ b/drivers/net/wireless/ath/ath12k/qmi.c
@@ -2903,6 +2903,10 @@ int ath12k_qmi_request_target_cap(struct ath12k_base *ab)
 	if (r)
 		ath12k_dbg(ab, ATH12K_DBG_QMI, "SMBIOS bdf variant name not set.\n");
 
+	r = ath12k_core_check_dt(ab);
+	if (r)
+		ath12k_dbg(ab, ATH12K_DBG_QMI, "DT bdf variant name not set.\n");
+
 	r = ath12k_acpi_start(ab);
 	if (r)
 		/* ACPI is optional so continue in case of an error */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] wifi: ath12k: support calibration-variant from device tree
  2026-01-31  0:32 [PATCH 1/1] wifi: ath12k: support calibration-variant from device tree Andrew LaMarche
@ 2026-05-27 16:12 ` Andrew LaMarche
  2026-05-27 19:52   ` Jeff Johnson
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew LaMarche @ 2026-05-27 16:12 UTC (permalink / raw)
  To: Jeff Johnson; +Cc: linux-wireless, ath12k, linux-kernel

Hi,

A kind ping here. I’m not sure why this functionality is missing in the first place, but it is needed for loading caldata from the device tree.

Cheers,
Andrew

> On Jan 30, 2026, at 7:32 PM, Andrew LaMarche <andrewjlamarche@gmail.com> wrote:
> 
> ath10k and ath11k support reading calibration variants from the device
> tree to locate the correct Board Description File (BDF). The ath12k-wsi
> binding already describes using qcom,calibration-variant and
> qcom,ath12k-calibration-variant, but it is not implemented in the code.
> 
> Many ath12k designs expose all the radios under a single phy, each of
> which typically require a separate BDF. Without this, the radios may not
> come up or will not be calibrated correctly.
> 
> Fix this by parsing the device tree for the generation-agnostic
> qcom,calibration-variant node or ath12k-specific
> qcom,ath12k-calibration-variant node. This allows the driver to properly
> select, read and apply the correct BDF.
> 
> Signed-off-by: Andrew LaMarche <andrewjlamarche@gmail.com>
> ---
> drivers/net/wireless/ath/ath12k/core.c | 25 +++++++++++++++++++++++++
> drivers/net/wireless/ath/ath12k/core.h |  2 +-
> drivers/net/wireless/ath/ath12k/qmi.c  |  4 ++++
> 3 files changed, 30 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
> index cc352eef1939..e45f76d81337 100644
> --- a/drivers/net/wireless/ath/ath12k/core.c
> +++ b/drivers/net/wireless/ath/ath12k/core.c
> @@ -806,6 +806,31 @@ int ath12k_core_check_smbios(struct ath12k_base *ab)
> 	return 0;
> }
> 
> +int ath12k_core_check_dt(struct ath12k_base *ab)
> +{
> +	size_t max_len = sizeof(ab->qmi.target.bdf_ext);
> +	const char *variant = NULL;
> +	struct device_node *node;
> +
> +	node = ab->dev->of_node;
> +	if (!node)
> +		return -ENOENT;
> +
> +	of_property_read_string(node, "qcom,calibration-variant",
> +			&variant);
> +	if (!variant)
> +		of_property_read_string(node, "qcom,ath12k-calibration-variant",
> +				&variant);
> +	if (!variant)
> +		return -ENODATA;
> +
> +	if (strscpy(ab->qmi.target.bdf_ext, variant, max_len) < 0)
> +		ath12k_dbg(ab, ATH12K_DBG_BOOT,
> +				"bdf variant string is longer than the buffer can accommodate (variant: %s)\n", variant);
> +
> +	return 0;
> +}
> +
> static int ath12k_core_soc_create(struct ath12k_base *ab)
> {
> 	int ret;
> diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h
> index 3c1e0069be1e..39700a780ee2 100644
> --- a/drivers/net/wireless/ath/ath12k/core.h
> +++ b/drivers/net/wireless/ath/ath12k/core.h
> @@ -1352,7 +1352,7 @@ int ath12k_core_fetch_bdf(struct ath12k_base *ath12k,
> 			  struct ath12k_board_data *bd);
> void ath12k_core_free_bdf(struct ath12k_base *ab, struct ath12k_board_data *bd);
> int ath12k_core_fetch_regdb(struct ath12k_base *ab, struct ath12k_board_data *bd);
> -int ath12k_core_check_dt(struct ath12k_base *ath12k);
> +int ath12k_core_check_dt(struct ath12k_base *ab);
> int ath12k_core_check_smbios(struct ath12k_base *ab);
> void ath12k_core_halt(struct ath12k *ar);
> int ath12k_core_resume_early(struct ath12k_base *ab);
> diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c
> index b7c48b6706df..22ef5aab871f 100644
> --- a/drivers/net/wireless/ath/ath12k/qmi.c
> +++ b/drivers/net/wireless/ath/ath12k/qmi.c
> @@ -2903,6 +2903,10 @@ int ath12k_qmi_request_target_cap(struct ath12k_base *ab)
> 	if (r)
> 		ath12k_dbg(ab, ATH12K_DBG_QMI, "SMBIOS bdf variant name not set.\n");
> 
> +	r = ath12k_core_check_dt(ab);
> +	if (r)
> +		ath12k_dbg(ab, ATH12K_DBG_QMI, "DT bdf variant name not set.\n");
> +
> 	r = ath12k_acpi_start(ab);
> 	if (r)
> 		/* ACPI is optional so continue in case of an error */
> -- 
> 2.43.0
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] wifi: ath12k: support calibration-variant from device tree
  2026-05-27 16:12 ` Andrew LaMarche
@ 2026-05-27 19:52   ` Jeff Johnson
  2026-05-27 21:01     ` Andrew LaMarche
  0 siblings, 1 reply; 7+ messages in thread
From: Jeff Johnson @ 2026-05-27 19:52 UTC (permalink / raw)
  To: Andrew LaMarche, Jeff Johnson; +Cc: linux-wireless, ath12k, linux-kernel

On 5/27/2026 9:12 AM, Andrew LaMarche wrote:
> Hi,
> 
> A kind ping here. I’m not sure why this functionality is missing in the first place, but it is needed for loading caldata from the device tree.

Your patch duplicates functionality in the Qualcomm authored series:
https://msgid.link/20250228184214.337119-1-quic_rajkbhag@quicinc.com

And note the upstream device bindings for ath10k and ath11k only support the
generic binding qcom,calibration-variant.

There are no longer any generation-specific bindings, see:
https://msgid.link/20250225-b-wifi-qcom-calibration-variant-v1-0-3b2aa3f89c53@linaro.org

/jeff

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] wifi: ath12k: support calibration-variant from device tree
  2026-05-27 19:52   ` Jeff Johnson
@ 2026-05-27 21:01     ` Andrew LaMarche
  2026-06-15 13:36       ` Ernest Van Hoecke
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew LaMarche @ 2026-05-27 21:01 UTC (permalink / raw)
  To: Jeff Johnson; +Cc: Jeff Johnson, linux-wireless, ath12k, linux-kernel

Ack on the deprecation of qcom,ath12k-calibration-variant in favor of the
generic qcom,calibration-variant. 

However, drivers/net/wireless/ath/ath12k/core.c still misses the logic to 
actually load in the BDF, which this patch also accomplishes. I don’t see that
in the Qualcomm-authored series you linked. Perhaps a v2 to address this?

Andrew

> On May 27, 2026, at 3:52 PM, Jeff Johnson <jeff.johnson@oss.qualcomm.com> wrote:
> 
> On 5/27/2026 9:12 AM, Andrew LaMarche wrote:
>> Hi,
>> 
>> A kind ping here. I’m not sure why this functionality is missing in the first place, but it is needed for loading caldata from the device tree.
> 
> Your patch duplicates functionality in the Qualcomm authored series:
> https://msgid.link/20250228184214.337119-1-quic_rajkbhag@quicinc.com
> 
> And note the upstream device bindings for ath10k and ath11k only support the
> generic binding qcom,calibration-variant.
> 
> There are no longer any generation-specific bindings, see:
> https://msgid.link/20250225-b-wifi-qcom-calibration-variant-v1-0-3b2aa3f89c53@linaro.org
> 
> /jeff


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] wifi: ath12k: support calibration-variant from device tree
  2026-05-27 21:01     ` Andrew LaMarche
@ 2026-06-15 13:36       ` Ernest Van Hoecke
  2026-06-29  8:21         ` Ernest Van Hoecke
  0 siblings, 1 reply; 7+ messages in thread
From: Ernest Van Hoecke @ 2026-06-15 13:36 UTC (permalink / raw)
  To: Andrew LaMarche
  Cc: Jeff Johnson, Jeff Johnson, linux-wireless, ath12k, linux-kernel

On Wed, May 27, 2026 at 05:01:51PM -0400, Andrew LaMarche wrote:
> Ack on the deprecation of qcom,ath12k-calibration-variant in favor of the
> generic qcom,calibration-variant. 
> 
> However, drivers/net/wireless/ath/ath12k/core.c still misses the logic to 
> actually load in the BDF, which this patch also accomplishes. I don’t see that
> in the Qualcomm-authored series you linked. Perhaps a v2 to address this?
> 
> Andrew
> 
> > On May 27, 2026, at 3:52 PM, Jeff Johnson <jeff.johnson@oss.qualcomm.com> wrote:
> > 
> > On 5/27/2026 9:12 AM, Andrew LaMarche wrote:
> >> Hi,
> >> 
> >> A kind ping here. I’m not sure why this functionality is missing in the first place, but it is needed for loading caldata from the device tree.
> > 
> > Your patch duplicates functionality in the Qualcomm authored series:
> > https://msgid.link/20250228184214.337119-1-quic_rajkbhag@quicinc.com
> > 
> > And note the upstream device bindings for ath10k and ath11k only support the
> > generic binding qcom,calibration-variant.
> > 
> > There are no longer any generation-specific bindings, see:
> > https://msgid.link/20250225-b-wifi-qcom-calibration-variant-v1-0-3b2aa3f89c53@linaro.org
> > 
> > /jeff
> 

Hi Jeff,
Hi Andrew,

We also need this functionality, and as Andrew noted, the patch series
from Qualcomm does not actually address this.

I believe some confusion arose because the patch series mentions the
"qcom,calibration-variant" DT property, but it does nothing to implement
this in the driver. In that series it only exists within a schema file:
Documentation/devicetree/bindings/net/wireless/qcom,ipq5332-wifi.yaml

Our need for this property was previously discussed here, and for now I
don't see a way forward without it:
https://lore.kernel.org/all/77vowy4ax4cl6dlc45i2q3fjmwn3q676wqghq267tmbix7773b@27h5t66mflur/

Thanks a lot for your work here.

Best regards,
Ernest

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] wifi: ath12k: support calibration-variant from device tree
  2026-06-15 13:36       ` Ernest Van Hoecke
@ 2026-06-29  8:21         ` Ernest Van Hoecke
  2026-06-29 18:21           ` Andrew LaMarche
  0 siblings, 1 reply; 7+ messages in thread
From: Ernest Van Hoecke @ 2026-06-29  8:21 UTC (permalink / raw)
  To: Andrew LaMarche
  Cc: Jeff Johnson, Jeff Johnson, linux-wireless, ath12k, linux-kernel

On Mon, Jun 15, 2026 at 03:36:50PM +0200, Ernest Van Hoecke wrote:
> On Wed, May 27, 2026 at 05:01:51PM -0400, Andrew LaMarche wrote:
> > Ack on the deprecation of qcom,ath12k-calibration-variant in favor of the
> > generic qcom,calibration-variant. 
> > 
> > However, drivers/net/wireless/ath/ath12k/core.c still misses the logic to 
> > actually load in the BDF, which this patch also accomplishes. I don’t see that
> > in the Qualcomm-authored series you linked. Perhaps a v2 to address this?
> > 
> > Andrew
> > 
> > > On May 27, 2026, at 3:52 PM, Jeff Johnson <jeff.johnson@oss.qualcomm.com> wrote:
> > > 
> > > On 5/27/2026 9:12 AM, Andrew LaMarche wrote:
> > >> Hi,
> > >> 
> > >> A kind ping here. I’m not sure why this functionality is missing in the first place, but it is needed for loading caldata from the device tree.
> > > 
> > > Your patch duplicates functionality in the Qualcomm authored series:
> > > https://msgid.link/20250228184214.337119-1-quic_rajkbhag@quicinc.com
> > > 
> > > And note the upstream device bindings for ath10k and ath11k only support the
> > > generic binding qcom,calibration-variant.
> > > 
> > > There are no longer any generation-specific bindings, see:
> > > https://msgid.link/20250225-b-wifi-qcom-calibration-variant-v1-0-3b2aa3f89c53@linaro.org
> > > 
> > > /jeff
> > 
> 
> Hi Jeff,
> Hi Andrew,
> 
> We also need this functionality, and as Andrew noted, the patch series
> from Qualcomm does not actually address this.
> 
> I believe some confusion arose because the patch series mentions the
> "qcom,calibration-variant" DT property, but it does nothing to implement
> this in the driver. In that series it only exists within a schema file:
> Documentation/devicetree/bindings/net/wireless/qcom,ipq5332-wifi.yaml
> 
> Our need for this property was previously discussed here, and for now I
> don't see a way forward without it:
> https://lore.kernel.org/all/77vowy4ax4cl6dlc45i2q3fjmwn3q676wqghq267tmbix7773b@27h5t66mflur/
> 
> Thanks a lot for your work here.
> 
> Best regards,
> Ernest
> 

Hi Andrew,

Are you planning to send a v2 of this?

If not, I'm considering sending a version of this with the
qcom,calibration-variant binding to move this forward.

Thanks for your work here!

Kind regards,
Ernest


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] wifi: ath12k: support calibration-variant from device tree
  2026-06-29  8:21         ` Ernest Van Hoecke
@ 2026-06-29 18:21           ` Andrew LaMarche
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew LaMarche @ 2026-06-29 18:21 UTC (permalink / raw)
  To: Ernest Van Hoecke
  Cc: Jeff Johnson, Jeff Johnson, linux-wireless, ath12k, linux-kernel

I will prepare v2 this week.

> On Jun 29, 2026, at 4:21 AM, Ernest Van Hoecke <ernestvanhoecke@gmail.com> wrote:
> 
> On Mon, Jun 15, 2026 at 03:36:50PM +0200, Ernest Van Hoecke wrote:
>> On Wed, May 27, 2026 at 05:01:51PM -0400, Andrew LaMarche wrote:
>>> Ack on the deprecation of qcom,ath12k-calibration-variant in favor of the
>>> generic qcom,calibration-variant. 
>>> 
>>> However, drivers/net/wireless/ath/ath12k/core.c still misses the logic to 
>>> actually load in the BDF, which this patch also accomplishes. I don’t see that
>>> in the Qualcomm-authored series you linked. Perhaps a v2 to address this?
>>> 
>>> Andrew
>>> 
>>>> On May 27, 2026, at 3:52 PM, Jeff Johnson <jeff.johnson@oss.qualcomm.com> wrote:
>>>> 
>>>> On 5/27/2026 9:12 AM, Andrew LaMarche wrote:
>>>>> Hi,
>>>>> 
>>>>> A kind ping here. I’m not sure why this functionality is missing in the first place, but it is needed for loading caldata from the device tree.
>>>> 
>>>> Your patch duplicates functionality in the Qualcomm authored series:
>>>> https://msgid.link/20250228184214.337119-1-quic_rajkbhag@quicinc.com
>>>> 
>>>> And note the upstream device bindings for ath10k and ath11k only support the
>>>> generic binding qcom,calibration-variant.
>>>> 
>>>> There are no longer any generation-specific bindings, see:
>>>> https://msgid.link/20250225-b-wifi-qcom-calibration-variant-v1-0-3b2aa3f89c53@linaro.org
>>>> 
>>>> /jeff
>>> 
>> 
>> Hi Jeff,
>> Hi Andrew,
>> 
>> We also need this functionality, and as Andrew noted, the patch series
>> from Qualcomm does not actually address this.
>> 
>> I believe some confusion arose because the patch series mentions the
>> "qcom,calibration-variant" DT property, but it does nothing to implement
>> this in the driver. In that series it only exists within a schema file:
>> Documentation/devicetree/bindings/net/wireless/qcom,ipq5332-wifi.yaml
>> 
>> Our need for this property was previously discussed here, and for now I
>> don't see a way forward without it:
>> https://lore.kernel.org/all/77vowy4ax4cl6dlc45i2q3fjmwn3q676wqghq267tmbix7773b@27h5t66mflur/
>> 
>> Thanks a lot for your work here.
>> 
>> Best regards,
>> Ernest
>> 
> 
> Hi Andrew,
> 
> Are you planning to send a v2 of this?
> 
> If not, I'm considering sending a version of this with the
> qcom,calibration-variant binding to move this forward.
> 
> Thanks for your work here!
> 
> Kind regards,
> Ernest
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-06-29 18:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-31  0:32 [PATCH 1/1] wifi: ath12k: support calibration-variant from device tree Andrew LaMarche
2026-05-27 16:12 ` Andrew LaMarche
2026-05-27 19:52   ` Jeff Johnson
2026-05-27 21:01     ` Andrew LaMarche
2026-06-15 13:36       ` Ernest Van Hoecke
2026-06-29  8:21         ` Ernest Van Hoecke
2026-06-29 18:21           ` Andrew LaMarche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox