커밋 그래프

59 커밋

작성자 SHA1 메시지 날짜
Zhiwei Yang
dcc5bcfd68 qcacmn: Avoid using small buffer address
On some third-party platforms, we observe the memory physical
address below 0x2000 is allocated will cause HW/FW NOC error,
so this region memory should not use by host.

This change will hold the memory if the allocated memory physical
address below 0x2000 until driver unload.

Change-Id: I37b6abc98033230dc4f572dafb849101497f6e93
CRs-Fixed: 3419648
2023-05-15 12:23:50 -07:00
Naveen Gurujala
ef4db9909e Revert "qcacmn: Avoid using small buffer address"
This reverts Change-Id:	I9d5df20cbdf23c230d7c910cce9b9489dd9dd614

Change-Id: I2ce7c3cacc3fec007e511a9e3d15aed89173fbd9
CRs-Fixed: 3419648
2023-04-25 12:08:45 -07:00
Zhiwei Yang
f52c8b1f36 qcacmn: Avoid using small buffer address
On some third-party platforms, we observe the memory physical
address below 0x2000 is allocated will cause HW/FW NOC error,
so this region memory should not use by host.

This change will hold the memory if the allocated memory physical
address below 0x2000 until driver unload.

Change-Id: I9d5df20cbdf23c230d7c910cce9b9489dd9dd614
CRs-Fixed: 3419648
2023-04-12 02:53:41 -07:00
Chaoli Zhou
6de3f20f10 qcacmn: Add common memory alloc/free API
Add qdf_mem_common_alloc/qdf_mem_common_free for
the platform that want to replace malloc with valloc
due to limited continuous physical memory.

Change-Id: If3c5716ff6d62c0a4f6f21b7ebf9eef1e3f0e529
CRs-Fixed: 3429140
2023-03-14 03:26:03 -07:00
Jeff Johnson
1e4a1adb96 qcacmn: Fix QDF memory documentation
The kernel-doc script identified a large number of documentation
issues in the QDF memory abstractions, so fix those issues. In addition,
there are a number of instances where public functions have their
implementation documented instead of having their interface
documented, so move that documentation.

Change-Id: I4e30fd85e65567485cdc7a9adfc38c69df0cfa55
CRs-Fixed: 3406199
2023-02-24 08:50:13 -08:00
Anbarasan Ganesan
f066d5ca6a qcacmn: Use ioremap() instead of ioremap_nocache()
As part of compiling wifi driver in kernel version 5.15,
the kernel API ioremap_nocache() is no longer supported in
kernel version 5.15.

Kernel API ioremap_nocache() is being replaced with
ioremap() in kernel version 5.6

So, bringing ioremap_nocache() API under kernel version check.

Change-Id: I139556e55f8c20093137960f116b3fc067a1829f
CRs-Fixed: 3357183
2023-02-06 13:32:30 -08:00
Pavankumar Nandeshwar
fd6fed3e07 qcacmn: Cleanup the tx desc cleanup logic
Cleanup the tx desc clean up logic used in
direct switch and umac reset cases.
The excess code being removed tries to
get the next descriptor address in boundary
conditions is not useful, as the descriptor
extracted this way will be overwritten
immediately in the beginning of next iteration
of the loop.

Change-Id: Ibcd873719929b94147152ff48205774d3ed4f452
CRs-Fixed: 3371831
2023-01-10 05:31:53 -08:00
Jeff Johnson
3bdf954afc qcacmn: qdf: Fix misspellings
Fix misspellings in qdf/...

Change-Id: If61ee47fba94b2bb60f33ab74feda56dbe5cb7bd
CRs-Fixed: 3277902
2022-10-12 23:22:37 -07:00
Amir Patel
8983dd04f8 qcacmn: Add QDF Kmem cache support
Introduce QDF abstraction APIs for handling kmem cache
create/destroy/alloc/free

Change-Id: I46fa8e5e3891a3665fb230b737ef66ff65b5135e
CRs-Fixed: 3274919
2022-09-06 08:59:43 -07:00
Pavankumar Nandeshwar
d9709af89a qcacmn: Add API to clean up tx desc pool
Add an API to clean up tx dec pool in case of
umac reset.

Change-Id: I99fe11bcd07471f5aafefbeae10a9d4683cc5c5c
CRs-Fixed: 3266252
2022-08-13 02:59:35 -07:00
Nandha Kishore Easwaran
8aa7cab50c qcacmn: Add provision to increase num_elements
Add support to change the number of elements in multi pages
alloc function. This is needed to increase the number of tx_descs.

Change-Id: I29ee2764c24c6f83b0c2cff1062ec7239dcc0b4b
CRs-Fixed: 3130833
2022-03-15 03:42:03 -07:00
Devender kumar
412a969aeb qcacmn: Fix Atomic Memory Allocation Method
Memory allocation in atomic context is not correct, as for
MEMORY_DEBUG profile the initial_memory_debug flag is set to
0 which leads in allocating memory with GFP_KERNEL flag
Issue is seen with SDX_PINE where the memory allocation is done
in sleeping context using GFP_KERNEL in interrupt context
Fix is create a new memory allocation API with GFP_ATOMIC flag

Change-Id: I3baa5b601b60f88fe2d9ff1f4008703c6507a267
2021-12-30 03:23:22 -08:00
Himanshu Batra
bd23cf7dcc qcacmn: QDF changes to support IPA offload
QDF changes to support IPA offload.

Change-Id: Ib3a0f667bb9c11fb65f6a41ad777ff7273288569
2021-11-24 05:31:07 -08:00
Pragaspathi Thilagaraj
a8d8b663b2 qcacmn: Define QDF API for vzalloc and vfree
Define QDF API for virtual memory allocation and free.
Also add new api to get time of the day in microseconds.

Change-Id: I2921055bbb6b5d2a1105d19448b2a10fa2d6ccc5
CRs-Fixed: 3038180
2021-09-28 21:12:18 -07:00
Vivek
f8167f4dbc qcacmn: Call cfg80211 functions with context aware allocation flags
There are instances in the code where the response is sent from the
driver to the supplicant indicating the allocation flags which is
used by the supplicant to allocate memory.

In those situations, we should pass the allocation flags based on
the context in which the response is sent.

Send the response with the right allocation flags to the supplicant.

Change-Id: I85f1c29fc66ba51a9f9c645692712c3a25b7fed1
CRs-Fixed: 2987552
2021-07-26 13:54:14 -07:00
Adwait Nayak
c2c89243d8 qcacmn: Parse and update qdf module params
Read the file wifi_module_param.ini, in which wifi module params
are present and compare these module params with qdf module params
in qdf module init function.

If any of the module params belongs to qdf module is present,
then that particular module param is updted during qdf module init.

Change-Id: I76ef876f6c7be3cdffd93b6050a190438d60bf39
2021-04-27 16:13:11 -07:00
Nisha Menon
3db73f1414 qcacmn: Add memory stats pertaining to DP usage
Add sysfs node for DP level memory stats:
/sys/kernel/wifi/wlan/wlan_dp_mem_stats
These include Tx, Rx SKB memory allocated, Tx/Rx
buffer count, outstanding Tx desc count.
Add and subtract the skb memory for Rx/Tx when
the map/unmap functions are invoked.

Change-Id: If62cc47bb60f7eb63f60e861f755f3417248677f
CRs-Fixed: 2724482
2020-11-18 16:23:49 -08:00
Jinwei Chen
18989f8ede qcacmn: support multiple pages prealloc for descriptor
Support multiple pages prealloc for DP descriptor

Change-Id: I66d4cef3acf69acf4b6fc8e5a6d01c3d67921dca
CRs-Fixed: 2751338
2020-09-21 01:33:16 -07:00
Jinwei Chen
21d6fd0ac6 qcacmn: add function for multi-pages memory zero operation
Add function qdf_mem_multi_pages_zero() to support multi-pages
memory zero operation.

Change-Id: I08b5c2722c02881550d3a1da27d5137c0957fd51
CRs-Fixed: 2776365
2020-09-21 01:33:12 -07:00
Nisha Menon
0bbaedb23c qcacmn: Log memory stats in host driver
Add logs in driver to log current memory footprint
in init functions. Add wlan_mem_stats to sysfs node
in both perf and defconfig builds.
The stats are included under MCL feature
DCONFIG_WLAN_SYSFS_MEM_STATS.

Change-Id: I79c6d418a5762cddf52ab3bc0b0c93993fa7fd84
CRs-Fixed: 2635192
2020-06-11 02:04:46 -07:00
Nisha Menon
3e5b005e4e qcacmn: Break up DMA mem alloc for HW desc banks in multi pages
Break up the 2MB descriptor bank memory allocations for WBM
idle link ring. Use multiple page allocation and populate the
WBM idle link descriptor ring with physical addresses of each
DMA page allocated in the descriptor bank.
This is to ensure that no requests for contiguous memory
allocations are made that might result in allocation failures.

For MCL set the page size to 4KB and leave it to max_alloc_size
cfg ini param for WIN specific code.

Change-Id: Iec30321044827c0174366cc02df25a42d38309e0
CRs-Fixed: 2565817
2020-02-18 16:38:43 -08:00
Rakesh Pillai
374e7c25dc qcacmn: Support IPCI bus type in QDF
Add newly added IPCI bus type support in QDF.

CRs-Fixed: 2597341
Change-Id: I476556e831d41be9ee71f8083a95d8d9da6ceb85
2020-01-15 04:44:03 -08:00
Shwetha G K
21378e0c93 qcacmn: Support to disable the memory debug at load time
Disable the mem_debug when qdf argument mem_debug_disabled=1 is passed
through uci command "uci set wireless.qcawifi.mem_debug_disabled=1".

CRs-Fixed: 2572159
Change-Id: I6ab5e1f28ce4c58d46c7467bac3853054f4cf56c
2020-01-10 16:55:18 -08:00
Linux Build Service Account
fb263dc4bd Merge "qcacmn: Replace printk with qdf_nofl_info" 2019-08-30 05:36:51 -07:00
Vivek
7a14b44b75 qcacmn: Replace printk with qdf_nofl_info
Replace printk with qdf_nofl_info in qdf folder.
So if we wish to change from printing on console
to other location, based on a logging daemon, we
can do that by only changing at the implementation
of QDF print API's

Change-Id: I27fa7dbd6081c2869d1f1782f34cdd0bb5a02fb4
CRs-Fixed: 2442689
2019-08-27 11:32:27 +05:30
Shashikala Prabhu
ec527358c2 qcacmn: Fix issues in qdf aligned memory alloc function
1. Alloc size should be passed as input and output parameter since we need
   to pass the exact alloc_size while freeing the memory.

2. use qdf_align() to calculate the aligned physical address.

3. In DBR component, pass correct arguments to qdf_aligned_malloc() to fix
   the compilation errors.
   Alloc size should be passed as input and output parameter since we need
   to pass the exact alloc_size while freeing the DMA memory.

Change-Id: I83051b8aa54bbf3bb663902d8f17f2c3c55e57bf
CRs-Fixed: 2462441
2019-08-26 00:26:56 -07:00
Shiva Krishna Pittala
1529d99839 qcacmn: Add debug version of qdf_mem_multi_pages_alloc/free
Under memory debug, qdf_mem_multi_pages_alloc function is getting
reported as the culprit of memory leaks when there is no associated
qdf_mem_multi_pages_free call. qdf_mem_multi_pages_alloc is
just an allocator function which uses qdf_mem_malloc internally to
serve the requested allocation and is not the actual source of the leak.
As there are multiple users of qdf_mem_multi_pages_alloc in the code base,
add memory debug versions of qdf_mem_multi_pages_alloc/free to track the
actual users of the allocations.

Change-Id: I8b2159de842a3c5d7f9cdb244ca148cf6df37d0d
CRs-Fixed: 2474749
2019-06-27 17:16:07 -07:00
Chaithanya Garrepalli
ab234e56f6 qcacmn: Add Cached Descriptor support for DP SRNGs
Add support to configure any HAL SRNG descriptor to
be allocated from cached memory area. This is to
optimize of CPU cycles spent on uncached
memory accesses. Also added prefetch of cached
descriptors

Change-Id: I2544e8596d48e2f5549bf687a764c16d73397545
CRs-fixed: 2267945
2019-05-29 11:08:12 -07:00
Dustin Brown
b5b21cac42 qcacmn: Remove qdf_*_outline() APIs
Several qdf_*_outline() APIs exist which are straight aliases to their
regular qdf_*() counterparts. Remove them, and update any callers to use
the regular APIs instead.

Change-Id: Ibe6e9cced521b93061e89690ab817ceafe49a469
CRs-Fixed: 2408267
2019-03-12 13:58:27 -07:00
Dustin Brown
c9681754d0 qcacmn: Use panic in qdf_mem_copy/move/set/zero/cmp()
It has been observed at that several issues have crept into mainline due
to qdf_mem_copy() gracefully returning when the source or destination
pointers are NULL. In order to prevent such regressions in the future,
change calls to qdf_mem_copy/move/set/zero/cmp() with NULL pointer
parameters so they panic in debug builds.

Change-Id: I6df4c42245ed1d0d8a85477f59552f8243488924
CRs-Fixed: 2408266
2019-03-05 14:23:46 -08:00
Arif Hussain
61847a9ba6 qcacmn: Use function name instead of file name in debug logs
Replace all instance of file name to function name in debug logs.

Change-Id: Iff731675772859f02c975005b2656eaa41c6f360
CRs-Fixed: 2377894
2019-01-17 22:20:46 -08:00
Dustin Brown
7c32e412b8 qcacmn: Add qdf_talloc APIs
Add APIs for t(ree) alloc(ated) memory management.

These APIs allocate memory like malloc, but track those allocations via
a parent-child relationship, or tree. If the parent is freed while it
still has children, a panic will be triggered. This effectively gives
you the ability to limit the lifetime of an allocation by ensuring the
child allocation lifetime will be strictly less than the parent
allocation lifetime.

Change-Id: I6308c96061e125b2e5a9c424ec2d2298c1c503ab
CRs-Fixed: 2359469
2018-12-13 16:46:04 -08:00
Jiachao Wu
ae6c777bd1 qcacmn: Fix a memory leak in qdf_mem_shared_mem_alloc
qdf_mem_shared_mem_alloc invokes qdf_mem_dma_get_sgtable which will alloc
memory.
This memory should be free in qdf_mem_shared_mem_free by sg_free_table.

Change-Id: I3ad4bd2ff7a80d4051f15dcb04e0265707c2712d
CRs-Fixed: 2131270
2018-12-10 03:59:46 -08:00
Shashikala Prabhu
f09216fe1b qcacmn: Add qdf API to align the allocated memory
Define qdf_aligned_mem_alloc_consistent() and qdf_aligned_malloc() which
allocates the memory and checks if allocated base address is aligned with
ring_base_align. If not, it frees the memory and re-allocates by adding
7 bytes to alloc_size and returns aligned address to the caller.

Change-Id: I412153c20e4e4566450b006356fe78d98f1fd3f0
Acked-by: Shashikala Prabhu <pshashik@codeaurora.org>
CRs-Fixed: 2336697
2018-11-22 00:43:51 -08:00
Arif Hussain
c516cd4d5d qcacmn: Add logs in qdf_mem_malloc(), and qdf_mem_malloc_atomic()
In qdf_mem_malloc() and qdf_mem_malloc_atomic(), pass function
name and line number, and log the same in case of failure, this
approach helps to remove error logs in caller function there by
reducing text segment.

Change-Id: Ia4586b112c6dd64aca5b397b43bb17499a0e6e30
CRs-Fixed: 2281983
2018-09-06 01:42:06 -07:00
Sathyanarayanan Esakkiappan
360ad1d34f qcacmn: Wrapper API for memset_io and memcpy_toio
Inclusion of Wrapper API for memset_io and memcpy_toio

Change-Id: I89b94e201f043d37b782e855f198dbc00b89ac15
2018-08-08 09:11:56 -07:00
Sravan Kumar Kairam
d0f08ef155 qcacmn: Assign DMA address correctly to all scatterlist elements
Assign DMA address correctly to all scatterlist elements of scatter
gather table in qdf_mem_shared_mem_alloc() func.

Change-Id: I07988d0bc35e3e0fcf7b9f6df02a9e56a0e8b083
CRS-Fixed: 2110715
2018-07-16 18:32:36 -07:00
Shiva Krishna Pittala
7d721c3baf qcacmn: Fix file name tracking logic in QDF nbuf tracker
As WIN has multiple modules and QDF is the last one to be unloaded,
QDF is crashing when it tried to print the file name of an nbuf
allocated by other modules. To fix this, copy the file name in the
QDF nbuf tracker, rather than using the pointer to file name,
to avoid access to the invalid pointer.

CRs-Fixed: 2258770
Change-Id: I27ee76e58b0f5a976840783cfeba451784de85dd
2018-06-25 03:17:57 -07:00
Om Prakash Tripathi
9b56f5dc1c qcacmn: Use atomic allocation for all scheduler context scan allocations
In low memory environments using GFP_KERNEL flag may cause
scheduler thread to sleep. Scheduler thread callback handlers
are expected to be atomic in nature to ensure timely execution
of different commands. Move all allocations done by scan module
in scheduler thread context to atomic allocation.

Change-Id: Iee3eafbc00a3afea0687ba67b3041ec0816094cc
CRs-Fixed: 2232553
2018-06-13 21:00:59 -07:00
Jeff Johnson
1974e07df2 qcacmn: qdf: Remove legacy markings
Per current guidance remove legacy markings.

Change-Id: Ia920daa3248677b9446f4203c7698cbc37648fbd
CRs-Fixed: 2230684
2018-05-18 02:17:38 -07:00
Himanshu Agarwal
59c25048cd qcacmn: Add QDF APIs for SMMU Stage 1 translation
Add QDF APIs for DMA buffer allocation and sharing with SMMU
Stage 1 translation support. When SMMU Stage 1 is enabled,
DMA APIs return IO virtual address(IOVA) instead of physical
address. This IOVA needs to be mapped to physical address by
external module before accessing these buffers.

Change-Id: I88e938d8ebe1f32fdea79e3c3aa8a3638ddfd2b8
CRS-Fixed: 2072953
2018-03-19 09:34:37 -07:00
Dustin Brown
f16867f4c2 qcacmn: Remove qdf_str include from qdf_mem
In order to migrate existing qdf_str_* APIs to qdf_str.h from
qdf_mem.h, qdf_mem.h included qdf_str.h. Now that consumers are
including qdf_str.h directly, remove this include.

Change-Id: I6b0ee3a4a2ad17db922b8e19087c1d730ad9b419
CRs-Fixed: 2196132
2018-03-02 16:34:32 -08:00
Dustin Brown
d5ff73ebc7 qcacmn: Move existing qdf_str APIs to qdf_str
A set of files for string abstractions has recently been added to QDF.
Move any existing qdf_str_* APIs from qdf_mem to qdf_str.

Change-Id: I6e1e5d1edcdfae2af83a6497ebd872fba981cdec
CRs-Fixed: 2196098
2018-02-28 11:55:20 -08:00
Dustin Brown
64740289bc qcacmn: Add qdf_str_eq() API
strcmp() is regularly used to compare two strings for equality. However,
reading source code using strcmp in this manner can be prone to errors
because the return values are not obvious from the function's name. In
the best case, this leads to referring to the strcmp documentation more
often than one would like. In the worst case, this leads to difficult to
spot bugs. Add a thin wrapper for this use case to make intentions
abundantly clear to future readers. This wrapper is effectively sugar
for 'strcmp(left, right) == 0'.

For example:
	if (!strcmp(left, right))
	/* reads: if not string compare: left, right */

Becomes:
	if (qdf_str_eq(left, right))
	/* reads: if string equal: left, right */

Change-Id: Iabcb7c7e9f37dcb6cf1bdf5d7cc6c69ea926ba5c
CRs-Fixed: 2194508
2018-02-23 15:33:20 -08:00
Varun Reddy Yeturu
52c506d034 qcacmn: Add caller info to memory debug infrastructure
Currently, the detected memory leaks would not dump
the caller of the function which is leaking the memory.
Add an extra parameter to the table to store the caller
address and print the function during an assert.

Change-Id: I6dc31b55fd4e78dc69df9eb6166ebb63086891c1
CRs-Fixed: 2177486
2018-02-15 14:10:51 -08:00
Kabilan Kannan
56800ad9a5 qcacmn: Add debug support for DMA memory allocations
Add debug support to detect memory leaks and corruption
in DMA memory operations.

Change-Id: I1478973828ddc147367c4a579c97c3840c106f44
CRs-Fixed: 2155603
2018-02-09 12:18:40 -08:00
Dustin Brown
7768da6890 qcacmn: Extract memory debugging features from qdf_mem
When memory debugging is enabled, qdf_mem_malloc and qdf_mem_free do a
number of memory corruption checks. Extract these checks into their own
functions to allow other memory allocation/free logic to leverage the
same logic.

Change-Id: I07802093119c90b3d8c40a50d5b4bb152cb8243f
CRs-Fixed: 2136659
2018-01-03 20:09:43 -08:00
Dustin Brown
47d702f693 qcacmn: Add qdf memory domain support
In order to support memory leak detection during a specific period of
time, add APIs to allow setting the current memory domain. Each
allocation is tracked against the current memory domain at the time of
allocation. Consumers can then check to ensure the memory domain is
empty before each transition to a different domain.

Change-Id: I3a8d18ea0700122a2425eacb6051c6188b9aa5d6
CRs-Fixed: 2113614
2017-12-20 05:38:45 -08:00
Yun Park
fde6b9e551 qcacmn: Enable WLAN host data path support for IPA WDI3.0
Change to support WLAN Napier host autonomy data path architecture.

Change-Id: I07f7592d547bb796a3c12bbc4745cee22e2c0022
CRs-Fixed: 2064810
2017-08-07 17:47:38 -07:00
Rajeev Kumar
bc19894820 qcacmn: Add QDF debug capability to track total SKB allocation
Enhance existing SKB leak debug capability to track total
SKB allocation by driver in SLUB debug enabled builds.

Change-Id: I6bb19ab482961febd8bb5adebe8f71e732ff60dd
CRs-Fixed: 2066205
2017-07-12 21:44:29 -07:00