All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH ath-next v3 0/2] wifi: ath12k: accept what newer QCN9274 firmware requests at boot
@ 2026-11-10  0:21 Goran Sustek
  2026-11-10  0:21 ` [PATCH ath-next v3 1/2] wifi: ath12k: report size 0 for unsupported target memory types Goran Sustek
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Goran Sustek @ 2026-11-10  0:21 UTC (permalink / raw)
  To: Jeff Johnson
  Cc: linux-wireless, ath12k, linux-kernel, Rameshkumar Sundaram,
	Nazar Mokrynskyi

QCN9274 firmware WLAN.WBE.1.6-01243 requests two things at boot that
ath12k does not implement: a target memory segment of type 0xa (AFC)
and direct buffer rings for module IDs 2 and 3. Neither is needed for
operation. Today the first gets a wrong answer and the second aborts
the parse of the service ready ext event.

Patch 1 answers every unsupported memory type with size 0. Patch 2
skips unknown ring module IDs instead of failing the parse. Both keep
a warning, so the gap between firmware and driver stays visible.

v3:
- 1/2: clear the size in the default case, no AFC case; keep the
  warning; describe only the response change (Rameshkumar Sundaram).
- 2/2: warn for a skipped entry instead of a debug message.
- Rebased on ath-next.

v2:
- 1/2: do not allocate the region, answer with size 0 (Rameshkumar
  Sundaram); former 3/3 dropped.
- 2/2: commit message and comment reworded.

v2: https://lore.kernel.org/r/20261102200235.48973-1-gsustek@gmail.com
v1: https://lore.kernel.org/r/20261030220836.14164-1-gsustek@gmail.com

Goran Sustek (2):
  wifi: ath12k: report size 0 for unsupported target memory types
  wifi: ath12k: skip unknown direct buffer ring module IDs

 drivers/net/wireless/ath/ath12k/qmi.c |  1 +
 drivers/net/wireless/ath/ath12k/wmi.c | 43 +++++++++++++++++----------
 2 files changed, 29 insertions(+), 15 deletions(-)


base-commit: d0fbb39d65dc9dcb4175fa6b23e473dec3670f4d
-- 
2.56.0


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

* [PATCH ath-next v3 1/2] wifi: ath12k: report size 0 for unsupported target memory types
  2026-11-10  0:21 [PATCH ath-next v3 0/2] wifi: ath12k: accept what newer QCN9274 firmware requests at boot Goran Sustek
@ 2026-11-10  0:21 ` Goran Sustek
  2026-11-10  0:21 ` [PATCH ath-next v3 2/2] wifi: ath12k: skip unknown direct buffer ring module IDs Goran Sustek
  2026-11-10  7:36 ` [PATCH ath-next v3 0/2] wifi: ath12k: accept what newer QCN9274 firmware requests at boot Rameshkumar Sundaram
  2 siblings, 0 replies; 4+ messages in thread
From: Goran Sustek @ 2026-11-10  0:21 UTC (permalink / raw)
  To: Jeff Johnson
  Cc: linux-wireless, ath12k, linux-kernel, Rameshkumar Sundaram,
	Nazar Mokrynskyi

For a target memory segment of an unsupported type,
ath12k_qmi_alloc_target_mem_chunk() warns, clears the DMA address in
chunk->paddr and keeps the requested size. The response then carries
address 0 with a non-zero size for that segment.

QCN9274 firmware WLAN.WBE.1.6-01243 requests such a segment at every
boot: type 0xa (QMI_WLFW_AFC_MEM_V01), 8 KiB for an Automated Frequency
Coordination response, which ath12k does not support:

  ath12k_wifi7_pci 0000:06:00.0: memory type 10 not supported

The firmware treats a non-zero size as a provided region and maps the
given address. Nothing visible follows with this firmware: memory ready,
firmware ready and all radios come up with or without this change. The
response is still wrong, since it claims a region the host did not
provide.

Clear the size as well, so that an unsupported type is answered with
address 0 and size 0, which the firmware treats as not provided. The
warning is unchanged.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.6-01243-QCAHKSWPL_SILICONZ-1
Signed-off-by: Goran Sustek <gsustek@gmail.com>
---
v3: size cleared in the default case, no AFC case; warning kept;
    message reworded (Rameshkumar Sundaram)
v2: no allocation, size 0 (Rameshkumar Sundaram)

 drivers/net/wireless/ath/ath12k/qmi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c
index 52a925fc44ee..4aaee5870ae9 100644
--- a/drivers/net/wireless/ath/ath12k/qmi.c
+++ b/drivers/net/wireless/ath/ath12k/qmi.c
@@ -2792,6 +2792,7 @@ static int ath12k_qmi_alloc_target_mem_chunk(struct ath12k_base *ab)
 				    chunk->type);
 			chunk->paddr = 0;
 			chunk->v.addr = NULL;
+			chunk->size = 0;
 			break;
 		}
 	}
-- 
2.56.0


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

* [PATCH ath-next v3 2/2] wifi: ath12k: skip unknown direct buffer ring module IDs
  2026-11-10  0:21 [PATCH ath-next v3 0/2] wifi: ath12k: accept what newer QCN9274 firmware requests at boot Goran Sustek
  2026-11-10  0:21 ` [PATCH ath-next v3 1/2] wifi: ath12k: report size 0 for unsupported target memory types Goran Sustek
@ 2026-11-10  0:21 ` Goran Sustek
  2026-11-10  7:36 ` [PATCH ath-next v3 0/2] wifi: ath12k: accept what newer QCN9274 firmware requests at boot Rameshkumar Sundaram
  2 siblings, 0 replies; 4+ messages in thread
From: Goran Sustek @ 2026-11-10  0:21 UTC (permalink / raw)
  To: Jeff Johnson
  Cc: linux-wireless, ath12k, linux-kernel, Rameshkumar Sundaram,
	Nazar Mokrynskyi

QCN9274 firmware WLAN.WBE.1.6-01243 advertises direct buffer rings for
module IDs 2 (CV upload) and 3 (Wi-Fi radar). ath12k_wmi_dma_ring_caps()
treats any ID at or above WMI_DIRECT_BUF_MAX as fatal:

  ath12k_wifi7_pci 0000:06:00.0: Invalid module id 2
  ath12k_wifi7_pci 0000:06:00.0: failed to parse tlv -22

It frees the capabilities stored so far and aborts the parse of the
service ready ext event; initialisation continues only because the
service ready ext2 event completes it.

An unknown ID is not an error: the firmware uses a ring only after the
host configures it, and the host does that only for a feature it
implements. Skip such entries with a warning, as for an unsupported
memory type in ath12k_qmi_alloc_target_mem_chunk(). Store the accepted
entries contiguously and set num_db_cap to the stored count, so that a
skipped entry cannot read as a zero-sized spectral ring.

Based on Nazar Mokrynskyi's version, with the separate count that Jeff
Johnson suggested in its review.

Link: https://lore.kernel.org/linux-wireless/20260505172415.566328-3-nazar@mokrynskyi.com/
Suggested-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.6-01243-QCAHKSWPL_SILICONZ-1
Signed-off-by: Goran Sustek <gsustek@gmail.com>
---
v3: warning instead of a debug message for a skipped entry
v2: commit message and comment reworded

 drivers/net/wireless/ath/ath12k/wmi.c | 43 +++++++++++++++++----------
 1 file changed, 28 insertions(+), 15 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
index f41138a7c68e..9720bed21631 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -4988,8 +4988,8 @@ static int ath12k_wmi_dma_ring_caps(struct ath12k_base *ab,
 	struct ath12k_wmi_dma_ring_caps_parse *dma_caps_parse = data;
 	struct ath12k_wmi_dma_ring_caps_params *dma_caps;
 	struct ath12k_dbring_cap *dir_buff_caps;
+	u32 i, n = 0, module_id;
 	int ret;
-	u32 i;
 
 	dma_caps_parse->n_dma_ring_caps = 0;
 	dma_caps = (struct ath12k_wmi_dma_ring_caps_params *)ptr;
@@ -5015,26 +5015,39 @@ static int ath12k_wmi_dma_ring_caps(struct ath12k_base *ab,
 
 	dir_buff_caps = ab->db_caps;
 	for (i = 0; i < dma_caps_parse->n_dma_ring_caps; i++) {
-		if (le32_to_cpu(dma_caps[i].module_id) >= WMI_DIRECT_BUF_MAX) {
-			ath12k_warn(ab, "Invalid module id %d\n",
-				    le32_to_cpu(dma_caps[i].module_id));
-			ret = -EINVAL;
-			goto free_dir_buff;
+		module_id = le32_to_cpu(dma_caps[i].module_id);
+
+		/* Firmware may advertise rings for modules this driver
+		 * does not implement. It uses a ring only after the host
+		 * configures it, so skipping the entry is safe. Warn, as
+		 * for an unsupported memory type, so the gap is visible.
+		 */
+		if (module_id >= WMI_DIRECT_BUF_MAX) {
+			ath12k_warn(ab, "dma ring caps for module id %u not supported, skipping\n",
+				    module_id);
+			continue;
 		}
 
-		dir_buff_caps[i].id = le32_to_cpu(dma_caps[i].module_id);
-		dir_buff_caps[i].pdev_id =
+		dir_buff_caps[n].id = module_id;
+		dir_buff_caps[n].pdev_id =
 			DP_HW2SW_MACID(le32_to_cpu(dma_caps[i].pdev_id));
-		dir_buff_caps[i].min_elem = le32_to_cpu(dma_caps[i].min_elem);
-		dir_buff_caps[i].min_buf_sz = le32_to_cpu(dma_caps[i].min_buf_sz);
-		dir_buff_caps[i].min_buf_align = le32_to_cpu(dma_caps[i].min_buf_align);
+		dir_buff_caps[n].min_elem = le32_to_cpu(dma_caps[i].min_elem);
+		dir_buff_caps[n].min_buf_sz = le32_to_cpu(dma_caps[i].min_buf_sz);
+		dir_buff_caps[n].min_buf_align = le32_to_cpu(dma_caps[i].min_buf_align);
+		n++;
 	}
 
-	return 0;
+	if (!n) {
+		ath12k_wmi_free_dbring_caps(ab);
+		return 0;
+	}
 
-free_dir_buff:
-	ath12k_wmi_free_dbring_caps(ab);
-	return ret;
+	/* count only the entries stored, so no zeroed entry looks like
+	 * a spectral ring
+	 */
+	ab->num_db_cap = n;
+
+	return 0;
 }
 
 static void
-- 
2.56.0


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

* Re: [PATCH ath-next v3 0/2] wifi: ath12k: accept what newer QCN9274 firmware requests at boot
  2026-11-10  0:21 [PATCH ath-next v3 0/2] wifi: ath12k: accept what newer QCN9274 firmware requests at boot Goran Sustek
  2026-11-10  0:21 ` [PATCH ath-next v3 1/2] wifi: ath12k: report size 0 for unsupported target memory types Goran Sustek
  2026-11-10  0:21 ` [PATCH ath-next v3 2/2] wifi: ath12k: skip unknown direct buffer ring module IDs Goran Sustek
@ 2026-11-10  7:36 ` Rameshkumar Sundaram
  2 siblings, 0 replies; 4+ messages in thread
From: Rameshkumar Sundaram @ 2026-11-10  7:36 UTC (permalink / raw)
  To: Goran Sustek, Jeff Johnson
  Cc: linux-wireless, ath12k, linux-kernel, Nazar Mokrynskyi

On 11/10/2026 5:51 AM, Goran Sustek wrote:
> QCN9274 firmware WLAN.WBE.1.6-01243 requests two things at boot that
> ath12k does not implement: a target memory segment of type 0xa (AFC)
> and direct buffer rings for module IDs 2 and 3. Neither is needed for
> operation. Today the first gets a wrong answer and the second aborts
> the parse of the service ready ext event.
> 
> Patch 1 answers every unsupported memory type with size 0. Patch 2
> skips unknown ring module IDs instead of failing the parse. Both keep
> a warning, so the gap between firmware and driver stays visible.
> 
> v3:
> - 1/2: clear the size in the default case, no AFC case; keep the
>    warning; describe only the response change (Rameshkumar Sundaram).
> - 2/2: warn for a skipped entry instead of a debug message.
> - Rebased on ath-next.
> 
> v2:
> - 1/2: do not allocate the region, answer with size 0 (Rameshkumar
>    Sundaram); former 3/3 dropped.
> - 2/2: commit message and comment reworded.
> 
> v2: https://lore.kernel.org/r/20261102200235.48973-1-gsustek@gmail.com
> v1: https://lore.kernel.org/r/20261030220836.14164-1-gsustek@gmail.com
> 
> Goran Sustek (2):
>    wifi: ath12k: report size 0 for unsupported target memory types
>    wifi: ath12k: skip unknown direct buffer ring module IDs
> 
>   drivers/net/wireless/ath/ath12k/qmi.c |  1 +
>   drivers/net/wireless/ath/ath12k/wmi.c | 43 +++++++++++++++++----------
>   2 files changed, 29 insertions(+), 15 deletions(-)
> 
> 
> base-commit: d0fbb39d65dc9dcb4175fa6b23e473dec3670f4d

Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>

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

end of thread, other threads:[~2026-11-10  7:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-10  0:21 [PATCH ath-next v3 0/2] wifi: ath12k: accept what newer QCN9274 firmware requests at boot Goran Sustek
2026-11-10  0:21 ` [PATCH ath-next v3 1/2] wifi: ath12k: report size 0 for unsupported target memory types Goran Sustek
2026-11-10  0:21 ` [PATCH ath-next v3 2/2] wifi: ath12k: skip unknown direct buffer ring module IDs Goran Sustek
2026-11-10  7:36 ` [PATCH ath-next v3 0/2] wifi: ath12k: accept what newer QCN9274 firmware requests at boot Rameshkumar Sundaram

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.