Commit Graph

213 Commits

Author SHA1 Message Date
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
sandhu
ad2829718c qcacmn: Remove IP from files
remove IP from code

Change-Id: If119a4af213b10aadb9f1344e50b0342e72405c2
CRs-Fixed: 3073864
2021-12-29 04:28:58 -08:00
Yeshwanth Sriram Guntuka
299b26a366 qcacmn: Featurize support for grp irq affinity
Add a feature flag for grp irq affinity support
changes.

Change-Id: I0a97dd85369aae66450e4869b591c7af74a66960
CRs-Fixed: 3070324
2021-11-12 22:52:21 -08:00
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
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
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
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
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
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
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
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
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
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
Manikanta Pubbisetty
fe0463deb8 qcacmn: additional runtime PM stats for HTC layer
Add few more stats to the existing runtime PM stats for
HTC layer.

Change-Id: I1610acc534997b14ae070c48da03b4e07a00d9ef
CRs-Fixed: 2949969
2021-05-20 07:58:46 -07:00
Karthik Kantamneni
841fa1bd6a qcacmn: Add support configure EP vote feature based on pm states
Add support to configure EP vote feature based on pm states

Change-Id: Ia424d364248283da8e978f924fd421c1b5f4b888
CRs-Fixed: 2939884
2021-05-08 04:18:34 -07:00
Manikanta Pubbisetty
42c4fca998 qcacmn: add runtime PM stats for HTC layer
Runtime PM for HTC layer has multiple cases of GET/PUT operations.
Adding runtime PM stats for HTC layer, this helps in debugging
RTPM GET/PUT out of sync issues.

Change-Id: Ib27efd73dce0bb5bd3ff030bd7ae1bc833f29610
CRs-Fixed: 2923250
2021-04-21 04:23:30 -07:00
Kiran Venkatappa
ed3db92994 qcacmn: Init changes for qcn9224
Add qcn9224 target type in init path

Change-Id: If395ba24d55b32d9aa31af78143a62c5dbc065a8
CRs-Fixed: 2916380
2021-04-19 09:36:11 -07:00
Yeshwanth Sriram Guntuka
6611374cf4 qcacmn: Trigger sys wakeup for WMI command when WOW is enabled
DHCP packet is received in the IPA exception path when
system is suspending. As part of DHCP packet processing,
WMI_PEER_SET_PARAM_CMDID is sent to FW after WOW is
enabled resulting in self recovery getting triggered by
host.

Fix is to do an explicit system wakeup if a WMI command
has to be sent post WOW enablement.

Change-Id: If1904a4fe5c861deed1b35071be10cb8cc8d6407
CRs-Fixed: 2890913
2021-03-31 01:04:01 -07:00
Jingxiang Ge
2c6d25c0ad qcacmn: Add detection for tasklet delay
This feature is used to detect CE tasklet scheduling delay
and credit response delay issues.

Change-Id: I9a8fcb425edd5cf96fae5f6cd3bfc7f51172c814
CRs-Fixed: 2874874
2021-03-16 00:45:23 -07:00
Manikanta Pubbisetty
14d38b77fb qcacmn: disable EXT grp irqs and drain TXRX during suspend
Any update to the SRNG TP/HP when the device is in low power
state would result in system errors. It is recommended to disable
EXT grp irqs and drain TXRX before sending power save enter command
to the FW. This will ensure that no interrupts are received while
in power save mode and as a result there wont be any HP/TP updates.

Change-Id: Ibf952bbc2c6d13fb3e4ca6b4845bc9cc887fa694
CRs-Fixed: 2883135
2021-03-11 19:41:34 +05:30
Vevek Venkatesan
17660198d7 qcacmn: disable all apps CE irqs except wake_irq in bus suspend
In Moselle, currently CE interrupts are not disabled from apps
side during ipci bus suspend, so adding changes to disable all
the CE interrupts except wake_irq during bus suspend and do the
symmetric inverse operation during bus resume, also drain all
the pending FW diag logs from copy engine.

Change-Id: Ib54fc6660fd81aff18787b0b699f3a6cd2d7803d
CRs-Fixed: 2879752
2021-03-09 08:57:09 -08:00
Jinwei Chen
017c719e4b qcacmn: Add HIF changes to support WCN7850
HIF changes to support WCN7850 WLAN chipset.

Change-Id: I02cd0702839a09b13a10b95237519f900a4cb7f9
2021-02-23 02:51:20 -08:00
Ananya Gupta
a3152f3104 qcacmn: Add DP event history in non debug mode
Enable DP event history for perf mode.

Change-Id: I1b8863928f956aa39488ea357d56e182613aad8d
CRs-Fixed: 2846844
2021-01-19 19:02:49 -08:00
Pavankumar Nandeshwar
1adba0a413 qcacmn: change qcn9100 to qcn6122 in hif and umac
Change the name of target type qcn9100
to qcn6122 in hif and umac.

Change-Id: Ia473c531a0903fd514dacf645d23bec3886fd719
CRs-Fixed: 2849577
2021-01-18 21:45:34 -08:00
Jianmin Zhu
6ef2047d56 qcacmn: Fix long ping delay after enable RTPM
Issue1: Driver RTPM state is ON/NONE, Kernel state is RESUMING.
cdp_runtime_resume is already complete,
hif_pm_runtime_get return -E_INPROGRESS,
dp_tx_hw_enqueue will set the flush event,
but cdp_runtime_resume is already done,
this flush event will be handled only on next pkt tx.

Issue2: Driver RTPM state: Resuming
hif_pm_runtime_get returns -EBUSY,
dp_tx_hw_enqueue is interrupted by any IRQ,
cdp_runtime_resume is completed,
dp_tx_hw_enqueue will set the flush event,
This flush event will be handled only on next pkt tx.

Fix:
Introduce a link_state_up atomic variable in hif to track the link state
change by pld_cb.
Set atomic variable link_state_up=1 in pmo_core_psoc_bus_runtime_resume
just after pld_cb. pld_cb brings the PCIe bus out of suspend state.
Set atomic variable link_state_up=0 in pmo_core_psoc_bus_runtime_suspend
just before pld_cb. pld_cb puts the PCIe bus into suspend state.

Introduce dp_runtime_get and dp_runtime_put.
dp_runtime_get get refcount with increment of an atomic variable.
dp_runtime_put return refcount with decrement of  this atomic variable.

If hif_pm_runtime_get returns -EBUSY or -EINPROGRESS,
take the dp runtime refcount using dp_runtime_get,
check if the link state is up, write TX ring HP,
return the dp runtime refcount using dp_runtime_put.

cdp_runtime_suspend should reject the suspend, if dp_runtime_get is non
zero.
cdp_runtime_resume should wait until dp_runtime_get becomes zero or time
out, then flush pending tx for runtime suspend.

Change-Id: I5b97d50cba710082f117f3845f7830712b86cda7
CRs-Fixed: 2844888
2021-01-14 07:46:48 -08:00
Rakesh Pillai
6ee7aeb0bd qcacmn: Avoid logging in packet transmission path
Currently if the driver is in runtime suspend/suspending
state, any packet transmission will request for resume
via hif_pm_runtime_get.

Unfortunately there is a logging in the above API which
will lead to more time consumption in the NET_TX softirq
context. This can lead to other delay in processing other
softirqs in the system.

Fix this by skipping the logging in the packet transmission
path.

Change-Id: Icc9f5b67794f7666243eb059f2e07a06a987002e
CRs-Fixed: 2844126
2021-01-12 14:34:40 -08:00
Vevek Venkatesan
bae1042f1c qcacmn: add wake_irq_type in HIF for power management
Add wake_irq_type in HIF layer for power management,
this helps in deciding to enable sync-up between
runtime suspend and wow resume in case of moselle.

Change-Id: I23a4d02d3ae7ec543a28174461996b84b18fd95d
CRs-Fixed: 2851265
2021-01-09 09:43:52 -08:00
Vevek Venkatesan
86f4aa6017 qcacmn: add sync between suspend and wow resume in runtime pm
In moselle, once wow enabled there is a possibility that wow wake
interrupt can be fired from FW during runtime suspend in-progress
in host, this will introduce a race between runtime suspend and
resume, so adding a synchronization between runtime suspend and
wow triggered runtime resume.

Change-Id: I38d6a24e4421697cc2d0090ba8d19884885596cb
CRs-Fixed: 2845672
2021-01-04 05:08:47 -08:00
Rakesh Pillai
4138c9b7d8 qcacmn: Add API to set dma mask for device
Currently DMA mask for the device is set during hif_enable_bus.
If the datapath memory prealloc feature is enabled, there are
a few dma memory allocation which is done before the DMA mask
is set for the device. This leads to the aforementioned dma
memory pre-allocation to be attempted at the default DMA mask.
Due to this the entire device capability of dma address might
not be used.

Add hif api to set dma mask before hif is initialized. This
is needed to set dma mask in case of datapath memory pre allocation.

Change-Id: I6fd25d9cb6ab3aaacd6f959abe4e060e23f37095
CRs-Fixed: 2845020
2020-12-29 11:05:45 -08:00
Jinwei Chen
652bd3a42b qcacmn: Support unaligned consistent memory prealloc
Support unaligned consistent memory prealloc for CE srng
memory.

Change-Id: I7c014e4c13602de89d03e2f7c5efb39b5b376226
CRs-Fixed: 2761282
2020-09-25 20:20:40 -07:00
Pavankumar Nandeshwar
9e00273fe7 qcacmn: HIF layer changes for QCN9100 bringup
Initial changes made for bring up of
QCN9100 in HIF layer

Change-Id: I60c5f7e8d5456e6f2bfda8f99d873a30ca979ada
2020-09-01 01:49:57 -07:00
Yeshwanth Sriram Guntuka
32a9cc93a8 qcacmn: Avoid logging few hif events in case of IRQ storm
In IRQ storm scenario, the events are logged to hif
event desc history even though the SRNG is empty
resulting in overwriting of older entries useful for
debugging.

Fix is to avoid recording hif events if the SRNG is
empty in IRQ storm scenario.

Change-Id: Id4161198c60f5fae31123c936f0f4acc1082a78b
CRs-Fixed: 2753675
2020-08-28 23:31:16 -07:00
Rajeev Kumar
bd9610f11b qcacmn: Remove obsolete HIF runtime pm prevent timeout API
hif_pm_runtime_prevent_suspend_timeout is no longer supported
and hence delete this obsolete API.

Change-Id: I2c01105219adb198bbf27aee5f2d5c7e357c1e34
CRs-Fixed: 2761022
2020-08-25 20:26:08 -07:00