提交图

103 次代码提交

作者 SHA1 备注 提交日期
Jiani Liu
b458d07087 cnss2: Add wlan PCIe switch property
Add wlan dts property qcom,pcie_switch_type to mark the wlan chip
is attached on the PCIe switch NTN3. If it's PCIE_SWITCH_NTN3, cnss
driver will enable/disable accordingly PCIe switch dsp link when
power on and shutdown wlan chip.

Change-Id: I48bb56879d5c00f05d0b4e62888027c435f861ee
CRs-Fixed: 3878342
2024-08-06 16:17:33 -07:00
Shashank Reddy Vulupala
f69aced6b8 icnss2: Update ccflags in Makefile
Add -Wmissing-prototypes ccflag for platform driver.

Change-Id: Ia375eae383fa64d0f477f3a1e2c4444ff2884ef7
CRs-Fixed: 3844455
2024-08-01 03:11:00 -07:00
Anuj Khera
acef017b76 cnss2: Add support to check if IPA and WLAN share common dma pool
Add support to check if IPA and WLAN share a common dma pool
and based on that take descision to map the rx buffers or not
in IPA use case scenarios

Change-Id: I5d684db1cffc9f04b962cf7bdf0305b7d5e1df23
CRs-Fixed: 3878739
2024-07-25 16:38:52 -07:00
Nijun Gong
bbf4e9cd00 cnss2: wait and cancel dms work before dms deinit
During cnss unload or error quit, cnss_dms_deinit() is called to
perform dms client deinit. When dms sever quit, modem also send event
to cnss to schedule dms client restart with dms_del_server(). The two
processes are asynchronous so qmi_handle_release() may be entered
twice and cause qmi->sock to be used after free.

To avoid this race condition, call cnss_cancel_dms_work() before
cnss_dms_deinit() to guarantee the two processes not run concurrently.

Change-Id: I291c1d0bdead190549dcbbb2c4b7aa65a68196d7
CRs-Fixed: 3875961
2024-07-25 04:09:49 -07:00
Jayachandran Sreekumaran
92d5d3faf6 cnss2: dump_enabled need to be checked before invoking qcom_dump
Dump_enabled need to be checked before invoking qcom_dump for
pushing the Wlan FW dump to file system. Otherwise SSR gets stuck.

CRs-Fixed: 3805707
Change-Id: I7bd5d0579f71c1b3fa88fc41cd274bc8f432dab5
2024-05-07 06:47:47 -07:00
Nirav Shah
085c1c4748 cnss2: Add support for async data QMI indication
Add support for async data QMI indication from
firmware.

Change-Id: I957e5b219d19f7a531dd25133a05da64857d068d
CRs-Fixed: 3782100
2024-04-20 09:12:59 -07:00
Yu Ouyang
e2eff914bc cnss2: Avoid to call NULL plat_env
For dual chip solution, first chip may fail to probe because of pcie
driver is not ready. During second chip probing, first chip may retry
to probe. So, second chip may set/get plat_env[0], first chip may
set/get plat_env[1].

If sencond chip not attached, plat_env[0] will be cleaned. When
cnss_pci_probe() is called by first chip, cnss_get_plat_priv_by_rc_num()
will call plat_env[0]. However it is already NULL.

Change-Id: Ib959b1a524bf777fc6a826b2771611cb28b8cb99
CRs-Fixed: 3778085
2024-04-17 00:02:46 -07:00
Yu Wang
6d219d7a90 cnss2: modify the checking for Secure HW feature disabled case
qcom_smem_get() returns 'ERR_PTR(ENODEV)' when Secure HW feature
is not enabled (related kernel config: CONFIG_QCOM_SMEM), add
the checking for this case.

Change-Id: Id3c6f8407a4eb4bc2124014503cc50bb99e90235
CRs-Fixed: 3769852
2024-03-27 03:10:17 -07:00
Yeshwanth Sriram Guntuka
e488d6bdfb cnss2: Add support to determine Audio shared IOMMU group
Add support to determine if CNSS and Audio share
IOMMU group and do iommu_map/unmap only in the
case of distinct iommu groups for direct link
datapath.

CRs-Fixed: 3714345
Change-Id: I6134e9d732052fd492e0f20d538e86ba96c14c4d
2024-02-26 04:21:10 -08:00
Naman Padhiar
e38803e8a0 Revert "cnss2: loads different fw binary per running mode"
This reverts Change-Id I848309440fdffd6517463e18190c03c1b7ed9269.

Reason for revert: Separate FW Binary not required

Change-Id: Ib694d38922f81895ce6bc01f4e38f95813625730
CRs-Fixed: 3726340
2024-02-10 11:46:13 -08:00
Karthik Kantamneni
0df07c1ee9 cnss2: Add API to get Audio dev direct link cap
Currently cnss_get_fw_cap is checking both FW and Audio cap
to enable direct link, add new API to check audio node available
for direct link. So that this API can be queried when direct link
is being used.

Change-Id: Ic2032b338da74021f2b6c483c9480f185554f2d5
CRs-Fixed: 3711887
2024-01-31 11:57:58 -08:00
Huashan Qu
b718fd7127 cnss2: Print address range for minidump region
Print address range for minidump region when
CONFIG_QCOM_MINIDUMP is not enabled.

Change-Id: I7d162bf4b7a057d806df07eda47740bf2471ba1b
CRs-Fixed: 3704383
2024-01-19 03:25:01 -08:00
Naman Padhiar
f140232c39 cnss2: Fix DEV SOL interrupt issue
Fix misfiring of DEV SOL interrupt during enable_irq().
Ignore DEV SOL interrupt in case of device power off
as it is expected as part of off sequence.
In case of HOST triggered recovery, CNSS driver
tries to put device to RDDM first using MHI_SYS_ERR
and HOST_RESET_REQUEST if MHI_SYS_ERR fails. With
SOL enable, replace HOST_RESET_REQUEST with HOST_SOL.

Change-Id: I90c1a2dbd68c4c9c2e56d87dd1304a6ab0db53eb
CRs-Fixed: 3590408
2024-01-12 16:31:27 -08:00
Lin Bai
5a888e90a2 cnss2: Add segment CALDB support flag in FW Cap
When FW supports segment CALDB memory in memory request,
it sets CALDB_SEG_DDR in its capability which is sent to
host by Target Cap QMI message.

Change-Id: I84b62336ea2616cb2d663c604ac4af8a8d9966b8
CRs-Fixed: 3681105
2023-12-21 00:01:02 -08:00
Prateek Patil
dc9f45faee cnss2: Send QMI message to download TME binaries
Send QMI message with SEC, RPR and DPR file information to WLAN FW, to
download TME binaries (sec, rpr, dpr files)

Change-Id: I0a4ab7ab127d493ef62d14658be2aa08b7d41606
CRs-Fixed: 3684131
2023-12-20 05:31:07 -08:00
Yeshwanth Sriram Guntuka
42fc0fe2e5 cnss2: Add support to get LPASS-FW shared memory info
Add support for host driver to get LPASS-FW shared
memory information in the context of direct link
use case.

CRs-Fixed: 3667595
Change-Id: I8254919814d578c9f28084db52a22f8cb9779112
2023-11-27 04:41:54 -08:00
Meng Yuan
6bb3f633f3 cnss2: Add PCIe's link resume failed event
Add BUS_EVENT_PCIE_LINK_RESUME_FAIL type to bus event type.

Change-Id: If13f53ed9f2c6968eed5e11343cc493e740d82bd
CRs-Fixed: 3646812
2023-11-04 04:41:19 -07:00
Naman Padhiar
d897e63881 cnss2: Remove wlan-connection-roaming INI download
Remove QMI message to download wlan-connection-roaming.ini
file to FW. This way, for all the OEMs, we would not download
any of this file. Separate change will be raised to download this
files with invalid character check in CNSS2 platform driver and
maintained as hot fix.

Change-Id: Id9f990751d30f28d2d1aac180c24cb6d673e1205
CRs-Fixed: 3640676
2023-10-20 03:45:02 -07:00
Yu Wang
da6fe13a18 cnss2: free host ramdump device properly
As per description of device_add(), never directly free
a device after calling device_add(), should always
use put_device() to give up the reference and free it
in callback function 'release' if it's required.

Change-Id: I5b07b49bcf2e2af6994c05ef038deebc92a825b7
CRs-Fixed: 3637349
2023-10-17 21:38:54 -07:00
Amit Mehta
600b1dfc1c cnss2: Add DP rings to host SSR dump
Add DP rings to host SSR dump.

Change-Id: I6e2462085ee41e60cfd2e5772f03d081af86617f
CRs-Fixed: 3604908
2023-09-20 07:11:26 -07:00
Mohammed Ahmed
e1dd6c2585 cnss2: cnss changes for sun compilation
Current code has compilation errors
when compiling for sun. sched_clock()
was moved to clock.h, and iommu_map API
was changed with new sun kernel. Fix
this by updating code for new kernel
apis.

Change-Id: I77029fcc74142f3f650dc289c8d19c121eba6445
CRs-Fixed: 3603129
2023-09-14 15:14:49 -07:00
Alan Chen
696ac36d11 cnss2: Create new infrastructure for removing sysfs group
Up until kernel 6.1, devm_device_remove_group() was used when
removing sysfs group. From kernel 6.2 onwards,
devm_device_remove_group() is no longer supported. Thus, create
new functions that replicate original functionality of
devm_device_remove_group().

Change-Id: If3a7b380a03eec5a3f918b5a0813830c3136fd1f
CRs-Fixed: 3601923
2023-09-02 09:03:06 -07:00
Naman Padhiar
e9066ddd35 cnss2: Add SMEM based Secure Peripheral check
Check secure peripheral HW state using SMEM APIs instead of
SCM APIs.

Change-Id: I3e652859189221d3b9d26bd2e71e254edf6843b0
CRs-Fixed: 3601121
2023-08-31 21:46:39 -07:00
Naman Padhiar
6f7e807fb9 cnss2: Move repetitive logs to cnss-long IPC logs
Move trivial repetitive logs from cnss IPC logs to
cnss-long IPC logs. This will reduce the chances of
losing important logs required for debug.

Change-Id: I9cfe76614603d5fb9b3e5d4a2f062abbb7fa754f
CRs-Fixed: 3580107
2023-08-09 01:01:30 -07:00
Zhiwei Yang
f0a7661f00 cnss2: Dump event desc history when SSR occurs
Dump hif_event_desc_history and hif_ce_desc_history_buff
when SSR occurs.

Change-Id: I3c115e1d6b35107e4f97f442a51bd50f50bd79ae
CRs-Fixed: 3553092
2023-07-23 17:09:05 -07:00
Naman Padhiar
3e85d50d6d cnss2: Correctly check for WCNSS_MEM_PRE_ALLOC macro
After CNSS2 switched to Bazel based compilation, conditional
compilation macros became same as configs and are enabled
directly from defconfig. Fix macro check in the code for
both 'y' or 'm' to enable code based on the that.

Change-Id: I12ca87c851a7b47af0255716ce1b9f59ad2eb70a
CRs-Fixed: 3553530
2023-07-12 15:39:07 -07:00
Lin Bai
02c2d4f750 cnss2: Provide platform name if it is required
Provide platform name in host_cap message if
property platform-name-required specified in DTS.

Current platform name is same as device's model name.

Change-id: I8d427602bfc7e6bb5d732fa3e29ff66c965e153b
CRs-Fixed: 3540641
2023-07-05 17:19:30 -07:00
Naman Padhiar
bdd3c6bf67 cnss2: Send QMI message to download TME-L patch
Send QMI message with TME-L patch information to WLAN FW, to
download TME-L patch.

Change-Id: Ieae07c0f761ada45ffcb990b1412654b9c6862b1
CRs-Fixed: 3521187
2023-07-03 09:34:38 -07:00
Shailendra Singh
6ce40d5c60 cnss2: Update time sync period based on tsf sync start/stop
Add cnss_update_time_sync_period and cnss_reset_time_sync_period to
update time sync period vote sent from wlan driver based on use-case.
CNSS driver stores both wlan driver and sys config time sync period
value and will apply the minimum value of all votes.

Change-Id: I46ad2866bd70aefe121c8a68a9c869e75ffd8345
CRs-Fixed: 3502060
2023-06-07 11:12:47 -07:00
Chaoli Zhou
7cd9a66ccc cnss2: Change log level for non-critical cases
Change log level from cnss_pr_err to cnss_pr_vdbg for
some non-critial cases.

Change-Id: I66b16afe5327bab77d52a1ba1b5d72fb88c71715
CRs-Fixed: 3509919
2023-06-01 18:16:16 -07:00
Alan Chen
f4e0145655 cnss2: Add AUX UC download functionality
Add support for AUX UC download functionality if aux support is
indicated by both host and fw.

Change-Id: I3bfbebbb5cdfbbaa350a34378ab2f0809f27affb
CRs-Fixed: 3402104
2023-05-25 19:54:56 -07:00
Sandeep Singh
c32955295b cnss2: move reboot notifier registration after initializing completion
Currently, power_up_complete and cal_complete are getting initialized
after registering for cnss reboot notifier and in cnss reboot
notifier callback we are completing power_up_complete and cal_complete.
In certain cases cnss_reboot_notifier cb getting called before
power_up_complete and cal_complete are getting initialized which
is leading to crash. To avoid these crashes move reboot notifier
registration after initializing completion variables.

Change-Id: Iaf9e925489f4faea621ea40836dcd7330c7b98d2
CRs-Fixed: 3503651
2023-05-22 15:02:57 -07:00
Rajesh Chauhan
90e0212ecc cnss2: Add support for direct QMP to communicate with AOP
Add support for direct QMP to communicate with AOP. There
are two ways to communicate with AOP: mailbox, and direct
QMP. Based on property set in the device tree use either
direct QMP or mailbox to send messages to AOP.

Change-Id: I9fc24f8a483abb3084cda4d85acf2d53e43d9ad8
CRs-Fixed: 3488507
2023-05-11 18:02:05 -07:00
Sandeep Singh
ff9d11362f cnss_prealloc: add wrapper APIs if MEM_PRE_ALLOC flag not enabled
Add wrapper api to avoid compilaton failure if
CONFIG_WCNSS_MEM_PRE_ALLOC flag is not enabled.

Change-Id: Ic0625d68f587c79f38f33495b53645f1d7582144
CRs-Fixed: 3492092
2023-05-11 15:36:42 -07:00
Naman Padhiar
a232234d41 cnss2: Fix MHI state mismatch for MHI INIT
MHI INIT called during host driver registration leads to MHI state
mismatch because MHI is already in INIT state due to power up of
device as part of ongoing self recovery.
To fix this issue, avoid powering up device during recovery if host
driver is not registered. Device would be powered up later during
host driver registration.

Change-Id: I534dfc0e389ba97a6e2c4869d42be5ecff9609b3
CRs-Fixed: 3476947
2023-05-11 15:36:41 -07:00
Yu Wang
b26c26e7b0 cnss2: notify WLAN driver of system reboot
Notify WLAN driver of system reboot to avoid state
mismatch between cnss driver and WLAN driver.

Change-Id: I03e867484ee450c796c0dfabac7ed550a1d0337c
CRs-Fixed: 3467387
2023-04-28 19:03:31 -07:00
Sandeep Singh
97303bf330 cnss_prealloc: update prealloc mem pool based on device type
Update prealloc mem pool based on device type.

Change-Id: Ic7fc2145a0039aa55643672b8e125857c096a3ee
CRs-Fixed: 3459351
2023-04-25 23:46:44 -07:00
Yu Wang
21bd3e2016 cnss2: wait for device power up although idle restart is interrupted
When the waits on CNSS_DRIVER_EVENT_IDLE_RESTART is
interrupted by a kill signal, the device power up
is still in progress, it needs to wait for power
up complete to ensure synchronization.

Change-Id: I1f350cf70537257d8edbd5d31378d766f924915c
CRs-Fixed: 3422562
2023-04-24 00:10:45 -07:00
Alan Chen
7793f64f52 cnss2: Add 3 more log buffer regions to ssr driver logs
Add support to include hif_ce_desc_history, hif_ce_desc_history_buff,
and hang_event_data log buffer regions in ssr host dump collection.

Change-Id: I650b94973b8b12cb546a1bc2d121ee319a182767
CRs-Fixed: 3455747
2023-04-21 08:16:54 -07:00
Chaoli Zhou
03a337ba78 cnss2: Support enable 32k sleep clk from cnss2
Add one new device tree config item "qcom,sleep-clk-supported"
to support enable 32k internal sleep clock in case it has no
external 32k clk attached in wlan chipset HW. Like qca6390
on some auto platform, host need explicitly tell firmware
to use internal sleep clock, otherwise it will cause LMAC
ps failure.

Change-Id: I52f5d332a912235596eb127ab8e4660355988038
CRs-Fixed: 3448595
2023-04-14 11:58:40 -07:00
Meng Yuan
8eb1e1e993 cnss2: fix the issue that NULL pointer may be referenced
Pointer 'plat_priv' returned from call to function
'cnss_get_plat_priv' may be NULL and may be passed to
another function that may reference it.

Change-Id: I5f8bad5efd0b728127f6f257882693a042d78223
CRs-Fixed: 3428657
2023-04-11 06:26:10 -07:00
Chaoli Zhou
bd49da5f3e cnss2: Support disable pcie bw scalling from cnss2 side
Add new "qcom,no-bwscale" under child device node to
indicate it want to disable bw scalling.

And the background is like HSP, it has stability issue
with some specific pcie cable with gen3, so it will
negotiate with RC side to change from gen3 to gen2
with MHI_ER_BW_SCALE_ELEMENT_TYPE event, which will
impact all the platform that want to keep use gen3.
So add this device tree config item to skip the link
speed negotiation.

Change-Id: I4a8d94a50dd740b84c3eeac435c5a19098b79ad9
CRs-Fixed: 3435289
2023-04-07 18:28:25 -07:00
Wu Gao
3ef55a9a08 cnss2: Add CONFIG_DISABLE_CNSS_SRAM_DUMP
It costs 4M when loading cnss2, if device id is QCA6490 and enabled
CONFIG_CNSS2_DEBUG. Which is big memory consumption for low rate issue
debugging. So add CONFIG_DISABLE_CNSS_SRAM_DUMP to disable sram_dump.

Change-Id: Iacf338a3cc8f1583e16034a9873029a450fd254a
CRs-Fixed: 3441274
2023-04-06 19:13:16 -07:00
Alan Chen
ddbe3d0e4e cnss2: Use proper enum type for local iterator
Change type of local iterator for finding registered log
buffer region to enum.

Change-Id: Iffbde0921fa9d9c9ad15ce890af5c12b28ecc8e7
CRs-Fixed: 3436059
2023-04-03 18:26:04 -07:00
Alan Chen
31dbde2074 cnss2: Add null check for allocated segment
Currently, cnss_do_host_ramdump() is allocating memory for a new segment
to be added to list to be written to ramdump, but it is not accounting
for the case that the kcalloc call returns NULL for the segment pointer.
Thus, add a null check after memory is allocated for the segment.

Change-Id: I80b68f699a44800c19a734c0be7e231726368f68
CRs-Fixed: 3431776
2023-03-16 04:54:33 -07:00
Gangadhar Kavalastramath
4f03c58310 cnss2: Add support for QCN7605
Add support for QCN7605 in cnss2 driver

Change-Id: I529d76f8f6fa6eeea2117630b2a1e9d05ce5f5b4
CRs-Fixed: 3359985
2023-03-07 18:28:55 -08:00
Naman Padhiar
97d02063a9 cnss2: Avoid IDLE Shutdown during recovery
There can be scenario where CNSS driver receives
IDLE shutdown request from WLAN Host driver when
SSR/Recovery is in progress. In such case return
-EBUSY to Host driver and avoid doing IDLE Shutdown.

Change-Id: I68bea49d23e741f405acc1f2c9133cb7452d7952
CRs-Fixed: 3418977
2023-03-03 15:24:27 -08:00
Anuj Khera
640497899b cnss2: Send AOP msg to disable WLAN PDC in case of specific Board ID
Send the AOP msg to disable WLAN PDC for boards which support
on chip PMIC.

Change-Id: I572799a727000b3f124f01919c013c637dee0e10
CRs-Fixed: 3386507
2023-02-13 15:13:38 -08:00
Gangadhar Kavalastramath
6c09e62157 cnss2: Add code changes to support thermal mitigation
Add cnss2 code changes to register with thermal framework to support
thermal mitigation.

Change-Id: I9d427603bfc7e6bb5d732fa3e29ff66c965e153b
CRs-Fixed: 3386762
2023-02-06 00:02:18 -08:00
Chaoli Zhou
f2346285bc cnss2: Support dual wlan cards managed by cnss2 platform driver
Currently, the cnss2 platform driver just can support
one wlan device attached, so do the following changes
to cover dual wlan card attach case. Firstly, delay
the second device go to pcie link suspend and power
off state to make sure it really finished the pcie
enumeration. Then pcie enumeration succeeds with
multi-devices. Secondly, supporting to write the qrtr
node instance id to PCIE register for wlan fw reading,
which can fix qmi message exchange failure if active
two Hastings devices. Thirdly, change the usage of
plat_env to support dual Hastings.

Change-Id: Ica41a23d4e983b91c0ff1b4e76b380803fb877ab
2023-01-31 16:53:31 +08:00