Commit Graph

249 Commits

Author SHA1 Message Date
Venkateswara Naralasetty
a641238d80 qcacmn: Enable wlan datapath CE IRQ affine
Set affinity to assign WLAN CE datapath IRQs to perf clusters
based on the INI config.

Change-Id: I63f96bc6b434af2e322ef277096e5547cfa6835a
CRs-Fixed: 3590583
2023-08-25 15:15:04 -07:00
Amit Mehta
2c0fb4ffc6 qcacmn: Set enable_rpm earlier in hdd_wlan_start_modules
Currently enable_rpm is being set in hif_rtpm_start
which is called later in hdd_wlan_start_modules,
this can result in race between hif_rtpm_start
and hif_rtpm_put.

To fix the issue set enable_rpm earlier to avoid
race condition.

Change-Id: Iaa4ffda4eef3050f43ff5ca2bdba555abb8a0b47
CRs-Fixed: 3581962
2023-08-14 15:22:33 -07:00
Zhiwei Yang
7709435525 qcacmn: add hif_event_desc_history to ssr driver dump
Current code doesn't have hif_event_desc_history in ssr driver dump.
Fix this by adding hif_event_desc_history and hif_event_hist_max to
the ssr driver dump regions.

And add more parameters for parsing hif_ce_desc_history_buff.

Change-Id: I02cbfc7b9ea0c53d31ad351377d4644f1ad189d1
CRs-Fixed: 3469140
2023-07-19 22:04:02 -07:00
Venkateswara Naralasetty
51ddb93d21 qcacmn: add periodic and host Tx/Rx stats support for WCN6450
Changes required to support periodic and host Tx/Rx stats for WCN6450.

Command to request and dump the host Tx/Rx stats,
iwpriv wlan0 txrx_stats <stats no> <mac_id>
mac_id: 0 - mac0(5 GHz), 1 - mac1(2 GHz)
        0 for single mac
stats no: 20 - TXRX_CLEAR_STATS
	  21 - TXRX_RX_RATE_STATS
	  22 - TXRX_TX_RATE_STATS
	  23 - TXRX_TX_HOST_STATS
	  24 - TXRX_RX_HOST_STATS
	  25 - TXRX_AST_STATS
	  26 - TXRX_SRNG_PTR_STATS
	  27 - TXRX_RX_MON_STATS
	  29 - TXRX_SOC_CFG_PARAMS
	  30 - TXRX_PDEV_CFG_PARAMS
	  31 - TXRX_NAPI_STATS
	  32 - TXRX_SOC_INTERRUPT_STATS
	  33 - TXRX_SOC_FSE_STATS

Change-Id: Ibda4d531c9074a24f8c39916b44d9e3c38f189ee
CRs-Fixed: 3485279
2023-07-13 00:42:11 -07:00
Venkateswara Naralasetty
a3a5a72bbd qcacmn: Add delayed reg write support for wcn6450
Current HAL delayed reg write is tied to SRNG notions, hence
implement delayed reg write logic in HIF since WCN6450 does
not use SRNG interface.

New feature flag FEATURE_HIF_DELAYED_REG_WRITE is introduced
to disable/enable this support.

Change-Id: Id7087ad53cd5879cf49ee0e84dd727de61137541
CRs-Fixed: 3519702
2023-07-10 12:14:13 -07:00
Yu Wang
1632797f1c qcacmn: refine hif tasklet latency detection
When one of the enabled CE tasklet is executed, it will
check latency of all the others which are enabled, it's
redundant. Add a new API to check latency for a single
tasklet.
Add API to record sched time for a tasklet, which will
check the enablement of detection before recording the
time.

Change-Id: I515ca27fc2e97231397573b4903c001d29326bd2
CRs-Fixed: 3514285
2023-07-08 01:26:06 -07:00
Aditya Kodukula
4cbabdad1c qcacmn: Fix typos in cmn
Fix typos spanned over multiple files in cmn.

Change-Id: I9886114cd9cde934e084d0977e6272f8dd04df76
CRs-Fixed: 3521888
2023-06-07 13:58:38 -07:00
Yeshwanth Sriram Guntuka
d2b4b226d4 qcacmn: Use prealloc multi pages for direct link CE dest buffers
The IOVA for the buffers that are attached to the direct
link receive copy engine need to be contiguous for optimal
memory mapping on ADSP.

Fix is to use multi pages prealloc when posting buffers
for direct link receive buffer.

Change-Id: Ieb253bd3c1b6550e4c1c63cd587993891ac817f2
CRs-Fixed: 3502633
2023-05-30 08:19:24 -07:00
Amit Mehta
8a4a8722b0 qcacmn: Add changes to Affine away taken CPUs
Add changes to affinie away IRQ from the CPU taken
by audio driver during Pro audio use case.

Change-Id: I881c42e9f951fbf965be6d6a71994fd97791ee48
CRs-Fixed: 3502637
2023-05-27 01:40:30 -07:00
Venkateswara Naralasetty
9d3b562c0c qcacmn: add NAPI schedule latency and poll time histogram support
Add support for NAPI schedule latency and poll time histogram stats
for WCN6450.

Change-Id: If982ebe4e3cfa80f47c6d2fe9d4cb9dfa318481d
CRs-Fixed: 3485287
2023-05-25 12:08:40 -07:00
Yu Wang
bfebabf7bd qcacmn: extend hif tasklet latency detection
Extend the feature to detect tasklet latency for all CEs.
And also introduce a build flag
DETECTION_LATENCY_TASKLET_MASK to control the enablement
of each, set bit-X to enable detection for CE-X, the
default value is 0x84(BIT(2) | BIT(7)).

Change-Id: I2874d1d50fc5febbf028ebb48ba64e11977c8c34
CRs-Fixed: 3474314
2023-05-24 03:28:48 -07:00
Adwait Nayak
b37c9cf461 qcacmn: Initial changes for Pebble bring-up in HIF Layer.
Add device Id and target type checks for qcn6432 target
compilation.

Change-Id: Id95d5902e3f3711ab6836b72dc3bcb66b1abf3c6
CRs-Fixed: 3351550
2023-04-18 12:44:37 -07:00
Namita Nair
59a36d8e87 qcacmn: Handle deprecated interface calls to IPA
As IPA has moved out of the kernel, ipa_uc_reg_rdyCB
interface call from WLAN is not needed anymore
as ipa_wdi_init_per_inst() initialization call will
handle this. This change will add support to retain
this call only for legacy devices.

Change-Id: Icb479562e091d388e03ef5a38b3e95d4dbf06271
CRs-Fixed: 3459071
2023-04-08 13:33:12 -07:00
Pavankumar Nandeshwar
80d41dc9b4 qcacmn: Handle Umac reset for MLO case
1. Add an API to process trigger_umac_recovery T2H message.
2. Synchronize do_pre_reset, do_post_reset_start, do_post_reset_complete
   messages for all the SOCs and then process these messages in the host.
3. Synchronize pre_reset_done, post_reset_start_done,
   post_reset_complete_done for all the SOCs before sending it to FW.
4. Add a new state in host for trigger_umac_recovery message.
   Ignore back to back trigger_umac_recovery messages received from FW.

Change-Id: Id45d326d63e122834090844e83ad6cc7240f96af
CRs-Fixed: 3425833
2023-03-15 11:20:26 -07:00
Edayilliam Jayadev
63c5956a01 qcacmn: Add APIs to schedule/cancel custom callbacks
Add HIF/CE layer APIs to schedule/cancel custom callbacks.

Change-Id: I9cc7dcf73a726cb1ed2d7945d6ce9e736d42af52
CRs-Fixed: 3408690
2023-03-14 08:45:56 -07:00
Venkateswara Naralasetty
ad3cd5fa15 qcacmn: hif/ce changes for wcn6450
Add the following hif/ce changes to add support for wcn6450,
* New host/target wlan ce config for wcn6450
* New service to pipe map for wcn6450
* New host/ce/target table attach for wcn6450

Change-Id: I20fa1410f5e4e7a0146bc2d0b48a18269ca4a8c9
CRs-Fixed: 3381111
2023-02-26 12:33:47 -08:00
Namita Nair
c6a6c4563d qcacmn: PCIe prevent_l1 for optional wifi dp feature
This change will hold the PCIe in L0 state for the
duration of this feature. The hold will be
released after data transfer is complete.

Change-Id: I762bc3423059ad641bdd00ac5b301a1e1b16f6c2
CRs-Fixed: 3406490
2023-02-23 17:20:37 -08:00
Nandha Kishore Easwaran
f2ffa7ab59 qcacmn: Hif changes for umac reset in QCA5332
Add hif changes for umac reset in QCA5332. Changes are done to read the
umac reset IPC number from dst and request irq for the same.

Change-Id: I0feafb06ef63f37c3ae6db0270bd5ed50debd91d
CRs-Fixed: 3401146
2023-02-12 16:28:00 -08:00
Prakash Manjunathappa
3cde321196 qcacmn: Add PEACH device support
Add support for peach device. Add peach conditional statements.

Change-Id: Ia107e60fd00b4938984414fd92d6699d11fd3797
CRs-Fixed: 3394198
2023-02-07 00:54:44 -08:00
Jeff Johnson
4a8d2ccc87 qcacmn: Fix hif/inc documentation
The kernel-doc script identified a large number of kernel-doc issues
in the hif/inc folder, so fix them.

Change-Id: Idb9a748c71ab71122b74ac9d2665ead474c649ff
CRs-Fixed: 3375492
2023-01-20 13:25:53 -08:00
Hariharan Ramanathan
f75a30225c qcacmn: Add changes to move ioremap outside interrupt context
Add changes to move ioremap of PMM SCRATCH register outside
interrupt context, as ioremap in interrupt context in not valid.

Change-Id: I0fa645c55e10a5241011a1f4ffdccdca48c50d29
CRs-Fixed: 3371194
2023-01-10 05:32:28 -08:00
Li Feng
04014003d6 qcacmn: Add timeout of NAPI polling for single MSI case
Observed NAPI of REO2SW1 hard to complete caused by slow CPU/schedule
on REO2SW1, hence IRQ of REO2SW1 keep disabled during the polling which
impact other MSI as well in single MSI case, until hit REO2TCL timeout
and crash.

The fix is complete the dp rx NAPI poll and re-enable the irq if the
irq disabled for long time.

Change-Id: I5e70d9646b78307ab0c35e2ac0d6e3647804c476
CRs-Fixed: 3332143
2022-12-04 10:08:53 -08:00
Yeshwanth Sriram Guntuka
f2bb688784 qcacmn: Modify existing API to fetch direct link dest buf size
Modify existing API used to fetch direct link destination
buffers to also get destination buffer size.

Change-Id: I6c220fe9bbb216f1c0db2e1e38da2ce8314fe47b
CRs-Fixed: 3347321
2022-12-02 21:56:20 -08:00
Hariharan Ramanathan
b673b97a2d qcacmn: Interrupt Changes for QCA5332
Added interrupt registering code for tx monitor and umac_reset

Change-Id: Id76329a908859a512cef23d68a4afbff794af09a
CRs-Fixed: 3340347
2022-11-27 01:50:43 -08:00
Karthik Kantamneni
6ef5d59bee qcacmn: Add Runtime PM last busy history support
Add support to record last busy events on RX CEs,
this helps to check how frequent CEs are marking busy.

Add support to display last busy history and runtimepm stats.

Change-Id: I856ce54a2f1c6b26722d27623343fc0a2c202c6f
CRs-Fixed: 3337902
2022-11-20 22:03:28 -08:00
Ananya Gupta
f1f6845bfb qcacmn: Export API to change delay for RTPM timeout
Store ini config delay value and current delay value in RTPM
context
Export API to update delay and get current delay in ms for RTPM
timeout.
Export API to restore delay to default value.

Change-Id: I53e9e17d983c2cc6fe317159c8c46d792e56c04e
CRs-Fixed: 3332132
2022-11-16 15:37:05 -08:00
Yeshwanth Sriram Guntuka
9b059a3bc0 qcacmn: Add support for getting CE srng info for Direct Link
Add support to fetch CE srng information used for
direct link datapath.

Change-Id: If38b892b28eba711d7949fa02926205dc601a50e
CRs-Fixed: 3317501
2022-11-12 03:11:01 -08:00
Yeshwanth Sriram Guntuka
e228622034 qcacmn: Add support to configure MSI registers for Direct Link CE
The MSI address and data information for Direct Link
copy engines will be available once the WiFi driver
on LPASS is initialized. Add support to configure the
IPCC address and data values into Direct Link copy
engines at runtime.

Change-Id: I5e7dff90c2f1ff764462c235deb5795ed019a16b
CRs-Fixed: 3316679
2022-11-12 03:10:53 -08:00
Kannan Saravanan
04a752e875 qcacmn: Initial changes for york bring-up in HIF Layer
Add device Id and target type checks for qcn9160 target
compilation.

Change-Id: I40f5ae3f1ac715f977f9df5a46c71740c61c7399
CRs-Fixed: 3282629
2022-10-18 10:08:21 -07:00
Jeff Johnson
207faf54f2 qcacmn: hif: Fix misspellings
Fix misspellings in hif/...

Change-Id: I8eeefbf714bbb66f61886d9ceabe3f28607b045c
CRs-Fixed: 3304686
2022-10-10 19:21:54 -07:00
Hariharan Ramanathan
433a137917 qcacmn: HIF changes for QCA5332
1. Changes to support cmem write for AHB devices.
2. Interrupt enablement issue - Incorrect CE address was given which is
fixed.
3. dp_soc_init failure - dev_base_addr of Miami was NULL, which is
fixed.
4. Missing interrupt error logs - Added dummy entires for missing
interrupt in DTS and changes to support shared IRQ in wifi-drivers

Change-Id: I00e7666b2b978c35b5ccec5da21bf442ed0a7998
CRs-Fixed: 3268936
2022-09-13 16:46:32 -07:00
Sajini R
5d150285fd qcacmn: Initial changes in hif for ipq5332 target compilation
Added device ID and target type checks in hif for ipq5332 traget
compilation.

CRs-Fixed: 3273827
Change-Id: I771d741c204695a678bf22bccd039047b9dc8356
2022-08-24 09:01:21 -07:00
Pavankumar Nandeshwar
1607e73a26 qcacmn: HIF changes for umac prereset handling
Handle Umac prereset event from firmware.

Change-Id: I88a25ae8eb403af40f044de4500ce42729da1e49
CRs-Fixed: 3174560
2022-08-11 15:23:20 -07:00
Yu Tian
11df417c3b qcacmn: Add Link stats check before ring access directly
Throughput based RTPM logic of ring access may fail and
lead to NOC error in some corner cases. Change is aimed
to add additional link states check to prevent invalid SRNG
access.

Change-Id: I7e7edbadfd21b4857efa4faff0ada6d94d682f2c
CRs-Fixed: 3256702
2022-08-08 07:49:39 -07:00
Yeshwanth Sriram Guntuka
b4ff9ea317 qcacmn: Add functionality for rtpm prevent suspend sync
Add provision to call sync prevent suspend which will wait for
system to resume and increment usage_count before returning.

Change-Id: I855e3fc2660dc7f3f78bb70f8eef6228cbef96d3
CRs-Fixed: 3253335
2022-08-08 05:47:18 -07:00
Nidhi Jain
18377a6679 qcacmn: Add qcn9224defs for wkk v2
Added new file specific to qcn9224 v1 defs. Use qcn9224defs.c for v2.
Added changes specific to soc version check.

Change-Id: I5b6aedbb8aba2de847e0f4d47212a25b36bfa7c8
CRs-Fixed: 3243676
2022-08-01 01:34:59 -07:00
Karthik Kantamneni
50c8489faf qcacmn: Add support to log latest CE descriptor history
Add support to log latest CE descriptor history which helps
to identify CE scheduling/reaping delays when full debug
history dump is not available.

Change-Id: I44a5c86a3e1dd4861bfd2e77b3f772d5d53bcedf
CRs-Fixed: 3225155
2022-07-21 05:50:56 -07:00
Nandha Kishore Easwaran
93bf7e1fb1 qcacmn: Schedule CE tasklet when resource runs out
If there is no resourse to send packet via HTC, then check if interrupts
are not processed from that CE for last 3 seconds. If so, schedule a
tasklet to reap available entries. Also if Queue has reached 1024 entries
within 3 seconds, then also schedule tasklet.

This change is added because there is a case where intermittently
completion interrupts are not received from CE3 and hence adding
this WAR in host to come out of this issue scenario.

Change-Id: I126cd5e678517127659237308f8f6b1313f8f422
CRs-Fixed: 3234943
2022-07-14 01:02:11 -07:00
Shiva Krishna Pittala
053f59e4f0 qcacmn: Interrupt handling changes for UMAC HW reset interrupt
Create a HIF context for UMAC reset handler, register the datapath UMAC HW
reset callback handler with HIF layer, request for UMAC HW reset interrupt,
and schedule a high priority tasklet to process the interrupt in which
call the registered DP callback handler.

CRs-Fixed: 3184312
Change-Id: Iefc811bf0d1b093c3c63bf2238c94a1448f4f139
2022-07-13 15:25:24 -07:00
Srinivas Girigowda
6d056b9959 qcacmn: Add support for Mango device id
Add support for Mango device id.

Change-Id: I2b32a39e258caab408723db77f132af364dc6b04
CRs-Fixed: 3232512
2022-07-02 09:55:56 -07:00
Ananya Gupta
4021d4b379 qcacmn: Restructure HIF Runtime PM module
Currently, different modules had different ways of allowing
and preventing runtime suspend. Multiple debug mechanisms
were introduced and workarounds are present as well bloating
the runtime PM module.
This change is done to clean up and restructure HIF runtime
PM module. Modules using Runtime PM module need to register
with an ID present in hif_rtpm_client_id.
hif_rtpm_get() will increment the device usage_count and
prevent device from suspending. Based on argument type, if
system is suspended, subsequent resume action will be done.
hif_rtpm_put() will decrement the usage_count of device and
if it is NULL, based on type of put call, idle sequence will
start. Register HIF module and update respective get and put
calls done from HIF module.

Change-Id: I23747f0f7208e689c1c9eb55789aa81945f596ec
CRs-Fixed: 3169272
2022-06-18 23:11:18 -07:00
Jingxiang Ge
4c3d1cbd29 qcacmn: Change ce desc history from dynamic to static
As dynamic allocation occupy cnss prealloc memory, which may
cause this prealloc pool to be exhausted.

Move dynamic memory to static.

Change-Id: Ia3500868cbcdbd9676f72a3588462ab0d6a21088
CRs-Fixed: 3171015
2022-04-20 13:07:54 -07:00
Jinwei Chen
a8fe61c936 qcacmn: Prevent runtime PM suspending during hif_force_wake_request
Currently if write non-shadow register and not in initial
phase, host will call hif_force_wake_request()-->
pld_force_wake_request_sync(), but this API can not guarantee
MHI/PCIe is in wake state if runtime PM suspending is ongoing
in parallel, later any register accessing through PCIe bus will hit
NOC error.

Add hif_pm_runtime_get_sync() in hif_force_wake_request() to prevent
runtime PM suspending.

Change-Id: Id60c6041a830d9ad27b0b4173a036c9c57fbf350
CRs-Fixed: 3120170
2022-03-02 03:09:12 -08:00
Nandha Kishore Easwaran
d9ce043299 qcacmn: Legacy interrupt changes
Add Legacy interrupt changes for Beryllium target. Added code to initialize
legacy interrupt for Copy engines and also to request irq for hif group.

Change-Id: Idb5635d376b9dfcf1e4c595a829d7bef467870b4
2022-02-27 23:46:23 -08:00
Naveen S
8b6625530d qcacmn: Removal of pre lithium wlan driver support in 12.x Software
Code related to IPQ4019 is removed

Change-Id: I64ef452cafe64840576f40a8f35bc617b9978c96
2022-02-14 07:12:47 -08:00
Aditya Kodukula
ed41e85970 qcacmn: Align the string entries in rtpm_string_from_dbgid()
Align the string entries inside the rtpm_string_from_dbgid()
function in the order of wlan_rtpm_dbgid enum entries.

Change-Id: I455e93723f5df882babb758a4979d1b1cecd8e7e
CRs-Fixed: 3128352
2022-02-11 06:02:24 -08:00
Kiran Venkatappa
6cd22afb21 qcacmn: Add hif API to get WMI ep count from svc map
Different targets can have different WMI endpoint count. Add an API to
get this count from the target service map. This API can be used to get
max WMI ep count for a target to perform endpoint connect request only
till possible count.

Change-Id: Id90bcadfb23fbff12d10bf8b6ca825142d3f1bdc
CRs-Fixed: 3121598
2022-02-02 03:16:19 -08:00
Aditya Kodukula
4d53144b89 qcacmn: Add new entry to wlan_rtpm_dbgid enum
Add a new entry RTPM_ID_SOC_IDLE_SHUTDOWN to the enum
wlan_rtpm_dbgid.

Change-Id: Idf2ee1655a0c353693749d76095ec65dfb08ba25
CRs-Fixed: 3120187
2022-02-01 23:35:53 -08:00
Neha Bisht
5f8681ff1e qcacmn: Enable the 4th Tx. completion ring
Enable the 4th Tx. completion ring to save CPU load
Initialization and interrupt handling for 4th completion ring
is done here.

Change-Id: I2db27218a3c3e14d719d012f03454a6a7aa647fe
2022-02-01 21:04:30 -08:00
Jingxiang Ge
a1f2c00c65 qcacmn: Always enable ce debug history for ce2/ce3
Current there is no ce debug history when testing
perf build, so it is hard to debug some issue.

Here it only enable ce2/ce3 on perf build, which keep
only necessary log here.

Change-Id: I29b998939cfa25f0547a9871721c6daeb0fdd961
CRs-Fixed: 3058740
2022-01-26 01:04:24 -08:00