Commit Graph

889 Commits

Author SHA1 Message Date
Yeshwanth Sriram Guntuka
d9eb751658 qcacmn: Add support to affine individual grp irqs
Add support to affine individual grp irqs to either
perf or non-perf cluster.

Change-Id: I90006645acb82b71c63d2255722e2c67bb7a2f46
CRs-Fixed: 3059676
2021-11-08 05:19:31 -08:00
Zhaoyang Liu
08e7ee70fe qcacmn: clear pcie low power interrupt register after suspend
For specific QCA6174 device, need clear LOW_POWER_INT_MASK register
bit3/4 to disable pcie low power interrupt after suspend, bit3 is for
INTR_L1SS and bit4 is for INTR_CLKPM, this is to fix issue that PMIC
VREG_L30A don't turn off when XO is in shutdown state.

Change-Id: I4833e4143c48a3bf734745a5e772a7a76a94d63c
CRs-Fixed: 3028269
2021-10-19 05:35:16 -07:00
Karthik Kantamneni
4c00b017c8 qcacmn: Add HIF events to track NAPI POLL exit time
Add HIF events to track NAPI POLL exit time, this gives
information about actual time spent by wlan host in napi softirq.

Change-Id: I7548fd05f2f7db714ac9bcf79171ffb3d478e936
CRs-Fixed: 3052902
2021-10-12 13:16:48 -07:00
Alan Chen
c180315712 qcacmn: Remove logic to enable/disable wake msi for drv systems
Remove logic to enable/disable wake msi for drv systems. Today, during
WoW suspend sequence, between hif pci bus suspend and hif pci bus
suspend no irq, wake msi is getting disable temporarily. In case
fw toggles wake msi during this period, then the wake msi is lost,
which can lead to device not waking up for fw triggered wakeup.
Add the fix to remove enable/disable wake msi from suspend/resume
path and keep wake msi always enabled.

Change-Id: Idad0805f66ead4079d67577fa1151f73567511a3
CRs-Fixed: 3042261
2021-09-30 13:01:39 -07:00
Prateek Patil
7a52367615 qcacmn: Return if pld_is_pci_ep_awake is not supported
Add check for verifying pld_is_pci_ep_awake support before waiting till
EP vote reset is done after reg completion

Change-Id: I9061c212c115d158aec63464eedcf6ca98e11a56
CRs-Fixed: 3038992
2021-09-24 20:45:08 -07:00
Amit Mehta
86c4751159 qcacmn: WMI CE buffer size update to 3520 Bytes
Update WMI CE buffer size to 3520 Bytes to support
large frame size on QCA6490 and WCN7850.

Change-Id: I1f3326f40bf18dda6010def57ea7f2e0961bc725
CRs-Fixed: 3036932
2021-09-17 08:45:26 -07:00
Kiran Venkatappa
f0c88a6cb9 qcacmn: Set QCN9224 ce attribute flags to zero for CE 12&13
CE 12 and 13 is assigned for CV prefetch. Set attribute flag for these
CE to zero as per current requrement from FW on Emulation.
This may be changed to different value based on future requirement.

Change-Id: I70073aa45b6999a42ed230835a2a7dd7b650edad
CRs-Fixed: 3025570
2021-09-01 09:03:17 -07:00
Karthik Kantamneni
8c0efa6281 qcacmn: Send force wake release if force wake request times out
Even though force wake request timed out there is possibility of
wake request got stuck and handled later at qmi level this leads
to leaving device in wake state for long time unnecessarily.

To avoid this send force wake release when wake request times out.

Change-Id: Ic0e1b3d3fe9d4b0e0f0d4b9be5804ef4f1d3e724
CRs-Fixed: 3019575
2021-08-25 05:07:14 -07:00
Uraj Sasan
03827107ac qcacmn: Update CE id enums
Update CE id enums to include CE12 to CE15 for targets that support 16 CEs

Change-Id: I3456903191e1439f6e965dc519cceb56b00d6f32
2021-08-12 05:32:57 -07:00
lihual
bde0001eed qcacmn: Fix a memory leak during soc attach
hif_ext_group and soc->intr_ctx[i].lro_ctx are allocated
but not free while fail to register parts of ext_group in
hif_register_ext_group, which cause memory leak. Fix is
to detach according resource before return.

Change-Id: I03ecc37437d09bf9275f128b1f2b320124a7df64
CRs-Fixed: 2988891
2021-08-11 15:50:50 -07:00
Jingxiang Ge
7e7d768c71 qcacmn: check linkstate_vote in hif_vote_link_down
It is not right that linkstate_vote is 0 when entering
hif_vote_link_down, this indicates there is a mismatch
for vote up/down.

Enable debug to catch such case at first time.

Change-Id: I128bc42917ca5de949ee0d0b657579c14dd96eac
CRs-Fixed: 3009469
2021-08-10 09:07:39 -07:00
Amit Mehta
5b3cc21863 qcacmn: Change logging time-stamp source
Currently there is mismatch in time-stamp source for
hif_hist_skip_event_record with respect to hif_hist_record_event

Updating time-stamp source in hif_hist_record_event to match with
hif_hist_skip_event_record time-stamp source.

Change-Id: I55680c40860eafb5c6ed6117ab7c55bb38cc24bb
CRs-Fixed: 3000319
2021-08-09 15:37:20 -07:00
Shwetha G K
13ecc7b6c9 qcacmn: WMI CE buffer size update to 3520Bytes
CE buffer size update to support 3.5k beacon template &
probe response on Pine and Spruce targets.
The support is disabled on low memory profiles including
512M as there is no skb recycler in these profiles.

Change-Id: I451f11d6a20d1246b3e16221f2fb7ebd234b284a
2021-08-06 11:33:17 -07:00
Mohit Khanna
3e89b4435a qcacmn: Remove target CE entries for CE5 in HMT
In HMT, pktlog, which uses CE5 traditionally is disabled. Hence donot
configure any entries in target_ce_config.

Change-Id: I31a075fb9c6557599688408ba9452704c7522ec0
CRs-Fixed: 2984362
2021-08-05 08:28:48 -07:00
Sumedh Baikady
18ff74028c qcacmn: Add CE ring cleanup in hal
Cleanup hal srng for CE rings upon CE ring
cleanup.

Change-Id: I6d52ee1b83c23d74d88a1aca8a7eab2c5a0d186a
2021-07-30 07:12:19 -07:00
Jingxiang Ge
0f98450843 qcacmn: Replace RET_IP with rtpm_dbgid for runtime pm api
Current it use __RET_IP to get caller in rtpm resume
function, if it print info by %ps, it will do a
symbol lookup which takes time.

Change as replacing __RET_IP with rtpm_dbgid, so it is
still able to get caller information and avoid time
cost here.

Change-Id: Ifc70c118d621bb9e6d12de87582de09316ae9cad
CRs-Fixed: 3001690
2021-07-30 04:04:50 -07:00
Aditya Kodukula
6a5a2ec74a qcacmn: Remove %ps from wakeup_irq_handler
%ps does symbol table lookup in kernel and if used in irq context,
it can lead to irq_handler running for longer time, and jank issues
as a side effect. So, remove it from wakeup_irq_handler.

Change-Id: Ifa42d9a46c838c2458d3220c6d3cb008232e3839
CRs-Fixed: 2999176
2021-07-28 19:02:33 -07:00
Abdul Muqtadeer Ahmed
f284efa6f8 qcacmn: Refactor the hif_latency detection code based on the bitmap
Based on the bitmap whether the issue is because of the
HIF_DETECT_TASKLET or HIF_DETECT_CREDIT, the hif_latency detection
code needs to be refactor to different functions so that it will
help parsing tools to find the reason of crash.

Change-Id: I2d8a83493354dfbd1c484cb7727018ddeb14c158
CRs-Fixed: 2929736
2021-07-28 06:39:06 -07:00
Karthik Kantamneni
e2c4542bac qcacmn: Optimize EP request/release vote wait logic
Currently sleep based wait is used for checking EP request/release
vote is taken effect or not. But once worker thread goes to sleep
it is taking in order of milli seconds to schedule back worker thread
this scheduling delay is causing srng HP/TP writes to be updated in
delayed manner.

To avoid this first try checking EP vote is taken affect by busy wait
then go for sleep based method.

Change-Id: I72e81941a23752a41c9b5307e82c2e971aee1ec8
CRs-Fixed: 2999541
2021-07-27 09:24:29 -07:00
Ananya Gupta
f2851b458b qcacmn: Affine rx_err srng to all CPUs except 0
IPA and rx_err ring are processed in same CPU resulting
in low Tput.
To fix this, not allow processing of rx_err ring in
CPU 0

Change-Id: Id53a03c9290607beb1a595c84bfb0fd8d9f5d105
CRs-Fixed: 2949569
2021-07-27 01:00:14 -07:00
Vevek Venkatesan
9f5cc5aae8 qcacmn: refer system time for pld_is_pci_ep_awake timeout
Currently timeout for checking pld_is_pci_ep_awake in
hif_prevent_link_low_power_states might be higher than
the defined timeout depends on how long qdf_sleep takes
to get scheduled again, so avoid this uncertain timeout
adding reference to the system time.

Change-Id: I67a28d46c996ccc56680cf8e20c09a70729a33c5
CRs-Fixed: 2994746
2021-07-26 01:39:38 -07:00
Karthik Kantamneni
7bf43ce817 qcacmn: Wait till EP vote is released after reg work completion
After reg work is complete there is possiblity EP vote reset
request still not processed by F.W. So wait till EP vote reset
is done after reg work completion.

Change-Id: I1f4e318ac96ba3a15c613c5faf5095d4be7c8e99
CRs-Fixed: 2994233
2021-07-22 12:53:20 -07:00
Karthik Kantamneni
b7e633e910 qcacmn: Add api to set intermediate EP vote access
Add api to set intermediate EP vote access state.
Make sure reg work handler is complete before setting
intermediate vote access.

Change-Id: Ib229d9af8b1e58505a9ae5fbf39aa912ca21a3c3
CRs-Fixed: 2994040
2021-07-22 12:53:16 -07:00
Amit Mehta
42c3f92bf4 qcacmn: rate limit excessive logging in case of no data to reap
Currently, excess logging is causing a crash when there is no
data to reap.

Rate limiting the log messages to avoid the crash due to excessive
logging in case of no data to reap.

Change-Id: I175f3f1b3c0b0173f171e971494f6ffda694b4a5
CRs-Fixed: 2988147
2021-07-16 17:49:16 -07:00
Vevek Venkatesan
c515aa874b qcacmn: abort system suspend_noirq if wake-IRQ received
Wake-IRQ can be received just before Kernel issuing
suspend_noirq callback, such wake-IRQ would not be
handled by Kernel. So check if any tasklet most likely
CE2 is pending and abort suspend_noirq if true.

Change-Id: Ie3d6de97179aa0d8f383a086f4f8df27d3fc5254
CRs-Fixed: 2981882
2021-07-07 00:16:32 -07:00
Sajini R
75b10f2ab7 qcacmn: Update PCI SOC revision details to wifi driver
Update PCI SOC revision details from cnss2 to wifi driver.

Change-Id: I43e5f62fc79e2fe937e31134cdcc452381d20a14
2021-07-06 04:38:49 -07:00
Amit Mehta
909feab5a8 qcacmn: Check irq free before enable
During deinit process we free the IRQs and call kill tasklet.
There is the possibility that Tasklet might be running when we
call kill tasklet and as part of tasklet exit it will try to
enable the corresponding CE IRQ which has already been freed.

Adding check for IRQ free condition to avoid any IRQ enable
calls after IRQ free is done.

Change-Id: I9d58ffbb3738251e3d8114631e2daacd07e33d7d
CRs-Fixed: 2973309
2021-07-02 09:41:38 -07:00
Manikanta Pubbisetty
88c01f6191 qcacmn: increase force wake timeout
Increase force wake timeout to 500ms for perf builds.

Change-Id: Ib665418b5de63048f02d7093d12813f4babdbf72
CRs-Fixed: 2979062
2021-07-01 11:23:26 -07:00
Karthik Kantamneni
292e767c1e qcacmn: Remove affinity hint for CE irqs in QCA6750 target
CE irqs affinity is set to gold cores, but affinity
hint is not removed while freeing irqs.

So remove CE irq affinity before freeing them.

Change-Id: If3822422f823cb3caa6e291387a2beadc62049b7
CRs-Fixed: 2975529
2021-07-01 02:04:19 -07:00
Mohit Khanna
af887c113d qcacmn: Changes to Init TX Rings for BE
DP/CFG changes to initialize extra TX/TX Comp Rings in BE.

CRs-Fixed: 2937302
Change-Id: Ia8a8ed717eb0e1bfa9d2e1ff917941a7ea91bc28
2021-06-30 13:49:03 -07:00
Rakesh Pillai
37e2c6d9ed qcacmn: Register IRQ for near full irq
WCN7850 has support for near full indication for
the consumer srngs. This interrupt is used to take
preventive actions to avoid ring full watchdog irq
trigger.

Register for the near full irq and add the necessary
ext groups for these near-full irqs.

Change-Id: Ic16381fceabc54e6c52b34dd13abea74cad4d38c
CRs-Fixed: 2965081
2021-06-30 13:47:51 -07:00
Manjunathappa Prakash
cebffa806d qcacmn: Add support for additional REO rings for Beryllium
Beryllium supports additional REO rings to cater increased bandwidth.
Enable additional REO rings.

Change-Id: I5124c92e30e4ac56a78b6f5f38d1c91a2933bba8
CRs-Fixed: 2930184
2021-06-30 13:47:46 -07:00
Wenxiu Han
e17a5d9251 qcacmn: Check null pointer before use
In API hif_batch_send(), the variable ce_tx_hdl is dereferenced in
if_batch_send() without null check. Check for null before use to
avoid dereference a NULL pointer.

Change-Id: I05c38e180a448522d13d68369b77b45314eac227
CRs-Fixed: 2968584
2021-06-28 23:16:46 -07:00
Yeshwanth Sriram Guntuka
f5e4766465 qcacmn: Modify ret variable check in hif_pm_runtime_get
Runtime put should be done in hif_pm_runtime_get when
return value of __hif_pm_runtime_get is negative. In
the issue scenario, the ret value will be set to 0 when
the return value of __hif_pm_runtime_get is positive.
The store operation for ret variable somehow did not take
effect and the if check for non-zero ret value to do
runtime put did go through. The return value to
dp_tx_hw_enqueue from hif_pm_runtime_get is the updated
ret value of 0. This will result in double runtime put
for a single runtime get.

Fix is to modify the ret variable check to negative
instead of non-zero to ensure runtime put happens
correctly.

Change-Id: Idc380a11c82b6d1acf7c750e7b93776ac9d6b4f2
CRs-Fixed: 2969879
2021-06-25 02:56:30 -07:00
Jinwei Chen
1bb3155d2c qcacmn: get CMEM info from cnss platform
Get the CMEM info from cnss platform.

Change-Id: Id6e72164b10e18ef6ce3c4cda72f3b427107c640
CRs-Fixed: 2929524
2021-06-23 23:32:43 -07:00
Basamma Yakkanahalli
00bcc8cbd3 qcacmn: Initial changes for ipq9574 target compilation
Added device ID and target type checks for ipq9574 traget
compilation.

Change-Id: Ie337d1256f828987ed469a609c8fb74de2180dca
2021-06-18 11:07:50 -07:00
Alan Chen
5d539e6876 qcacmn: Add debug log for prevent suspend
Add debug log to get more detail when PCIe link suspend is not allowed.

Change-Id: Ia16f34a88d2d264c703d4fa068bec8b954466cf7
CRs-Fixed: 2963989
2021-06-18 01:02:01 -07:00
Vinay Adella
48fde3c3bb qcacmn: Enable CE interrupts after all process
Some latency stats need to do book keeping before interrupts are
enabled to avoid the counters being overwirtten by ISRs.
Also include latency stats in the case when rx is still pending.

Change-Id: Icff6f7876cd5db103693c6d38a396f1571b1d0aa
CRs-Fixed: 2965601
2021-06-18 01:01:56 -07:00
Kiran Venkatappa
b871b5e200 qcacmn: Update MSI mapping for CE interrupts for QCN9224
Four new CEs are introduced in QCN9224. Update MSI mapping
for 16 CEs in QCN9224.

Change-Id: I781e2b42453a4ec4f31f4076be1f5813d3637eff
CRs-Fixed: 2969994
2021-06-16 19:13:33 -07:00
Basamma Yakkanahalli
182d12abbe qcacmn: Add qca9574 target register structures
Add register structures for qca9574 target.

Change-Id: Ie3f6a3a4fa7d395a3805e404030be938f0c25acd
2021-06-10 06:17:02 -07:00
Rakesh Pillai
34b6af18a4 qcacmn: Init-Deinit changes for WCN7850
Add Init-Deinit changes for WCN7850 support
in datapath

Change-Id: I7f9850ee41f4638c6a28b5313549c67876c5f810
CRs-Fixed: 2888556
2021-06-05 15:10:50 -07:00
Karthik Kantamneni
b1a539c931 qcacmn: Set EP vote only if feature is supported
Skip setting EP vote if EP voting feature is not supported

Change-Id: I1f21b13f14ec6e65fec5fdbdc952df05ee0f1c6e
CRs-Fixed: 2953425
2021-06-01 01:42:05 -07:00
Karthik Kantamneni
bd49a69019 qcacmn: Introduce intermediate EP voting access state
Introduce intermediate EP voting state during this transition state
access the votes only if direct writes are not possible.

Change-Id: Ib4522aef2209b4797100ca84e4e230a00e14b654
CRs-Fixed: 2954903
2021-05-28 18:30:53 -07:00
Nandha Kishore Easwaran
df35f813fd qcacmn: Use pld api to get pci slot
Use pld api to get pci slot instead of getting pci slot from
domain.

Change-Id: I0a2024eba89ee98c645f613ea4aa56dbb2089537
2021-05-28 03:47:12 -07:00
Prateek Patil
f1cd24767e qcacmn: Compilation error fix
Include Header file for fixing compilation error in HSP mode in WHUNT

Change-Id: I2d1c4d6a5b089b9e0e5176fc7fa257748b90143e
2021-05-28 01:47:13 -07:00
Yeshwanth Sriram Guntuka
45fa11262a qcacmn: Disable MSI intr config for CE5 on Lithium targets
FW is not setting up any context for CE5 but host is still
configuring the dest and status ring for CE5. This can
result in CE5 HW to write to MSI iova address when PCIe is
in low power state.

Fix is to disable MSI intr configuration for CE5 on
Lithium based targets.

Change-Id: I964305ad1258d41d7afe6422f87286904c0a6739
CRs-Fixed: 2954723
2021-05-27 21:38:16 -07:00
Jianmin Zhu
2a7b60ac61 qcacmn: Fix NOC issue for PCIE select window fail
Select window failed sometimes, then following register writing by offset
leaded to NOC error.

PCIe local register space is mapped to BAR0 lower address, don't need
select window when write wake up umac register.

Add read back to confirm select window register writing passed through.

Change-Id: Iaa5359722e9b7a3434efd1a819a951ce6c8d3f4f
CRs-Fixed: 2952127
2021-05-27 21:38:10 -07:00
Vevek Venkatesan
7d79770907 qcacmn: add hif_grp_irq_deconfigure bus_ops to free ext grp IRQs
As per current design, in failure path of hdd_wlan_start_modules,
mem_free of hif_ext_group is done (in cds_dp_close) before
free_irq (in hdd_hif_close), during next hdd_wlan_start_modules,
request_irq adds new handler entry to the list in irq_desc, this
leads to a crash on accessing older stale entry from irq handler,
so adding a bus_ops hif_grp_irq_deconfigure to free ext grp IRQs.

Change-Id: I4d0a2bee1fabee388cea8a85226fae641165a8d5
CRs-Fixed: 2949400
2021-05-27 11:40:33 -07:00
Vevek Venkatesan
26969d9267 qcacmn: add HI_TASKLET support for CE
Add HI_TASKLET support for CE, to improve priority
of CE tasklet higher than softirq, since CPU hogging
caused by RT thread.

Change-Id: I88fe8c048e908b9780745bb26b177acd2baf6a5c
CRs-Fixed: 2948946
2021-05-26 13:38:34 -07:00
Aditya Sathish
13764f2b16 qcacmn: Release lock while allocating pfrm request
pfrm_request_irq() calls kmem_cache_alloc() which
needs to be called in a non-atomic context since
it can sleep.

The current call to pfrm_request_irq() is done
within a spinlock which disables preemption and
leads to sleep in an atomic context.

Avoid calling pfrm_request_irq() within atomic
context

CRs-Fixed: 2913515
Change-Id: Ic2b0a23360d4d2b753658499343f72bfb67ad82d
2021-05-21 12:12:33 -07:00