From: Goran Sustek <gsustek@gmail.com>
To: Jeff Johnson <jjohnson@kernel.org>
Cc: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH ath-next 1/3] wifi: ath12k: allocate the AFC memory region requested by firmware
Date: Fri, 30 Oct 2026 23:08:22 +0100 [thread overview]
Message-ID: <20261030220824.915760-2-gsustek@gmail.com> (raw)
In-Reply-To: <20261030220824.915760-1-gsustek@gmail.com>
QCN9274 firmware WLAN.WBE.1.6-01243 requests a target memory segment of
type 0xa at every boot. The driver does not know this type, so it logs
ath12k_wifi7_pci 0000:06:00.0: memory type 10 not supported
and answers the request with a NULL address but the requested size.
Type 0xa is the AFC region: QMI_WLFW_AFC_MEM_V01 = 10 in Qualcomm's
wlan_firmware_service_v01.h. The firmware asks for 8 KiB, one 4 KiB
slot per radio, where the host places the answer of an Automated
Frequency Coordination server for 6 GHz Standard Power operation.
The firmware's handler of the memory response records the reported
address and marks the region as provided whenever the size is
non-zero; it does not check for a zero address. With the current
NULL answer the firmware therefore holds a region at bus address 0.
This driver never enables AFC and no misbehaviour has been observed,
but the firmware state is wrong.
Name the type and allocate it like the other host regions, bounded to
two 4 KiB slots. This removes the warning and gives the firmware a
valid region. An oversized request keeps today's behaviour with a
warning.
Tested as part of the series.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.6-01243-QCAHKSWPL_SILICONZ-1
Signed-off-by: Goran Sustek <gsustek@gmail.com>
---
drivers/net/wireless/ath/ath12k/qmi.c | 17 +++++++++++++++++
drivers/net/wireless/ath/ath12k/qmi.h | 3 +++
2 files changed, 20 insertions(+)
diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c
index 280e50a1f31d..0679e5d2d4fc 100644
--- a/drivers/net/wireless/ath/ath12k/qmi.c
+++ b/drivers/net/wireless/ath/ath12k/qmi.c
@@ -2707,6 +2707,23 @@ static int ath12k_qmi_alloc_target_mem_chunk(struct ath12k_base *ab)
if (ret)
goto err;
break;
+ case AFC_REGION_TYPE:
+ /* Firmware requests the AFC region at every boot, even
+ * when the 6 GHz radio does not use Standard Power. It
+ * treats a non-zero size as a provided region, so hand
+ * it real memory instead of a NULL address.
+ */
+ if (chunk->size > ATH12K_QMI_AFC_MEM_SIZE) {
+ ath12k_warn(ab, "AFC memory request of %u B exceeds %u B, not allocated\n",
+ chunk->size, ATH12K_QMI_AFC_MEM_SIZE);
+ chunk->paddr = 0;
+ chunk->v.addr = NULL;
+ break;
+ }
+ ret = ath12k_qmi_alloc_chunk(ab, chunk);
+ if (ret)
+ goto err;
+ break;
case MLO_GLOBAL_MEM_REGION_TYPE:
mlo_size += chunk->size;
if (ag->mlo_mem.mlo_mem_size &&
diff --git a/drivers/net/wireless/ath/ath12k/qmi.h b/drivers/net/wireless/ath/ath12k/qmi.h
index 6da10f3cb597..c438ef6c7680 100644
--- a/drivers/net/wireless/ath/ath12k/qmi.h
+++ b/drivers/net/wireless/ath/ath12k/qmi.h
@@ -26,6 +26,8 @@
#define ATH12K_QMI_BDF_EXT_STR_LENGTH 0x20
#define ATH12K_QMI_WLFW_MAX_DEV_MEM_NUM_V01 4
#define ATH12K_QMI_DEVMEM_CMEM_INDEX 0
+/* AFC region: one 4 KiB slot per radio, at most two radios */
+#define ATH12K_QMI_AFC_MEM_SIZE (2 * 0x1000)
#define QMI_WLFW_REQUEST_MEM_IND_V01 0x0035
#define QMI_WLFW_FW_MEM_READY_IND_V01 0x0037
@@ -173,6 +175,7 @@ enum ath12k_qmi_target_mem {
CALDB_MEM_REGION_TYPE = 0x4,
MLO_GLOBAL_MEM_REGION_TYPE = 0x8,
PAGEABLE_MEM_REGION_TYPE = 0x9,
+ AFC_REGION_TYPE = 0xa,
LPASS_SHARED_V01_REGION_TYPE = 0xb,
};
--
2.47.0
next prev parent reply other threads:[~2026-10-30 22:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-30 22:08 [PATCH ath-next 0/3] wifi: ath12k: accept what newer QCN9274 firmware requests at boot Goran Sustek
2026-10-30 22:08 ` Goran Sustek [this message]
2026-10-30 22:08 ` [PATCH ath-next 2/3] wifi: ath12k: skip unknown direct buffer ring module IDs Goran Sustek
2026-10-30 22:08 ` [PATCH ath-next 3/3] wifi: ath12k: name direct buffer ring modules 2 and 3 Goran Sustek
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=20261030220824.915760-2-gsustek@gmail.com \
--to=gsustek@gmail.com \
--cc=ath12k@lists.infradead.org \
--cc=jjohnson@kernel.org \
--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