Re: [RFC PATCH 1/1] wifi: ath12k: avoid dynamic alloc when parsing wmi tb

Nicolas Escande
2026-02-27T09:22:37Z

On Fri Feb 27, 2026 at 4:18 AM CET, Baochen Qiang wrote:
[...]
>> diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h
>> index 990934ec92fc..378573a100e8 100644
>> --- a/drivers/net/wireless/ath/ath12k/core.h
>> +++ b/drivers/net/wireless/ath/ath12k/core.h
>> @@ -19,6 +19,7 @@
>> #include <linux/average.h>
>> #include <linux/of.h>
>> #include <linux/rhashtable.h>
>> +#include <linux/percpu.h>
>> #include "qmi.h"
>> #include "htc.h"
>> #include "wmi.h"
>> @@ -934,6 +935,7 @@ struct ath12k_base {
>> struct device *dev;
>> struct ath12k_qmi qmi;
>> struct ath12k_wmi_base wmi_ab;
>> + void __percpu *wmi_tb;
>
> instead of allocating it per device, how about making it global and allocating once when
> loading driver. This way we may save some memory in case where more than one devices get
> probed?
Yes I can do that.

I'll wait a few days to see if there's more feedback from you guys and I post
something more polished then. And I'll probably post something for ATH11K, it
seems to have the same pattern.

Thx for the review