提交線圖

8 次程式碼提交

作者 SHA1 備註 日期
Rajesh Chauhan
ff372a6f1d cnss_prealloc: use slab_cache from slab struct to identify mempool id
CNSS prealloc maintains various prealloc pools of 8Kb, 16Kb, 32Kb
and so on, and allocates buffer from the pool for wlan driver. When
wlan driver requests to free the memory buffer then CNSS prealloc
needs to first find out mempool id from which this buffer was allocated.
Use slab_cache from slab struct to identify memory pool id. Until
kernel 5.16, slab_cache was part of page struct but in kernel 5.17,
slab_cache is moved out to mm/slab.h file.

Also change WCNSS_PRE_ALLOC_GET_THRESHOLD to 8Kb to match with
cnss_pool_alloc_threshold.

Change-Id: I4e34d8f0b855c210cc9af30c1f4a0d6c7e43ab00
CRs-Fixed: 3414037
2023-04-10 10:37:41 -07:00
Yu Wang
44ad9ad95f cnss_prealloc: Add null pointer check before accessing memory pool
Pointer for memory pool may be null if it fails to
create memory pool in cnss_pool_init().
Add null pointer check before accessing memory pool.

Change-Id: I8ae2b6a5193cffdcba3990b238178a1b93297925
CRs-Fixed: 3332360
2022-11-10 07:26:47 -08:00
Alan Chen
e3b36fcd46 cnss_prealloc: Update preallocation pool entries
Update pre allocation pool entries as below:

8kb: 22 -> 16
16kb: 16 -> 16
32kb: 6 -> 22
64kb: 8 -> 38
128kb: 2 -> 10

Change-Id: I2ba69d7332447229f0ad2907dd380f663a8a3fd8
CRs-Fixed: 3306034
2022-10-25 00:22:10 -07:00
Rajesh Chauhan
48cfe543c6 cnss_prealloc: add new functions to store cache at beginning of memory
CNSS prealloc maintains various prealloc pools of 8Kb, 16Kb, 32Kb
and so on, and allocates buffer from the pool for wlan driver. When
wlan driver requests to free the memory buffer then CNSS prealloc
derives slab_cache from virtual memory via page struct to identify
prealloc pool id to put memory buffer back into the pool.

In kernel 5.17, slab_cache is removed from the page struct. Add new
functions to store cache at the beginning of allocated buffer and
when wlan driver requests to free the memory then use that cache to
identify CNSS prealloc pool to put back memory.

Change-Id: I6b3a54d3f502d977c6a61cfa6aeae597df9c8e72
CRs-Fixed: 3309289
2022-10-17 21:23:29 -07:00
Yu Wang
a5a88a8d75 cnss_prealloc: replace in_atomic() with proper API
According to kernel comment for in_atomic(), it's
incorrect to use it outside core kernel code.
To follow this rule, replace
(irqs_disabled() || in_atomic()) with (!preemptible())
when getting GFP flags.

Change-Id: I7cdb28a7f12ffd60216c7bc1921a277de6113cb5
CRs-Fixed: 3273779
2022-08-26 12:28:06 -07:00
Yu Wang
728b08d683 cnss_prealloc: fix GFP flag for mempool_alloc
As per implementation of might_sleep(), rcu_read_lock()
nesting depth should be take into consideration too to
figure out whether sleeping is allowable or not.
To make align with it, allocate memory with GFP_ATOMIC
if rcu_read_lock() nesting depth is not zero.

Change-Id: Ib225a33b1a3f37b919e41daf064ce2de44428973
CRs-Fixed: 3271651
2022-08-22 04:51:13 -07:00
Yue Ma
7e3754303f wlan_platform: Add CONFIG_CNSS_OUT_OF_TREE flag
Use CONFIG_CNSS_OUT_OF_TREE to control if CNSS family drivers are
built from in-kernel-tree source or out-of-kernel-tree source since
the exposed header files will be in different paths. This is also
for backward compatibility.

Change-Id: I24111fdb76607bf911c29e415d42d25609f9b26c
2021-10-08 15:31:58 -07:00
Yue Ma
5b29459b17 wlan_platform: Bring initial files for CNSS family drivers
Bring CNSS family drivers from msm-5.10 kernel as of commit
cc3bc4b888af (cnss2: Fix a few switch statement fallthrough
issues) to WLAN platform project. Fix SPDX-License format for
a few files as well.

drivers/net/wireless/cnss* -> .
include/net/cnss* -> inc/

Above shows how directories and header files are relocated.

Change-Id: If8fd40a35c9fdbeb1aa76a8aac5fdb1fc1c7e786
2021-10-08 15:28:40 -07:00