[PATCH ath-next 1/3] wifi: ath12k: allocate the AFC memory region requested by firmware

Rameshkumar Sundaram rameshkumar.sundaram at oss.qualcomm.com
Mon Nov 2 02:36:18 PST 2026


On 10/31/2026 3:38 AM, Goran Sustek wrote:
> 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

In that case, shouldn't chunk->size be cleared when no memory is 
allocated, or should the response only contain the chunks that were 
actually allocated and assigned by host ? (see 
ath12k_qmi_assign_target_mem_chunk() which updates ab->qmi.mem_seg_count)

Allocating AFC_REGION_TYPE while AFC itself is not supported by the host 
looks wrong to me.

> 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 at 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
> 


-- 
Ramesh



More information about the ath12k mailing list