[PATCH ath-next] wifi: ath12k: avoid dynamic alloc when parsing wmi tb
Nicolas Escande
nico.escande at gmail.com
Thu Mar 12 08:26:19 PDT 2026
On Wed Mar 11, 2026 at 6:46 AM CET, Baochen Qiang wrote:
[...]
>>
>> But if you guys don't want it that way, I can rework it. Just tell me in more
>> details what you think is the right way and I can modify it.
>
> then how about adding module init path to ath12k module and do percpu allocation there:
>
> in ath12k/core.c
>
> +void __percpu *wmi_tb;
> +
> +static int ath12k_core_module_init(void)
> +{
> + wmi_tb = __alloc_percpu(WMI_TAG_MAX * sizeof(void *),
> + __alignof__(void *));
> + if (!wmi_tb)
> + return -ENOMEM;
> +
> + return 0;
> +}
> +
> +static void ath12k_core_module_exit(void)
> +{
> + free_percpu(wmi_tb);
> +}
> +
> +module_init(ath12k_core_module_init);
> +module_exit(ath12k_core_module_exit);
That should work, I'll try something along those lines then.
>
>
>>
>> Thanks
Thanks for the review Baochen
More information about the ath12k
mailing list