Before CNSS2 triggers RDDM mode in device it collects shadow
register dump in a global variable. Now when device moves to
RDDM, shadow registers will be reset. Reading shadow registers
in RDDM mode will override previously read correct values with
reset values. To avoid it, do not dump shadow register in RDDM
mode.
Change-Id: I470208be7e38bc9291932a7acfbaf07d87d46651
Setup GPIOs for interrupt wakeup capable by calling
msm_gpio_mpm_wake_set() for such GPIOs.
Change-Id: I8a6e35b6e5ab49c569bfcb0a96c5361072cbe458
CRs-Fixed: 3345066
Add CLD80211_ATTR_IFINDEX attribute to send interface index
in order to overcome duplicate logs for STA+STA case
Change-Id: Iba2a5d59b2e3a444844510afa2f17140244507d7
CRs-Fixed: 3340768
Add support for regulators: 1.2V IO, and Antenna sharing
to enable those based on entries in device tree file.
Change-Id: I362f0251ff3923c725f0e2a62922a35149bef3b9
CRs-Fixed: 3338737
Do not invoke the mhi_control_error to notify the pcie link down event
for QCA6174 to avoid NULL pointer access.
Change-Id: I2c899ab51117aef2f9474e83217229b211eb4759
CRs-Fixed: 3335555
Add and export API to check whether FW capabilities like
DIRECT_LINK, etc are supported by FW or not.
Update WLAN Firmware Service QMI file as per latest IDL file.
Change-Id: Ic33104ec55e18845b8c33ff611d1ecc15ec5cd77
CRs-Fixed: 3335259
Pointer for memory pool may be null if it fails to
create memory pool in cnss_pool_init().
Add null pointer check before accessing memory pool.
Change-Id: I8ae2b6a5193cffdcba3990b238178a1b93297925
CRs-Fixed: 3332360
Only when SMMU S1 enabled, CNSS driver will send IOVA range in
HOST_CAP message, and let firmware to configure ATU.
Change-Id: Idd19063da975c0105d91e0e31575d0b0d1edd8e2
CRs-Fixed: 2896035
Add APIs for handling AFC memory request from FW:
cnss_send_buffer_to_afcmem() and cnss_reset_afcmem().
cnss_send_buffer_to_afcmem() will be called if receive valid AFC
response data, cnss_reset_afcmem() will be called if receive
invalid AFC response data. After memory copy done, another WMI
command will indicate FW ready to read.
Change-Id: I34b9add3d7721d778e5474d9b11ad64adb4f04f0
CRs-Fixed: 3223607
This refine commit 418727f314 ("cnss2: Print the bandwidth level voted"),
to avoid too many vote log in dmesg during traffic test.
Change-Id: Ia260a84bcdb3e5154376471519340db1b5907ce4
CRs-Fixed: 3273973
Add RC_EP_ULTRASHORT_CHANNEL in cnss feature if it
is enabled in dtsi and indicate it to wlan fw.
Change-Id: Ic70c4b1b2dd637f11c2e2b281521f2094a9a2fe9
CRs-Fixed: 3323608
Add RC_EP_ULTRASHORT_CHANNEL parameter in cnss feature
to indicate wlan fw whether root complex and end point
has ultrashort length or not.
Change-Id: I96ce5eb0954e20f7aed4ecbcecdbcde617988791
CRs-Fixed: 3323600
CNSS2 registers as both platform and PCI driver. PCI
device can be removed via sysfs exposed by kernel during
PCI device creation. When PCI device gets removed, CNSS
PCI remove ops gets called. In cnss_pci_remove, unregister
host driver and shutdown WLAN chip to cleanly remove PCI
device.
Change-Id: Ia60e8b69bda2b3bdd5990cb83f47c082d6667283
CRs-Fixed: 3308910
The reservation mode of interrupts in kernel assigns a dummy vector
when the interrupt is allocated and assigns a real vector when the
request_irq is called. The reservation mode helps to ease vector
pressure when devices with a large amount of queues/interrupts
are initialized, but only a minimal subset of those queues/interrupts
is actually used.
So on reservation mode, the msi_data may change after request_irq
is called, so reads msi_data again after mhi request_irq is called,
and then the correct msi_data is programmed into hardware components.
Without this change, spurious interrupt occurs in case of one MSI
vector.
Change-Id: I41070987798835f8fa95304fce3b964bbd77b31d
CRs-Fixed: 3313984
Some platforms can't meet the number of MSI interrupt vectors that
wlan driver requires.
Add one MSI interrupt vector support.
If CONFIG_ONE_MSI_VECTOR is not defined, wlan driver fails to load
if reuired MSI vector allocation fails. It is current behavior.
If CONFIG_ONE_MSI_VECTOR is defined, firstly it will allocate multiple
MSI vectors based on MSI config. If MSI vector allocation fails, it
fallbacks to one MSI vector automatically.
Change-Id: I813f7ddf678ecf405e573f3bc72af3e758d1c96d
CRs-Fixed: 3312670
To protect firmware download not be processed when system goes into
suspend, before we add semaphore cnss_pm_sem in cnss driver.
Function cnss_pm_notify, PM_POST_SUSPEND may be got before
PM_SUSPEND_PREPARE. Once it happens, the count of cnss_pm_sem will
be abnormal.
And, ROME firmware download is in qcacld driver. Not in cnss driver.
So, remove function cnss_pm_notify, and the export symbol cnss_lock_pm_sem
and cnss_release_pm_sem. Move the protection to qcacld driver. In qcacld
driver, use wakeup source to protect ROME firmware download.
Change-Id: I7768fdbeb1fa8cd6ef3b260eb0aafb231aeed324
CRs-Fixed: 3294347
There is a typo in the parameter list of function
cnss_aop_set_vreg_param's declaration, and that is causing
a compilation error when CONFIG_MSM_QMP is not defined on
certain platforms.
Fix the compilation error by changing the 3rd parameter's
type from 'cnss_aop_tcs_seq_pram' to 'cnss_aop_tcs_seq_param'.
Change-Id: Iccb832e1d841a82db3df42c93ef8ed8367a93d26
CRs-Fixed: 3314506
CNSS prealloc maintains various prealloc pools of 8Kb, 16Kb, 32Kb
and so on, and allocates buffer from the pool for wlan driver. When
wlan driver requests to free the memory buffer then CNSS prealloc
derives slab_cache from virtual memory via page struct to identify
prealloc pool id to put memory buffer back into the pool.
In kernel 5.17, slab_cache is removed from the page struct. Add new
functions to store cache at the beginning of allocated buffer and
when wlan driver requests to free the memory then use that cache to
identify CNSS prealloc pool to put back memory.
Change-Id: I6b3a54d3f502d977c6a61cfa6aeae597df9c8e72
CRs-Fixed: 3309289
Ensure the completion of pci probe before checking
whether the calibration is supported for the device id or not.
Change-Id: Ifb6b6b15c434c16822bb8a4291403e4a635f985f
CRs-Fixed: 3303831
Fix issue in return type of following functions:
- cnss_rddm_trigger_debug()
- cnss_rddm_trigger_check()
Change-Id: I41eb4637605f9a2189e03e732c688c25b0895a90
CRs-Fixed: 3304957
Add code to update feature list with CNSS_WLAN_EN_FEATURE flag
if WLAN_EN gpio is supported, the host indicates to firmware
about the WLAN_EN support via the feature list which is sent as
part of host capability qmi message. This would help firmware
to decouple the PERST in RDDM for MSM targets.
Change-Id: Iec870a0f9528a4ffdb118459ec611b33ff01cf80
CRs-Fixed: 3084551
Converge dt nodes for wlan chips that share the same PCI slot
into one node.
The items in this node are split into 2 parts: common and chip
specific.
The common part will be parsed during cnss probe, such as basic
power related configuration and bus type, to power on the device
and trigger pci probe;
Chip specific part will be parsed during bus specific probe, this
part includes chip specific power and feature related
configurations.
With this change, cnss2 can support different chips on one pci
slot with the same image.
Change-Id: I08c64b6dc3cc27a479ee6fd07e3c8705cc3ac43d
CRs-Fixed: 2384088
In kernel 5.18, pci-dma-compat.h is removed and so instead of
calling pci_set_dma_mask and pci_set_consistent_dma_mask, call
dma_set_mask and dma_set_coherent_mask.
Change-Id: I91cbe8700b8f165c1140d015c28b1c34d3ea99bd
CRs-Fixed: 3298228
Protect dependency on sec-module-symvers under flag
TARGET_KERNEL_DLKM_SECURE_MSM_OVERRIDE so that platform driver
builds successfully if TARGET_KERNEL_DLKM_SECURE_MSM_OVERRIDE
is set to false.
Change-Id: Ieb53f5a6db7378b2ac77db252343dfedb2b51a8c
CRs-Fixed: 3295225
TZ APIs, to check the secure peripheral state, can return error code
which says feature is not supported. Set a flag if feature not
supported and avoid calling TZ APIs again till next device boot.
Change-Id: I8f83c206b7a876cbaa304b442a9cfe9f6372a04d
CRs-Fixed: 3290183
Some compilers such as clang requires the attribute instead
of just a fallthrough comment when -Wimplicit-fallthrough
is enabled. So replace fallthrough comment with attribute.
Change-Id: I1935bfb325b550fbc6539c58a99b3696fb6cc753
CRs-Fixed: 3295197
In some scenario like ssgtzd get killed, CNE and TZ go out of sync.
Consider a case where TZ notified CNE to enable WLAN HW. Now CNE
will request to CNSS to Enable WLAN HW. At the same time again TZ
notified CNE to Disable WLAN HW but due ssgtzd killed, CNE did not
wait for previous request(sent to CNSS to enable WLAN HW) and immediately
return to TZ. TZ assumes everything is done and change state to secure
mode. Now CNSS act on previous request of enabling WLAN HW but when
when checks the state it get secure mode and fails to enable WLAN
and asserts. Avoid assert in such scenarios.
Change-Id: I85f63258ff55a44cfcc5ebeaa9da9ba19db67780
CRs-Fixed: 3288122
DMS server runs in Modem. When Modem SSR happens dms_del_server
gets called. Even after DMS service disconnected, qmi_txn_wait is
still waiting. Release DMS QMI handle in dms_del_server to cancel
pending transaction.
Change-Id: I06ccfba34269dc51288300aa5fa0326842a09e32
CRs-Fixed: 3288808
According to kernel comment for in_atomic(), it's
incorrect to use it outside core kernel code.
To follow this rule, replace
(irqs_disabled() || in_atomic()) with (!preemptible())
when getting GFP flags.
Change-Id: I7cdb28a7f12ffd60216c7bc1921a277de6113cb5
CRs-Fixed: 3273779
As per implementation of might_sleep(), rcu_read_lock()
nesting depth should be take into consideration too to
figure out whether sleeping is allowable or not.
To make align with it, allocate memory with GFP_ATOMIC
if rcu_read_lock() nesting depth is not zero.
Change-Id: Ib225a33b1a3f37b919e41daf064ce2de44428973
CRs-Fixed: 3271651
Sram dumps are getting dumped only for qca6490 debug build, so
allocate sram dump memory for qca6490 debug build only.
Change-Id: If714b49720c1445ebfc0d4645dde592145b734a8
CRs-Fixed: 3256709
PCIe gen switch via debugfs is allowed only for QCA6490. Remove check
on QCA6490 and instead allow PCIe gen switch based on firmware
capability exchange.
Change-Id: Ib17c54a6c17a2b87d01a877b057495debec704f6
CRs-Fixed: 3260767
When DRV is disabled during use, MHI satellite is still enabled and
is causing timeout when suspend occurs again. Hence, set base to 0
for MHI satellite when DRV is disabled in order to disable it.
Change-Id: I68315cc102884a33b2ba92753f21af2e59b6b466
CRs-Fixed: 3256095
If Device boots up in secure mode, CNSS defers PCI enumeration,
calibration and host driver registration. When secure mode exits
host driver gets notified from CTRL_PARAM and calls PLD API to
perform previously deferred operations and enable WLAN HW. This
can take some seconds and by the time again Secure mode can enter,
disable WLAN and access controlled by TZ.
Now Calibration completes and CNSS receives CAL_DONE indication.
As part of CAL_DONE when CNSS try to power off WLAN access WLAN_EN
it results in NOC error.
One more scenario, where CNSS can access WLAN_EN when WLAN HW
is disabled by TZ, could be when QMI message times out. Consider
secure mode is entering as part of CNSS will to IDLE shutdown.
During IDLE shutdown while sending MODE_OFF QMI message to FW
it might wait for 10 seconds if FW does not respond. But TZ has
timeout of 5 sec if framework does not respond in 5 Sec TZ will
disable WLAN_EN and access control it. Now when after QMI timedout
when try to access WLAN_EN it results in NOC error.
Check secure peripheral state before updating WLAN_EN and maintain
correct driver state in such scenario.
Change-Id: I4a0892f02edb42496b9633d2d33ded26cbc08707
CRs-Fixed: 3247847