Commit Graph

1045 Commits

Author SHA1 Message Date
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
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
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
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
4dc1443151 qcacmn: Track for unbalanced group irqs enable/disable
In wlan suspend and resume cases it is seen that group
irqs are getting disabled multiple times without getting
enabled which is causing irqs to be disabled permenantly.

Track for unbalanced disabling/enabling group irqs which
helps to root cause the issue.

Change-Id: Ic1ef637c317f04b3299f17f19208df11ece3c013
CRs-Fixed: 2939809
2021-05-18 08:29:29 -07:00
sandhu
9dc81d7965 qcacmn: Add HTT HTC tx completion based packet free
Add CE4 tx completion for htt htc packets. current logic
uses htt htc misc list to free packets.

Change-Id: Iea15d0dba544d3cc7581b11aa7ab7e5c0024133a
CRs-Fixed: 2630768
2021-05-17 18:56:02 -07:00
Basamma Yakkanahalli
418f1c828d qcacmn: remove unused WCN7850 emulation device id
Removed unused WCN7850_EMULATION_DEVICE_ID.

Change-Id: I66a148accd25cfa9be6c7db35e4f89b569478947
2021-05-17 00:52:14 -07:00
Nandha Kishore Easwaran
718d6aeece qcacmn: Add configurable option for MSI interrupts
Provide multiple combinations to configure the msi interrupts
of DP and CE based on the number of MSIs available in the platform.
Number of MSIs used for CE and DP can be changed by modifying the
MSI assignment table in platform driver. Best possible mask for that
MSI is automatically chosen based on predetermined settings.

Change-Id: I02b44fb033631d69d97f2d8d2d3f698541d37aad
2021-05-13 12:33:04 -07:00
Karthik Kantamneni
ad0f442d8f qcacmn: Add delayed reg write support based on EP power state
Even though HP/TP updates are posted writes at CPU level, they
are getting blocked until soc comes out retention which is hogging
CPU.

To avoid this if EP is in low power state update HP/TP writes from
delayed work context. In delayed work vote for EP awake wait till it
comes out low power state and then proceed to HP/TP update.

Change-Id: I61d5795f58f25f850b5a9ad4d30e3181dba23713
CRs-Fixed: 2913495
2021-05-11 08:03:35 -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
Karthik Kantamneni
2720cae884 qcacmn: Set IRQ affinity for CE interrupts to gold cores
When CE tasklets and NET_RX gets scheduled on same CPU,
NET_RX is throttling CE tasklet resulting  WMI timeouts.

To avoid this affine CE irqs to gold cores, so that CE
tasklets will get enough CPU time.

Change-Id: Ided81a0565958aca6611eba911824c3485eca472
CRs-Fixed: 2933335
2021-05-03 06:05:13 -07:00
Jingxiang Ge
5b31c536c4 qcacmn: trigger recovery in hif_check_detection_latency
Replace as qdf_trigger_self_recovery here, so it can trigger
fw dump firstly.

Change-Id: I39e3bc11829a1969ac60bd3bbd71f3e2d1fa4f43
CRs-Fixed: 2928096
2021-04-26 00:17:53 -07:00
Alan Chen
a1aa15b70c qcacmn: Change log level to debug for hif_runtime_lock_init/deinit
To avoid excessive logging, we whould not logs RTPM lock init and
deinit to the console. Thus, change the log level to debug.

Change-Id: Ib11045fe50f729b0580284fa913da48d3a59b323
CRs-Fixed: 2927959
2021-04-22 13:13:42 -07:00
Kiran Venkatappa
63e6497955 qcacmn: regtable changes for qcn9224
regtable abstraction changes for qcn9224 target

Change-Id: Idff6814b2c53feb7c80e41801206808bb4855be3
CRs-Fixed: 2916304
2021-04-21 06:32:10 -07:00
Tiger Yu
9ed639bc59 qcacmn: Limit the excessive logging during processing CE completion
The hw_index reading from the DDR by the RRI feature might be not
updated in time which might cause the excessive logging in the dmesg.

Change-Id: Ic9c3648b032ba59a6b7f92d8c27b63cb6a650381
CRs-Fixed: 2919867
2021-04-21 04:23: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
sandhu
bdb8bb9c35 qcacmn: Add error handling for ce_init mem allocation
Add error handling for ce_init mem allocation of
alloc_mem_ce_debug_history.

Change-Id: I042799f9966660ab56b53fe707037db2db6b5ddf
CRs-Fixed: 2910841
2021-04-21 04:23:26 -07:00
Kiran Venkatappa
4acc2310cd qcacmn: CE assignment changes for qcn9224
Add CE assignment table for qcn9224

Change-Id: Idf1cd998ce9089d9e0cc12ea771b9559cfb13540
CRs-Fixed: 2916087
2021-04-19 09:36:15 -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
Manikanta Pubbisetty
5abda36e03 qcacmn: use disable_irq for EXT GRP IRQs
Currently, as part of device suspend, EXT GRP IRQs are disabled.
disable_irq_nosync() which is currently being used to disable
interrupts will not wait for pending IRQs to completion. With this
API, there is a chance where IRQ handler can be executed after the
device suspend. Use disable_irq() instead so that pending IRQs will
be completed before returing from disable_irq().

CRs-Fixed: 2904518
Change-Id: Ib9acabe89b0337add82918be24b4782a6b125d05
2021-03-31 14:14:46 -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
83053abc6f qcacmn: Adjust format in hif_latency_detect_credit_record_time
Adjust format in hif_latency_detect_credit_record_time

Change-Id: I1e2e48b2c11cd677d4ce5228f0ea7b03b7f37853
CRs-Fixed: 2908993
2021-03-26 18:36:06 -07:00
Guisen Yang
80d5b0dc18 qcacmn: Set correct host ce count in epping mode
In epping mode, the host ce count is not set correctly. And
then host will receive interrupt with incorrect ce id which
will trigger watchdog bite. Set the correct host ce count
and this issue can be fixed.

Change-Id: Ia91534fcfd1265e96f39ffd961ad794db3a4748a
CRs-Fixed: 2901231
2021-03-24 09:48:13 -07:00
Guisen Yang
b51b03ddca qcacmn: Add shadow address for CE3
When sending BE stream in epping mode, it fails when writing
registers of CE3 because the addr is not defined. Add this addr
to support epping mode data transfer.

Change-Id: I0d01cbee889c272b35a02bd1aca47f341f1edd2e
CRs-Fixed: 2901231
2021-03-24 09:48:04 -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
Jingxiang Ge
58b2f08534 qcacmn: Add lock protection for prevent_suspend_list
Need to protect prevent_suspend_list by runtime_lock.
Issue happens when
1 printing lock0 of prevent_suspend_list in thread0
2 thread0 scheduled out and lock0 is released.
3 return back to thread0, it will using lock0 pointer
  to check next lock, then issue happens.

Fix is adding runtime_lock to protect.

Change-Id: I7182651e445cf5008dba73e15b2c261cc125577f
CRs-Fixed: 2883052
2021-02-25 18:31:46 -08:00
Nisha Menon
8d4b739df0 qcacmn: Enable device force wake recipe in driver
Enable force wake recipe feature DEVICE_FORCE_WAKE_ENABLE
and disable the generic shadow register write feature
GENERIC_SHADOW_REGISTER_ACCESS_ENABLE.
Force wake recipe will be used to write to the REO remap
control registers by waking up the UMAC instead of using
shadow register writes.
Assert soc wake reg and poll on the scratch reg to check
if UMAC is awake.
Enable HIF_REG_WINDOW_SUPPORT to enable windowed reg
read/write in HIF layer.

Change-Id: Ib696e27e19a07c0084c097b95b7780b56e643c8b
CRs-Fixed: 2850590
2021-02-24 19:35:13 -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
Karthik Kantamneni
d4119f1507 qcacmn: Use msleep instead of mdelay in hif_force_wake_request
When hif_force_wake_request is called from non interrupt context
use msleep to avoid mdelay since it is busy wait function.

Change-Id: Icda50e9d18b64369128a4f669ca1259931e5194a
CRs-Fixed: 2883178
2021-02-23 00:37:51 -08:00
Vevek Venkatesan
38af510319 qcacmn: add dedicated workqueue for Tx ring delayed reg write
Add delayed SRNG register writes support for Tx Ring, also add
dedicated workqueue to do the delayed Tx SRNG register writes.

Change-Id: I8dd157d341f3035e988804eab50d1ca681ab789b
CRs-Fixed: 2868989
2021-02-12 14:40:11 -08:00
Li Feng
8c267f9645 qcacmn: Fix the leak in ce tasklet counting on one-msi platform
On one-msi platform, when some ce tasklet execute, other srng such
as reo generate the interrupt, the ce interrupt handler can also be
called and then schedule the ce tasklet, if the running ce tasklet
intend to re-schedule itself due to the rx pending, obviously will
fail, then ce active tasklet count leaked.

Decrease the ce active tasklet count if failed to re-schedule when ce
rx pending.

Change-Id: I36c1c6c007735e192bee5af12aab674ee8324ca9
CRs-Fixed: 2830443
2021-02-02 21:05:23 -08:00
Kiran Venkatappa
53d0aec26d qcacmn: Set error code when ce_init fails to alloc ce_state
Set proper error code when ce_state creation fails. Sending success from
here results in inconsistent state of CE data structures resulting in
invalid access. Send failure as return so that proper handling is done
by the caller.

CRs-Fixed: 2855116
Change-Id: I9c063760656a8125e627aaa62b309a2bb4c0ac6f
2021-01-28 06:19:45 -08:00