Commit Graph

820 Commits

Author SHA1 Message Date
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
Debasis Das
aebe51208d qcacmn: Update HIF to use non-inline OS abstraction
Use non-inline OS-abstraction APIs to avoid direct usage
of kernel API's.

Change-Id: I873f8eac38f11cdd2264db16b2dff0757186eb7a
2021-01-22 12:07:45 -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
Kiran Venkatappa
2b51bdca43 qcacmn: Update Documentation for CE7 usage for QCN9000
CE7 is used for CV prefetch on QCN9000. Update documentation to reflect
the same.

Change-Id: I2da515ad3d88f07bbb69976e06d16f69cc443704
CRs-Fixed: 2853602
2021-01-13 10:17:30 -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
Jinwei Chen
7475f6c62c qcacmn: remove CONFIG_PCI_MSM compilation flag for link vote
CONFIG_PCI_MSM will not be defined if MSM PCI driver is compiled
as a module, so if wlan driver invoke hif_pci_prevent_linkdown to
prevent linkdown, pld_wlan_pm_control() actually is not invoked,
result in Noc error due to inactive PCIe link.

PLD driver already abstract MSM specific feature, remove CONFIG_PCI_MSM
complilation flag in wlan driver.

Change-Id: Iaaf929a74b44ac94370f1d98b7aef7aaec308e0f
CRs-Fixed: 2850839
2021-01-11 10:43:36 -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
Jingxiang Ge
aad342aeb5 qcacmn: Cancel runtime suspend if acquired wakelock
Issue happens when
step 1: kernel pm core start to runtime suspend
step 2: host get wma_acquire_wakelock & send PDEV_SET_HW_MODE.
step 3: host send wow_enable cmd
step 4: wow suspend finished and wow resume happens as step2
	send pm_runtime_get
step 5: fw dop PDEV_SET_HW_MODE as enter wow mode

so host can't get PDEV_SET_HW_MODE_RESP from fw.

Fix is:
   Don't allow suspend if sending PDEV_SET_HW_MODE.

After change logical will be:
   1 if PDEV_SET_HW_MODE before send hif_pre_runtime_suspend->
   hif_runtime_pm_set_state_suspending, then wow suspend
   will return failure.
   2 if PDEV_SET_HW_MODE send after hif_pre_runtime_suspend->
   hif_runtime_pm_set_state_suspending, it will request resume
   and send after wow resume.

Change-Id: I91eea70f841cf9e5d6767f6005eb9662515657a6
CRs-Fixed: 2850561
2021-01-08 16:37:33 -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
Alan Chen
13a96842f7 qcacmn: Clear PCIe link suspended state
RTPM wow resume gets triggered from ongoing WMI cmds related to SAP
getting started on the 5 GHz DFS channel. Even though PCIe link resume
is successful, there is a link up vote from UMAC and scn link suspended
state is not getting clear. Thus, clear the scn->link_suspended state
at the end of hif_pci_bus_resume_noirq() because before HIF PCIe bus resume
noirq phase is complete, PCIe link is already resumed.

Change-Id: If05593c95d2d63d271fed4abcf84b43e96cc070e
CRs-Fixed: 2833831
2020-12-09 17:39:23 -08:00
Arun Kumar Khandavalli
3c61a1d942 qcacmn: get the data during the issue with the bus
Whenever there is a recovery triggered, if there is a
failure in reading the bus id collect the bus specific
registers to understand the reason for the failures.

Change-Id: I7387d63d9205d24fd881824b9a9fac48a7816c73
CRs-Fixed: 2833331
2020-12-09 15:29:20 -08:00
Tiger Yu
34746552e9 qcacmn: Enhance athdiag to support 32bits reg address & live dump mode
Enhance athdiag to support 32bits HAL register address access. And support
the live dump mode to access the HAL registers directly using PCIE
interface.

Change-Id: I2322059e68b30ae47228e06dca01537b23ac2074
CRs-Fixed: 2831283
2020-12-09 10:55:27 -08:00
Ananya Gupta
a550225eb1 qcacmn: Rate limit logs when wake request fails
Excessive logging is detected when force wake request
command fails.
Rate limit the logs in hif_force_wake_request and
hal_write32_mb.

Change-Id: I9b1166074dfdb2d58d811571c802a75a6dbc03c5
CRs-Fixed: 2823961
2020-11-23 21:57:39 -08:00
Yeshwanth Sriram Guntuka
ca3d4fecef qcacmn: Add PCIe link status sanity before enabling CE IRQ
Check for PCIe link status and enable the CE IRQ only
if link is active.

Change-Id: I767a467a4b70435037f5ccce9e740f95f8b6112a
CRs-Fixed: 2821406
2020-11-19 18:23:25 -08:00
Xueqiang Gong
f8ab86bb69 qcacmn: support GENOA PCIE Global Reset
Correct the address of ADRASTEA_PCIE_LOCAL_REG_BASE_ADDRESS
to support PCIE Global Reset for Genoa Chip.
This feature is only used at 3rd party platform which
do not support reset WLAN chip by toggle WLAN_EN pin.
To use this feature, please add
"CONFIG_QCN7605_PCIE_GOLBAL_RESET_SUPPORT" in makefile.

Change-Id: Ia75b567bd305d73d17a7cec3a39cbc36b1ae737d
2020-11-11 02:50:35 -08:00
Balamurugan Mahalingam
d0b7b07b98 qcacmn: reduce the pktlog dest ce ring size to 128 in lowmem platform
Reducing the PKTLOG ring size to 128 as only USR_COMPLTN_FLUSH_TLV
alone is intended to be processed in this ring on a lowmem platform.
This is done only for IPQ5018 and QCN9000 to reduce the buffer
consumption

Change-Id: I82d3dd0286c97ea672b47613008c97dc6d5dce5c
2020-11-05 03:26:05 -08:00
Kai Liu
4be28ba641 qcacmn: Enhance hang info feature
Add bus related info in hif layer in order to get bus status
when hang issue happened.

Change-Id: If922e0892e0f65de778b9696bbc56fc63c25c169
CRs-Fixed: 2801350
2020-10-30 13:03:35 -07:00
Nisha Menon
a377301c78 qcacmn: Add support to map generic shadow regs
Add apis to map generic registers to shadow region. Existing
logic includes mapping only srng based regs to the shadow
region.
Add support to map REO control regs and WBM2SW2 rel
ring HP reg address to the shadow region in case the direct
reg writes in IPA enable/disable autonomy fail due to UMAC
block being in a power collapsed state.
Shadow reg mapping for these regs is provided to FW during
init. Add stat shadow_reg_write_fail to track shadow reg
write failure and shadow_reg_write_succ to track successful
shadow writes.

Change-Id: I04790765a3de80047689657e2cad0b73123440b9
CRs-Fixed: 2790321
2020-10-20 15:05:51 -07:00
Govind Singh
183dd69628 qcacmn: Free mem leak in qmi bypass mode
QMI bypass mode uses 2mb of of mem region for
fw uses. Current implementation does not free this
memory region when qmi bypass mode in enabled.
Free mem leak in qmi bypass mode.

Change-Id: Ie11aa9f20f93183e0b999cd6578aea4b231f8d8b
2020-10-19 05:09:32 -07:00
Govind Singh
b481b85018 qcacmn: Fix pktlog pipe callbacks assignment for Adrastea
PKTLOG callback is not updated for Adrastea target as
htt_htc_soc_attach does not get called during initialization.
Fix pktlog pipe callbacks assignment for Adrastea target by
checking only CE_ATTR_INIT_ON_DEMAND attribute.

Change-Id: I16f2d2e493440315343087417a8d4c341065ae9a
2020-10-15 16:46:18 -07:00
Uraj Sasan
96654fada3 qcacmn: Disable CE_ATTR_INIT_ON_DEMAND for CE5
Disable CE_ATTR_INIT_ON_DEMAND for CE5.
Currenly CE5 is used for other stats apart from pktlog.
When CE5 is configured as on demand its not initialised until pkltog
is enabled, but we still send stats to CE5 causing issue.

Change-Id: I286fcaf5c908028f5f42a0f4f91c810660ee6d11
2020-10-14 05:48:42 -07:00
Uraj Sasan
0d5e9734be qcacmn: Adds dummy API's
Adds dummy API's for hif_config_irq_by_ceid.

Change-Id: I7bbb0ece4ab5f8bf648bc0e945c5a28de2a49feb
2020-10-12 02:32:11 -07:00
Uraj Sasan
180f7b20d9 qcacmn: Pktlog dynamic CE config support
Add support to dynamically initialize the CE for PKTLOG
and post buffers on demand.

This helps avoid unnecessary initialization of PKTLOG
ring and save the memory in lowmem platforms

Change-Id: Ib02153b3e7205be30b07e4a4763edf3374827328
2020-10-08 10:19:22 -07:00
Srinivas Girigowda
998df7c913 qcacmn: Remove obsolete HIF_{ERROR/DBG/WARN/INFO/INFO_HIGH/MED/LO} macros
Remove obsolete HIF_{ERROR/DBG/WARN/INFO/INFO_HIGH/MED/LO} macros.

Change-Id: If0f726aea32eef09cbd5d9e66383a3f6cd633c7d
CRs-Fixed: 2791256
2020-10-06 01:28:19 -07:00
Sridhar Selvaraj
bf0668f3c0 qcacmn: Reinitialize pci irq ops for qcn9100
QCN9100 pci radio is connected to the IPQ5018 through PCI slots
and enumerated by the Q6 radio. From the host driver perspective,
QCN9100 is treated as an AHB device, however the QCN9100 uses
MSI interrupts to notify events
-Reinitialize pci irq ops for hybrid bus type device qcn9100
-Update CE flags of qcn9100 to interrupt mode
-Set disable_wake_irq flag for qcn9100 as wake irq is not used

Change-Id: I8da7f0b48923b9d70e62f4ff181bd47865ea2fe8
2020-10-01 19:09:03 -07:00
Yeshwanth Sriram Guntuka
7d4b38f4ad qcacmn: Set the CE2 buffer size to 3200 bytes
Buffers attached to CE2 destination ring are of 4k bytes.
skb allocation for these buffers exceed 1-page allocation
due to addition bytes reserved for alignment, padding and
skb shared info.

Set the CE2 buffer size to 3200 bytes so that the skb memory
fits into a single page.

Change-Id: I97b3fc140376bb107ba23ab581a2dd5aeb833948
CRs-Fixed: 2785267
2020-10-01 16:58:12 -07:00
Srinivas Girigowda
80c1b5a6c3 qcacmn: Replace obsolete HIF_DBG() with hif_debug()
Replace obsolete HIF_DBG() with hif_debug().

Change-Id: I462d75617359fd13eafa497045ddfb70c2025595
CRs-Fixed: 2779720
2020-10-01 14:41:39 -07:00
Srinivas Girigowda
d89e043589 qcacmn: Replace obsolete HIF_TRACE() with hif_info()
Replace obsolete HIF_TRACE() with hif_info().

Change-Id: I315d86b886ce0bc28c8c967c986095fe2ee46bec
CRs-Fixed: 2779720
2020-10-01 14:41:34 -07:00
Srinivas Girigowda
d79f50ca9c qcacmn: Replace obsolete HIF_INFO_MED() with hif_debug()
Replace obsolete HIF_INFO_MED() with hif_debug().

Change-Id: Iec7a1a5332293bc5cc3a826a1223fa74e1fa3955
CRs-Fixed: 2779720
2020-10-01 14:41:28 -07:00
Srinivas Girigowda
832f4f7018 qcacmn: Replace obsolete HIF_INFO_LO() with hif_debug()
Replace obsolete HIF_INFO_LO() with hif_debug().

Change-Id: I3794e381c0810c08b37670d6dec8eace78eb3fb7
CRs-Fixed: 2779720
2020-10-01 14:41:15 -07:00
Srinivas Girigowda
15d2d83bd1 qcacmn: Replace obsolete HIF_INFO_HI() with hif_debug()
Replace obsolete HIF_INFO_HI() with hif_debug().

Change-Id: I85178f5e690030208f65d4375247383a62c12f76
CRs-Fixed: 2779720
2020-10-01 14:41:10 -07:00
Srinivas Girigowda
f327fcd404 qcacmn: Replace obsolete HIF_INFO() with hif_info()
Replace obsolete HIF_INFO() with hif_info().

Change-Id: I7fcf079551db5a69bd45b96b2126d1521c3e3e4c
CRs-Fixed: 2779720
2020-10-01 14:41:06 -07:00
Srinivas Girigowda
94ea515d92 qcacmn: Replace obsolete HIF_WARN() with hif_warn()
Replace obsolete HIF_WARN() with hif_warn().

Change-Id: Idb72d684b9d05aab6cf55ee2608f47c04077d8f7
CRs-Fixed: 2779720
2020-10-01 14:41:01 -07:00
Srinivas Girigowda
9667b145c6 qcacmn: Replace obsolete HIF_ERROR() with hif_err()
Replace obsolete HIF_ERROR() with hif_err().

Change-Id: I9260b47d11c1820bb05d9a7e2bf50d5257ba85ae
CRs-Fixed: 2779720
2020-10-01 14:40:57 -07:00
Karthik Kantamneni
268ab400cd qcacmn: Add support for WMI DIAG events over CE7
Add support for handling firmware WMI DIAG events over CE7.

Change-Id: I3d6c0b08313e816809a65eb77d9728fc4b4488f3
CRs-Fixed: 2787010
2020-09-30 11:10:33 -07: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