Commit Graph

797 Commits

Author SHA1 Message Date
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
Nirav Shah
a24f3db18e qcacmn: Increase CE2 host ring size to 512 for QCN7605
Increase CE2 host ring size to 512 for QCN7605 to avoid
ring full condition in FW in debug build.

Change-Id: I900611487696e3e83cd7adc72f10cd2cdcb15ead
CRs-Fixed: 2778941
2020-09-17 18:34:16 -07:00
Nisha Menon
095453ad08 qcacmn: Increase num of entries in CE2 dest and status rings
Increase the num of entries in host side from 32 to 64
so FW can post more descriptors to host src ring
without hitting ring full condition. This is to avoid
back pressure issues in FW. The memory increase is
by 32*4K allocations.
This change is applicable to all HSP targets.

Change-Id: Ia973e13b9d9b2b682957ae19fc3f23dd49bef401
CRs-Fixed: 2761953
2020-09-16 02:33:21 -07:00
Mohit Khanna
8e57f126b5 qcacmn: Use zero timeout in non interrupt mode during force wake
Currently we use a single timeout value of FORCE_WAKE_DELAY_TIMEOUT_MS
during hif_force_wake_request. A 50ms value is not enough in some cases
to bring MHI to M0 from M2/M3_fast states. This can result in a write
failure.

In certain cases, when not in an interrupt context, it should be okay
to wait slightly longer for MHI to transition into M0.
Hence, pass 0 as the timeout value to pld_force_wake_request_sync.
This API calls CNSS API which uses a blocking call -  mhi_device_get_sync,
to transition MHI to M0, when a value of zero is passed.

Change-Id: I738bf9c4a9a83c943186445cba0174df18a45c74
CRs-Fixed: 2766674
2020-09-16 02:33:14 -07:00
Yeshwanth Sriram Guntuka
4aa291d159 qcacmn: Do explicit system wakeup for group intr in D0-WoW
In P2P GO mode, on system suspend to s2idle state, bus
is suspended and D0-WoW is enabled. Ping requests from
P2P client cause the REO interrupt to fire but since
system is in s2idle state, system is not woken-up. This
results in destination unreachability or large rtt for
ping on P2P client.

Fix is to do explicit system wakeup when group interrupts
fire after system is in suspend state.

Change-Id: Ic6f51c3fc8bad6da29adf58972890677a81f2064
CRs-Fixed: 2765037
2020-09-13 12:53:07 -07:00
Pavankumar Nandeshwar
864714139c qcacmn: Use right register name
Use correct register name WFSS_CE_COMMON_REG_REG_BASE
for qcn9100

Change-Id: Ie7bc5bf66d9cda2b1a5603a5fc5b4a032efe29ce
2020-09-01 01:50:04 -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
Arun Kumar Khandavalli
211a0c13bc qcacmn: Return error incase of hif bus runtime resume
For hif_bus_resume till now driver does panic whenever there is
failure. This is now handled in the cnss driver which will collect
the required dump to debug the link down.

Remove the bug_on, just log and return the status.

Change-Id: Ief4d86dd76c0bbde361b69b38894a944eec05aae
CRs-Fixed: 2765117
2020-08-31 20:02:17 -07:00
Surya Prakash Raajen
ca1a15192f qcacmn: Update format and index for CE latency buffer
Update formate and index to traverse CE Latency stats circular buffer
and print them in more user readable format.

CRs-Fixed: 2676241
Change-Id: I7b3464cd00227dfcf98bbfa63a407055dd7cbf57
2020-08-31 03:32:35 -07:00
Jia Ding
e26d537266 qcacmn: Properly remove affinity hint for CE irqs
IRQ affinity for CE IRQs has been set to gold cores.
But affinity hint is not removed when freeing CE irqs.

Therefore remove affinity hint for CE irqs before freeing
them.

Change-Id: I7385a90955bc7e357badcd784e40d89022542d1a
CRs-Fixed: 2765373
2020-08-29 07:07:34 -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
Jinwei Chen
d5a6680a6f qcacmn: Reduce CE4 source ring entries number
For lithium based HST/HSP, CE4 is no longer used for data TX,
just few HTT msg for ring configuration, 2048 entries requires
16 * 2048 = 32K ring consistent memory which looks is not necessary,
reduce CE4 ring entries number to 256.

Change-Id: I117ec81cbee3642d640457c37a7ab900ddcae3f5
CRs-Fixed: 2757925
2020-08-21 16:59:05 -07:00
Nisha Menon
b7d1ef0bdf qcacmn: Set IRQ affinity for CE IRQs to gold cores
CE2 status ring full condition results in WMI req timeout
in host resulting in self recovery being triggered.
Set IRQ affinity of CE IRQs to gold cores for defconfig
builds only. This is to alleviate the processing of all
DP rings and CE rings on CPU0.
CE2 status ring will be reaped fast enough to ensure host
has enough credits from FW to send out the WMI reqs to FW.

Change-Id: Ifef338faac17b44eae811d23ec41d89bde1b29c7
CRs-Fixed: 2738317
2020-08-21 02:28:45 -07:00
Arun Kumar Khandavalli
ffaafd74ef qcacmn: Correct the tlv length of the hangdata
The Tlv of the hang data is reduced to 2bytes from the 4bytes
change the structure defnitions accordingly.

Change-Id: I675e4d837afa92496aeebec408ebfd90cbb7ad32
CRs-Fixed: 2753821
2020-08-17 08:06:33 -07:00
Jia Ding
223c1e5865 qcacmn: Fix uninitialized scalar variable
Fix below static code analysis case.

uninit_use_in_call: Using uninitialized value target_type
when calling hif_get_device_type.

Change-Id: I0d072dd7dd92addeb986d088a7ee85ff13e15d16
CRs-Fixed: 2748473
2020-08-06 10:38:07 -07:00
Basamma Yakkanahalli
f732e1a0b2 qcacmn: disable CE8 interrupt
Disable CE8 interrupt it is not used between 
host and target communication.

Change-Id: I39439bcdd6adfa3973bcc81eaf43f047839a85aa
2020-08-06 10:38:03 -07:00
Vevek Venkatesan
7d59f8067a qcacmn: fix the error by accessing pointer if not NULL
Fixing the errors of accessing pointer only if it not NULL.

Change-Id: Ie1e5ae4e4403956e3f9d4df7ca139804fe89d641
CRs-Fixed: 2741833
2020-08-06 01:50:24 -07:00
Alok Kumar
b00f74430d qcacmn: Check target ready before accessing registers on qca6750
Before accessing any register on chip 6750, check if target is
ready or not.

Do not allow register access if target is not ready.

Change-Id: I41a604d04e861c97bdd676998222ccecbf12fd5a
CRs-Fixed: 2688920
2020-07-30 02:05:59 -07:00
Shashikala Prabhu
ba0276b572 qcacmn: Correct the return types of functions in HIF component
A few functions in HIF component returns QDF status value with return
type as non QDF STATUS and vice versa. For such functions, update the
correct return type.

Change-Id: I806407dd0596cd03500242d97ca8220a7beb6c55
CRs-Fixed: 2734818
2020-07-24 09:21:17 -07:00
Shashikala Prabhu
cb2acc0ea0 qcacmn: Correct the return types of functions in HIF component
A few functions in HIF component returns QDF status value with return
type as non QDF STATUS and vice versa. For such functions, update the
correct return type.

Change-Id: Ifc1068d60e62f7405a15e2b4f0738d91243bd6de
CRs-Fixed: 2734818
2020-07-24 09:21:14 -07:00
Shashikala Prabhu
a143607a26 qcacmn: Correct the return types of CE functions
A few functions in CE files returns QDF status value with return
type as non QDF STATUS. For such functions, update the return type as
QDF_STATUS.

Change-Id: I401c0a1e1c21ac0865cf4da018eb2d2fb6d86900
CRs-Fixed: 2734818
2020-07-24 09:21:11 -07:00
Shashikala Prabhu
b87eec2b53 qcacmn: Correct the return types of HIF functions
A few functions in HIF component returns QDF status value with return
type as  non QDF STATUS. For such functions, update the return type as
QDF_STATUS.

Change-Id: I69644a2206266ffe2c2d105056f9fec452f5d972
CRs-Fixed: 2734818
2020-07-24 09:21:08 -07:00
Chaoli Zhou
81d4965369 qcacmn: Reduce the ce entries while disable pktlog
If disable pktlog for hasting/genoa, we need to
mark the ce5/ce7 not used separately to save
some memory. But currently, if set target ce
entries to 0, it has wlan fw crash issue,
so reduce it from 32 to 2 first. Once wlan
fw fix the crash issue, and then change to 0

Change-Id: I7ab11f202fe353737a4104e71fc79ee749b80fc8
2020-07-24 07:10:21 -07:00