* [PATCH ath-next v2 0/2] wifi: ath12k: refactor m3/aux_uc firmware memory handling
@ 2026-11-04 6:30 Madhavan Ganesan
2026-11-04 6:30 ` [PATCH ath-next v2 1/2] wifi: ath12k: rename m3_mem_region to ath12k_fw_mem_region Madhavan Ganesan
` (5 more replies)
0 siblings, 6 replies; 10+ messages in thread
From: Madhavan Ganesan @ 2026-11-04 6:30 UTC (permalink / raw)
To: Jeff Johnson; +Cc: linux-wireless, ath12k, linux-kernel, Madhavan Ganesan
ath12k_qmi_m3_free()/ath12k_qmi_m3_load() and
ath12k_qmi_aux_uc_free()/ath12k_qmi_aux_uc_load() carry near-identical
logic for freeing a DMA-coherent firmware memory region and loading
firmware into it. Factor the shared logic into common helpers.
Patch 1 is a preparatory, no-functional-change rename of
struct m3_mem_region to struct ath12k_fw_mem_region, since the type
is also used for the aux_uc region and the old name no longer
reflects its purpose.
Patch 2 refactors the shared free/load logic into
ath12k_qmi_free_mem_region() and ath12k_qmi_fw_mem_load(), and
rewires the m3 and aux_uc wrappers to use them.
---
Changes in v2:
- Addressed the review comments.
---
Madhavan Ganesan (2):
wifi: ath12k: rename m3_mem_region to ath12k_fw_mem_region
wifi: ath12k: refactor m3 and aux_uc firmware memory handling
drivers/net/wireless/ath/ath12k/qmi.c | 168 ++++++++++++----------------------
drivers/net/wireless/ath/ath12k/qmi.h | 6 +-
2 files changed, 60 insertions(+), 114 deletions(-)
---
base-commit: a2da7677eb9a12e7860814b70a1f6f5b0e347d7d
change-id: 20261103-m3_and_aux_ucode-8337b881155c
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH ath-next v2 1/2] wifi: ath12k: rename m3_mem_region to ath12k_fw_mem_region
2026-11-04 6:30 [PATCH ath-next v2 0/2] wifi: ath12k: refactor m3/aux_uc firmware memory handling Madhavan Ganesan
@ 2026-11-04 6:30 ` Madhavan Ganesan
2026-11-04 6:30 ` [PATCH ath-next v2 2/2] wifi: ath12k: refactor m3 and aux_uc firmware memory handling Madhavan Ganesan
` (4 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Madhavan Ganesan @ 2026-11-04 6:30 UTC (permalink / raw)
To: Jeff Johnson; +Cc: linux-wireless, ath12k, linux-kernel, Madhavan Ganesan
struct m3_mem_region is also used for the aux_uc firmware memory
region, so the name no longer reflects its purpose. Rename it to
ath12k_fw_mem_region to make clear it is a generic firmware memory
region descriptor shared across m3 and aux_uc.
No functional change.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.6-01243-QCAHKSWPL_SILICONZ-1
Signed-off-by: Madhavan Ganesan <madhavan.ganesan@oss.qualcomm.com>
---
drivers/net/wireless/ath/ath12k/qmi.c | 12 ++++++------
drivers/net/wireless/ath/ath12k/qmi.h | 6 +++---
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c
index 817bd820623d..b1efed1702cb 100644
--- a/drivers/net/wireless/ath/ath12k/qmi.c
+++ b/drivers/net/wireless/ath/ath12k/qmi.c
@@ -3227,7 +3227,7 @@ int ath12k_qmi_load_bdf_qmi(struct ath12k_base *ab,
static void ath12k_qmi_m3_free(struct ath12k_base *ab)
{
- struct m3_mem_region *m3_mem = &ab->qmi.m3_mem;
+ struct ath12k_fw_mem_region *m3_mem = &ab->qmi.m3_mem;
if (ab->hw_params->fw.m3_loader == ath12k_m3_fw_loader_remoteproc)
return;
@@ -3244,7 +3244,7 @@ static void ath12k_qmi_m3_free(struct ath12k_base *ab)
static int ath12k_qmi_m3_load(struct ath12k_base *ab)
{
- struct m3_mem_region *m3_mem = &ab->qmi.m3_mem;
+ struct ath12k_fw_mem_region *m3_mem = &ab->qmi.m3_mem;
const struct firmware *fw = NULL;
const void *m3_data;
char path[100];
@@ -3309,7 +3309,7 @@ static int ath12k_qmi_m3_load(struct ath12k_base *ab)
static noinline_for_stack
int ath12k_qmi_wlanfw_m3_info_send(struct ath12k_base *ab)
{
- struct m3_mem_region *m3_mem = &ab->qmi.m3_mem;
+ struct ath12k_fw_mem_region *m3_mem = &ab->qmi.m3_mem;
struct qmi_wlanfw_m3_info_req_msg_v01 req = {};
struct qmi_wlanfw_m3_info_resp_msg_v01 resp = {};
struct qmi_txn txn;
@@ -3359,7 +3359,7 @@ int ath12k_qmi_wlanfw_m3_info_send(struct ath12k_base *ab)
static void ath12k_qmi_aux_uc_free(struct ath12k_base *ab)
{
- struct m3_mem_region *aux_uc_mem = &ab->qmi.aux_uc_mem;
+ struct ath12k_fw_mem_region *aux_uc_mem = &ab->qmi.aux_uc_mem;
if (!aux_uc_mem->vaddr)
return;
@@ -3373,7 +3373,7 @@ static void ath12k_qmi_aux_uc_free(struct ath12k_base *ab)
static int ath12k_qmi_aux_uc_load(struct ath12k_base *ab)
{
- struct m3_mem_region *aux_uc_mem = &ab->qmi.aux_uc_mem;
+ struct ath12k_fw_mem_region *aux_uc_mem = &ab->qmi.aux_uc_mem;
const struct firmware *fw = NULL;
const void *aux_uc_data;
char path[100];
@@ -3435,7 +3435,7 @@ static int ath12k_qmi_aux_uc_load(struct ath12k_base *ab)
static noinline_for_stack
int ath12k_qmi_wlanfw_aux_uc_info_send(struct ath12k_base *ab)
{
- struct m3_mem_region *aux_uc_mem = &ab->qmi.aux_uc_mem;
+ struct ath12k_fw_mem_region *aux_uc_mem = &ab->qmi.aux_uc_mem;
struct qmi_wlanfw_aux_uc_info_req_msg_v01 req = {};
struct qmi_wlanfw_aux_uc_info_resp_msg_v01 resp = {};
struct qmi_txn txn;
diff --git a/drivers/net/wireless/ath/ath12k/qmi.h b/drivers/net/wireless/ath/ath12k/qmi.h
index 1b1c88906f1e..e43e4a42aad7 100644
--- a/drivers/net/wireless/ath/ath12k/qmi.h
+++ b/drivers/net/wireless/ath/ath12k/qmi.h
@@ -118,7 +118,7 @@ struct target_info {
char bdf_ext[ATH12K_QMI_BDF_EXT_STR_LENGTH];
};
-struct m3_mem_region {
+struct ath12k_fw_mem_region {
/* total memory allocated */
u32 total_size;
/* actual memory being used */
@@ -152,8 +152,8 @@ struct ath12k_qmi {
u8 num_radios;
struct target_info target;
- struct m3_mem_region m3_mem;
- struct m3_mem_region aux_uc_mem;
+ struct ath12k_fw_mem_region m3_mem;
+ struct ath12k_fw_mem_region aux_uc_mem;
unsigned int service_ins_id;
struct dev_mem_info dev_mem[ATH12K_QMI_WLFW_MAX_DEV_MEM_NUM_V01];
u8 dynamic_ddr_support;
--
2.34.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH ath-next v2 2/2] wifi: ath12k: refactor m3 and aux_uc firmware memory handling
2026-11-04 6:30 [PATCH ath-next v2 0/2] wifi: ath12k: refactor m3/aux_uc firmware memory handling Madhavan Ganesan
2026-11-04 6:30 ` [PATCH ath-next v2 1/2] wifi: ath12k: rename m3_mem_region to ath12k_fw_mem_region Madhavan Ganesan
@ 2026-11-04 6:30 ` Madhavan Ganesan
2026-11-04 17:52 ` Jeff Johnson
2026-11-04 6:53 ` [PATCH ath-next v2 0/2] wifi: ath12k: refactor m3/aux_uc " Baochen Qiang
` (3 subsequent siblings)
5 siblings, 1 reply; 10+ messages in thread
From: Madhavan Ganesan @ 2026-11-04 6:30 UTC (permalink / raw)
To: Jeff Johnson; +Cc: linux-wireless, ath12k, linux-kernel, Madhavan Ganesan
ath12k_qmi_m3_free()/ath12k_qmi_m3_load() and
ath12k_qmi_aux_uc_free()/ath12k_qmi_aux_uc_load() implement identical
logic for freeing a DMA-coherent firmware memory region and for
loading firmware into it (reuse existing buffer if large enough,
otherwise free and reallocate, falling back to a standalone firmware
file when no embedded data is present).
Factor the common logic into ath12k_qmi_free_mem_region() and
ath12k_qmi_fw_mem_load(), and have the m3 and aux_uc wrappers call
into them with the appropriate struct ath12k_fw_mem_region and
firmware file name. The shared free helper also clears paddr, which
the previous per-region implementations missed.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.6-01243-QCAHKSWPL_SILICONZ-1
Signed-off-by: Madhavan Ganesan <madhavan.ganesan@oss.qualcomm.com>
---
drivers/net/wireless/ath/ath12k/qmi.c | 164 ++++++++++++----------------------
1 file changed, 55 insertions(+), 109 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c
index b1efed1702cb..237df9198e76 100644
--- a/drivers/net/wireless/ath/ath12k/qmi.c
+++ b/drivers/net/wireless/ath/ath12k/qmi.c
@@ -3225,77 +3225,71 @@ int ath12k_qmi_load_bdf_qmi(struct ath12k_base *ab,
return ret;
}
-static void ath12k_qmi_m3_free(struct ath12k_base *ab)
+static void ath12k_qmi_free_mem_region(struct ath12k_base *ab,
+ struct ath12k_fw_mem_region *mem_region)
{
- struct ath12k_fw_mem_region *m3_mem = &ab->qmi.m3_mem;
-
- if (ab->hw_params->fw.m3_loader == ath12k_m3_fw_loader_remoteproc)
+ if (!mem_region->vaddr)
return;
- if (!m3_mem->vaddr)
- return;
-
- dma_free_coherent(ab->dev, m3_mem->total_size,
- m3_mem->vaddr, m3_mem->paddr);
- m3_mem->vaddr = NULL;
- m3_mem->total_size = 0;
- m3_mem->size = 0;
+ dma_free_coherent(ab->dev, mem_region->total_size,
+ mem_region->vaddr, mem_region->paddr);
+ mem_region->paddr = 0;
+ mem_region->vaddr = NULL;
+ mem_region->total_size = 0;
+ mem_region->size = 0;
}
-static int ath12k_qmi_m3_load(struct ath12k_base *ab)
+static int ath12k_qmi_fw_mem_load(struct ath12k_base *ab,
+ struct ath12k_fw_mem_region *mem_region,
+ const u8 *embedded_data, size_t embedded_len,
+ const char *filename)
{
- struct ath12k_fw_mem_region *m3_mem = &ab->qmi.m3_mem;
const struct firmware *fw = NULL;
- const void *m3_data;
+ const void *data;
char path[100];
- size_t m3_len;
+ size_t len;
int ret;
- if (ab->fw.m3_data && ab->fw.m3_len > 0) {
- /* firmware-N.bin had a m3 firmware file so use that */
- m3_data = ab->fw.m3_data;
- m3_len = ab->fw.m3_len;
+ if (embedded_data && embedded_len > 0) {
+ data = embedded_data;
+ len = embedded_len;
} else {
- /* No m3 file in firmware-N.bin so try to request old
- * separate m3.bin.
- */
- fw = ath12k_core_firmware_request(ab, ATH12K_M3_FILE);
+ fw = ath12k_core_firmware_request(ab, filename);
if (IS_ERR(fw)) {
ret = PTR_ERR(fw);
- ath12k_core_create_firmware_path(ab, ATH12K_M3_FILE,
+ ath12k_core_create_firmware_path(ab, filename,
path, sizeof(path));
ath12k_err(ab, "failed to load %s: %d\n", path, ret);
return ret;
}
- m3_data = fw->data;
- m3_len = fw->size;
+ data = fw->data;
+ len = fw->size;
}
- /* In recovery/resume cases, M3 buffer is not freed, try to reuse that */
- if (m3_mem->vaddr) {
- if (m3_mem->total_size >= m3_len)
- goto skip_m3_alloc;
+ /* In recovery/resume cases, buffer is not freed, try to reuse that */
+ if (mem_region->vaddr) {
+ if (mem_region->total_size >= len)
+ goto skip_alloc;
/* Old buffer is too small, free and reallocate */
- ath12k_qmi_m3_free(ab);
+ ath12k_qmi_free_mem_region(ab, mem_region);
}
- m3_mem->vaddr = dma_alloc_coherent(ab->dev,
- m3_len, &m3_mem->paddr,
- GFP_KERNEL);
- if (!m3_mem->vaddr) {
- ath12k_err(ab, "failed to allocate memory for M3 with size %zu\n",
- m3_len);
+ mem_region->vaddr = dma_alloc_coherent(ab->dev, len, &mem_region->paddr,
+ GFP_KERNEL);
+ if (!mem_region->vaddr) {
+ ath12k_err(ab, "failed to allocate memory for %s with size %zu\n",
+ filename, len);
ret = -ENOMEM;
goto out;
}
- m3_mem->total_size = m3_len;
+ mem_region->total_size = len;
-skip_m3_alloc:
- memcpy(m3_mem->vaddr, m3_data, m3_len);
- m3_mem->size = m3_len;
+skip_alloc:
+ memcpy(mem_region->vaddr, data, len);
+ mem_region->size = len;
ret = 0;
@@ -3305,6 +3299,21 @@ static int ath12k_qmi_m3_load(struct ath12k_base *ab)
return ret;
}
+static void ath12k_qmi_m3_free(struct ath12k_base *ab)
+{
+ if (ab->hw_params->fw.m3_loader == ath12k_m3_fw_loader_remoteproc)
+ return;
+
+ ath12k_qmi_free_mem_region(ab, &ab->qmi.m3_mem);
+}
+
+static int ath12k_qmi_m3_load(struct ath12k_base *ab)
+{
+ return ath12k_qmi_fw_mem_load(ab, &ab->qmi.m3_mem,
+ ab->fw.m3_data, ab->fw.m3_len,
+ ATH12K_M3_FILE);
+}
+
/* clang stack usage explodes if this is inlined */
static noinline_for_stack
int ath12k_qmi_wlanfw_m3_info_send(struct ath12k_base *ab)
@@ -3359,77 +3368,14 @@ int ath12k_qmi_wlanfw_m3_info_send(struct ath12k_base *ab)
static void ath12k_qmi_aux_uc_free(struct ath12k_base *ab)
{
- struct ath12k_fw_mem_region *aux_uc_mem = &ab->qmi.aux_uc_mem;
-
- if (!aux_uc_mem->vaddr)
- return;
-
- dma_free_coherent(ab->dev, aux_uc_mem->total_size,
- aux_uc_mem->vaddr, aux_uc_mem->paddr);
- aux_uc_mem->vaddr = NULL;
- aux_uc_mem->total_size = 0;
- aux_uc_mem->size = 0;
+ ath12k_qmi_free_mem_region(ab, &ab->qmi.aux_uc_mem);
}
static int ath12k_qmi_aux_uc_load(struct ath12k_base *ab)
{
- struct ath12k_fw_mem_region *aux_uc_mem = &ab->qmi.aux_uc_mem;
- const struct firmware *fw = NULL;
- const void *aux_uc_data;
- char path[100];
- size_t aux_uc_len;
- int ret;
-
- if (ab->fw.aux_uc_data && ab->fw.aux_uc_len > 0) {
- /* firmware-N.bin had a aux_uc firmware file so use that */
- aux_uc_data = ab->fw.aux_uc_data;
- aux_uc_len = ab->fw.aux_uc_len;
- } else {
- /*
- * No aux_uc file in firmware-N.bin so try to request old
- * separate aux_ucode.bin.
- */
- fw = ath12k_core_firmware_request(ab, ATH12K_AUX_UC_FILE);
- if (IS_ERR(fw)) {
- ret = PTR_ERR(fw);
- ath12k_core_create_firmware_path(ab, ATH12K_AUX_UC_FILE,
- path, sizeof(path));
- ath12k_err(ab, "failed to load %s: %d\n", path, ret);
- return ret;
- }
-
- aux_uc_data = fw->data;
- aux_uc_len = fw->size;
- }
-
- /* In recovery/resume cases, AUX_UC buffer is not freed, try to reuse that */
- if (aux_uc_mem->vaddr) {
- if (aux_uc_mem->total_size >= aux_uc_len)
- goto copy;
-
- /* Old buffer is too small, free and reallocate */
- ath12k_qmi_aux_uc_free(ab);
- }
-
- aux_uc_mem->vaddr = dma_alloc_coherent(ab->dev, aux_uc_len,
- &aux_uc_mem->paddr, GFP_KERNEL);
- if (!aux_uc_mem->vaddr) {
- ret = -ENOMEM;
- goto out;
- }
-
- aux_uc_mem->total_size = aux_uc_len;
-
-copy:
- memcpy(aux_uc_mem->vaddr, aux_uc_data, aux_uc_len);
- aux_uc_mem->size = aux_uc_len;
-
- ret = 0;
-
-out:
- release_firmware(fw);
-
- return ret;
+ return ath12k_qmi_fw_mem_load(ab, &ab->qmi.aux_uc_mem,
+ ab->fw.aux_uc_data, ab->fw.aux_uc_len,
+ ATH12K_AUX_UC_FILE);
}
static noinline_for_stack
--
2.34.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH ath-next v2 0/2] wifi: ath12k: refactor m3/aux_uc firmware memory handling
2026-11-04 6:30 [PATCH ath-next v2 0/2] wifi: ath12k: refactor m3/aux_uc firmware memory handling Madhavan Ganesan
2026-11-04 6:30 ` [PATCH ath-next v2 1/2] wifi: ath12k: rename m3_mem_region to ath12k_fw_mem_region Madhavan Ganesan
2026-11-04 6:30 ` [PATCH ath-next v2 2/2] wifi: ath12k: refactor m3 and aux_uc firmware memory handling Madhavan Ganesan
@ 2026-11-04 6:53 ` Baochen Qiang
2026-11-04 7:10 ` Madhavan Ganesan
2026-11-04 7:15 ` Baochen Qiang
` (2 subsequent siblings)
5 siblings, 1 reply; 10+ messages in thread
From: Baochen Qiang @ 2026-11-04 6:53 UTC (permalink / raw)
To: Madhavan Ganesan, Jeff Johnson; +Cc: linux-wireless, ath12k, linux-kernel
On 11/4/2026 2:30 PM, Madhavan Ganesan wrote:
> ath12k_qmi_m3_free()/ath12k_qmi_m3_load() and
> ath12k_qmi_aux_uc_free()/ath12k_qmi_aux_uc_load() carry near-identical
> logic for freeing a DMA-coherent firmware memory region and loading
> firmware into it. Factor the shared logic into common helpers.
>
> Patch 1 is a preparatory, no-functional-change rename of
> struct m3_mem_region to struct ath12k_fw_mem_region, since the type
> is also used for the aux_uc region and the old name no longer
> reflects its purpose.
>
> Patch 2 refactors the shared free/load logic into
> ath12k_qmi_free_mem_region() and ath12k_qmi_fw_mem_load(), and
> rewires the m3 and aux_uc wrappers to use them.
>
> ---
> Changes in v2:
> - Addressed the review comments.
this is not enough: you need to clearly state what are changed in each patch.
And I already gave my Reviewed-by: in v1 review, any reason why you didn't carry it in
this post? I don't see any major difference between this and the previous revision.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH ath-next v2 0/2] wifi: ath12k: refactor m3/aux_uc firmware memory handling
2026-11-04 6:53 ` [PATCH ath-next v2 0/2] wifi: ath12k: refactor m3/aux_uc " Baochen Qiang
@ 2026-11-04 7:10 ` Madhavan Ganesan
2026-11-04 7:15 ` Baochen Qiang
0 siblings, 1 reply; 10+ messages in thread
From: Madhavan Ganesan @ 2026-11-04 7:10 UTC (permalink / raw)
To: Baochen Qiang, Jeff Johnson; +Cc: linux-wireless, ath12k, linux-kernel
On 11/4/2026 12:23 PM, Baochen Qiang wrote:
>
>
> On 11/4/2026 2:30 PM, Madhavan Ganesan wrote:
>> ath12k_qmi_m3_free()/ath12k_qmi_m3_load() and
>> ath12k_qmi_aux_uc_free()/ath12k_qmi_aux_uc_load() carry near-identical
>> logic for freeing a DMA-coherent firmware memory region and loading
>> firmware into it. Factor the shared logic into common helpers.
>>
>> Patch 1 is a preparatory, no-functional-change rename of
>> struct m3_mem_region to struct ath12k_fw_mem_region, since the type
>> is also used for the aux_uc region and the old name no longer
>> reflects its purpose.
>>
>> Patch 2 refactors the shared free/load logic into
>> ath12k_qmi_free_mem_region() and ath12k_qmi_fw_mem_load(), and
>> rewires the m3 and aux_uc wrappers to use them.
>>
>> ---
>> Changes in v2:
>> - Addressed the review comments.
>
> this is not enough: you need to clearly state what are changed in each patch.
>
Acked.
From next revision, I will clearly mention what I changed in updated
patch set.
> And I already gave my Reviewed-by: in v1 review, any reason why you didn't carry it in
> this post? I don't see any major difference between this and the previous revision.
Based on Jeff's review comments, I have cleared the paddr and reorder
the function definition. So, I thought I cannot retain your Reviewed-by
tag. Please let me know if I need to re-spin with Reviewed-by tag.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH ath-next v2 0/2] wifi: ath12k: refactor m3/aux_uc firmware memory handling
2026-11-04 7:10 ` Madhavan Ganesan
@ 2026-11-04 7:15 ` Baochen Qiang
0 siblings, 0 replies; 10+ messages in thread
From: Baochen Qiang @ 2026-11-04 7:15 UTC (permalink / raw)
To: Madhavan Ganesan, Jeff Johnson; +Cc: linux-wireless, ath12k, linux-kernel
On 11/4/2026 3:10 PM, Madhavan Ganesan wrote:
>
>
> On 11/4/2026 12:23 PM, Baochen Qiang wrote:
>>
>>
>> On 11/4/2026 2:30 PM, Madhavan Ganesan wrote:
>>> ath12k_qmi_m3_free()/ath12k_qmi_m3_load() and
>>> ath12k_qmi_aux_uc_free()/ath12k_qmi_aux_uc_load() carry near-identical
>>> logic for freeing a DMA-coherent firmware memory region and loading
>>> firmware into it. Factor the shared logic into common helpers.
>>>
>>> Patch 1 is a preparatory, no-functional-change rename of
>>> struct m3_mem_region to struct ath12k_fw_mem_region, since the type
>>> is also used for the aux_uc region and the old name no longer
>>> reflects its purpose.
>>>
>>> Patch 2 refactors the shared free/load logic into
>>> ath12k_qmi_free_mem_region() and ath12k_qmi_fw_mem_load(), and
>>> rewires the m3 and aux_uc wrappers to use them.
>>>
>>> ---
>>> Changes in v2:
>>> - Addressed the review comments.
>>
>> this is not enough: you need to clearly state what are changed in each patch.
>>
>
> Acked.
> From next revision, I will clearly mention what I changed in updated patch set.
>
>> And I already gave my Reviewed-by: in v1 review, any reason why you didn't carry it in
>> this post? I don't see any major difference between this and the previous revision.
>
> Based on Jeff's review comments, I have cleared the paddr and reorder the function
> definition. So, I thought I cannot retain your Reviewed-by tag. Please let me know if I
> need to re-spin with Reviewed-by tag.
Hmm, I think the changes are minor ...
Never mind, I can post it again.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH ath-next v2 0/2] wifi: ath12k: refactor m3/aux_uc firmware memory handling
2026-11-04 6:30 [PATCH ath-next v2 0/2] wifi: ath12k: refactor m3/aux_uc firmware memory handling Madhavan Ganesan
` (2 preceding siblings ...)
2026-11-04 6:53 ` [PATCH ath-next v2 0/2] wifi: ath12k: refactor m3/aux_uc " Baochen Qiang
@ 2026-11-04 7:15 ` Baochen Qiang
2026-11-04 7:24 ` Vasanthakumar Thiagarajan
2026-11-04 18:59 ` Jeff Johnson
5 siblings, 0 replies; 10+ messages in thread
From: Baochen Qiang @ 2026-11-04 7:15 UTC (permalink / raw)
To: Madhavan Ganesan, Jeff Johnson; +Cc: linux-wireless, ath12k, linux-kernel
On 11/4/2026 2:30 PM, Madhavan Ganesan wrote:
> ath12k_qmi_m3_free()/ath12k_qmi_m3_load() and
> ath12k_qmi_aux_uc_free()/ath12k_qmi_aux_uc_load() carry near-identical
> logic for freeing a DMA-coherent firmware memory region and loading
> firmware into it. Factor the shared logic into common helpers.
>
> Patch 1 is a preparatory, no-functional-change rename of
> struct m3_mem_region to struct ath12k_fw_mem_region, since the type
> is also used for the aux_uc region and the old name no longer
> reflects its purpose.
>
> Patch 2 refactors the shared free/load logic into
> ath12k_qmi_free_mem_region() and ath12k_qmi_fw_mem_load(), and
> rewires the m3 and aux_uc wrappers to use them.
>
> ---
> Changes in v2:
> - Addressed the review comments.
>
> ---
> Madhavan Ganesan (2):
> wifi: ath12k: rename m3_mem_region to ath12k_fw_mem_region
> wifi: ath12k: refactor m3 and aux_uc firmware memory handling
>
> drivers/net/wireless/ath/ath12k/qmi.c | 168 ++++++++++++----------------------
> drivers/net/wireless/ath/ath12k/qmi.h | 6 +-
> 2 files changed, 60 insertions(+), 114 deletions(-)
> ---
> base-commit: a2da7677eb9a12e7860814b70a1f6f5b0e347d7d
> change-id: 20261103-m3_and_aux_ucode-8337b881155c
>
>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH ath-next v2 0/2] wifi: ath12k: refactor m3/aux_uc firmware memory handling
2026-11-04 6:30 [PATCH ath-next v2 0/2] wifi: ath12k: refactor m3/aux_uc firmware memory handling Madhavan Ganesan
` (3 preceding siblings ...)
2026-11-04 7:15 ` Baochen Qiang
@ 2026-11-04 7:24 ` Vasanthakumar Thiagarajan
2026-11-04 18:59 ` Jeff Johnson
5 siblings, 0 replies; 10+ messages in thread
From: Vasanthakumar Thiagarajan @ 2026-11-04 7:24 UTC (permalink / raw)
To: Madhavan Ganesan, Jeff Johnson; +Cc: linux-wireless, ath12k, linux-kernel
On 04-11-2026 12:00, Madhavan Ganesan wrote:
> ath12k_qmi_m3_free()/ath12k_qmi_m3_load() and
> ath12k_qmi_aux_uc_free()/ath12k_qmi_aux_uc_load() carry near-identical
> logic for freeing a DMA-coherent firmware memory region and loading
> firmware into it. Factor the shared logic into common helpers.
>
> Patch 1 is a preparatory, no-functional-change rename of
> struct m3_mem_region to struct ath12k_fw_mem_region, since the type
> is also used for the aux_uc region and the old name no longer
> reflects its purpose.
>
> Patch 2 refactors the shared free/load logic into
> ath12k_qmi_free_mem_region() and ath12k_qmi_fw_mem_load(), and
> rewires the m3 and aux_uc wrappers to use them.
>
> ---
> Changes in v2:
> - Addressed the review comments.
>
> ---
> Madhavan Ganesan (2):
> wifi: ath12k: rename m3_mem_region to ath12k_fw_mem_region
> wifi: ath12k: refactor m3 and aux_uc firmware memory handling
>
> drivers/net/wireless/ath/ath12k/qmi.c | 168 ++++++++++++----------------------
> drivers/net/wireless/ath/ath12k/qmi.h | 6 +-
> 2 files changed, 60 insertions(+), 114 deletions(-)
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH ath-next v2 2/2] wifi: ath12k: refactor m3 and aux_uc firmware memory handling
2026-11-04 6:30 ` [PATCH ath-next v2 2/2] wifi: ath12k: refactor m3 and aux_uc firmware memory handling Madhavan Ganesan
@ 2026-11-04 17:52 ` Jeff Johnson
0 siblings, 0 replies; 10+ messages in thread
From: Jeff Johnson @ 2026-11-04 17:52 UTC (permalink / raw)
To: Madhavan Ganesan, Jeff Johnson; +Cc: linux-wireless, ath12k, linux-kernel
On 11/3/2026 10:30 PM, Madhavan Ganesan wrote:
> - m3_mem->vaddr = dma_alloc_coherent(ab->dev,
> - m3_len, &m3_mem->paddr,
> - GFP_KERNEL);
> - if (!m3_mem->vaddr) {
> - ath12k_err(ab, "failed to allocate memory for M3 with size %zu\n",
> - m3_len);
> + mem_region->vaddr = dma_alloc_coherent(ab->dev, len, &mem_region->paddr,
> + GFP_KERNEL);
> + if (!mem_region->vaddr) {
> + ath12k_err(ab, "failed to allocate memory for %s with size %zu\n",
> + filename, len);
I've dropped this logging in my pending branch:
1) checkpatch complains about it since the failure is already logged by
dma_alloc_coherent()
2) the pre-existing M3 logging doesn't trigger the checkpatch warning only
because checkpatch has a 3-line lookback for this issue, and in the
existing code there are four lines between the assignment and the 'if'
statement that checks the result. had the original code only used 2 lines
for the dma_alloc_coherent() instead of 3, it would have been flagged as
well.
3) in the case where the memory is embedded in board-2.bin:
if (embedded_data && embedded_len > 0)
the filename is not applicable so the message is actually misleading
https://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git/commit/?h=pending&id=f4d0341946db1dcd3c36296d7577f2444cd7d412
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH ath-next v2 0/2] wifi: ath12k: refactor m3/aux_uc firmware memory handling
2026-11-04 6:30 [PATCH ath-next v2 0/2] wifi: ath12k: refactor m3/aux_uc firmware memory handling Madhavan Ganesan
` (4 preceding siblings ...)
2026-11-04 7:24 ` Vasanthakumar Thiagarajan
@ 2026-11-04 18:59 ` Jeff Johnson
5 siblings, 0 replies; 10+ messages in thread
From: Jeff Johnson @ 2026-11-04 18:59 UTC (permalink / raw)
To: Jeff Johnson, Madhavan Ganesan; +Cc: linux-wireless, ath12k, linux-kernel
On Wed, 04 Nov 2026 12:00:06 +0530, Madhavan Ganesan wrote:
> ath12k_qmi_m3_free()/ath12k_qmi_m3_load() and
> ath12k_qmi_aux_uc_free()/ath12k_qmi_aux_uc_load() carry near-identical
> logic for freeing a DMA-coherent firmware memory region and loading
> firmware into it. Factor the shared logic into common helpers.
>
> Patch 1 is a preparatory, no-functional-change rename of
> struct m3_mem_region to struct ath12k_fw_mem_region, since the type
> is also used for the aux_uc region and the old name no longer
> reflects its purpose.
>
> [...]
Applied, thanks!
[1/2] wifi: ath12k: rename m3_mem_region to ath12k_fw_mem_region
commit: 8a2640239052145072d1ee53d014b4a544b011b9
[2/2] wifi: ath12k: refactor m3 and aux_uc firmware memory handling
commit: 5c8eab13e391aaabd5a1ad58f3ee4bb10ce7573e
Best regards,
--
Jeff Johnson <jeff.johnson@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2026-11-04 18:59 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-04 6:30 [PATCH ath-next v2 0/2] wifi: ath12k: refactor m3/aux_uc firmware memory handling Madhavan Ganesan
2026-11-04 6:30 ` [PATCH ath-next v2 1/2] wifi: ath12k: rename m3_mem_region to ath12k_fw_mem_region Madhavan Ganesan
2026-11-04 6:30 ` [PATCH ath-next v2 2/2] wifi: ath12k: refactor m3 and aux_uc firmware memory handling Madhavan Ganesan
2026-11-04 17:52 ` Jeff Johnson
2026-11-04 6:53 ` [PATCH ath-next v2 0/2] wifi: ath12k: refactor m3/aux_uc " Baochen Qiang
2026-11-04 7:10 ` Madhavan Ganesan
2026-11-04 7:15 ` Baochen Qiang
2026-11-04 7:15 ` Baochen Qiang
2026-11-04 7:24 ` Vasanthakumar Thiagarajan
2026-11-04 18:59 ` Jeff Johnson
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®