Commit Graph

330 Commits

Author SHA1 Message Date
Linux Build Service Account
7a9117a28d Merge 41022800bc on remote branch
Change-Id: I0b533918eae5cd0b7d9eef89f3c18fe212120f8c
2023-10-20 04:22:37 -07:00
Sandeep Singh
41022800bc icnss2: Add two vectors for DP in wcn6450 msi config
Add two vectors for DP in wcn6450 msi config which will
be used in monitor mode and increase number of ce interrupts
to 12 for wcn6450.

Change-Id: I386c98310441fd7c4f9dc8b4cfc7f2da727fe35e
CRs-Fixed: 3629007
2023-10-04 16:14:52 -07:00
Linux Build Service Account
ed21b03539 Merge a883a8f321 on remote branch
Change-Id: I7f8c32ad85fba8a8633c7b254787493477da6df3
2023-10-03 13:05:59 -07:00
Naman Padhiar
b031b47122 cnss2: Release rddm_complete wait during default recovery
Currently Host driver calls cnss_force_collect_rddm API
to trigger RDDM and wait for dump collection. If device
fails to move to RDDM, CNSS driver initiate DEFAULT recovery
(which is recovery without RDDM dump collection) and return
failure to Host driver. Host driver sees error and again try
recovery which results in double recovery.
To avoid this issue, return success to Host driver if
CNSS driver has already initiated the DEFAULT recovery
and release rddm_complete wait event for DEFAULT recovery
cases also.

Change-Id: Ib4b324704d15b40ec98985745b1981522b3b4f2d
CRs-Fixed: 3627928
2023-09-29 23:47:19 -07:00
Naman Padhiar
b791c15d0c cnss2: Optimize link down recovery sequence
Remove unwanted delay from PCIe link down recovery sequence
1. Wait for wake event from PCIe driver instead of hardcoded wait.
2. After link recovers, wait for device to move to RDDM mode
   instead of starting rddm timer.
3. If device fails to move to RDDM, assert HOST SOL and initiate
   side band recovery.

Change-Id: I5a4096ac781dd8f5011b07b0ffb669815a968570
CRs-Fixed: 3590419
2023-09-24 19:07:57 -07:00
Linux Build Service Account
22989e7675 Merge 696ac36d11 on remote branch
Change-Id: I30f34f3e3a1fd7959df3e0e6366a96a447a0e724
2023-09-21 07:56:10 -07:00
Sai Kumar Kunchala
d0fbd9bae5 cnss2: enable cnss2 for Niobe target
- Add defconfigs for consoilidated and GKI variants.
 - Add Niobe target to wlan bazel config.

Change-Id: Id6f57de324bf1c89a521236373cdbc61e453b492
CRs-Fixed: 3614358
2023-09-20 20:10:50 -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
Naman Padhiar
a883a8f321 cnss2: Protect PCI bus resume with mutex lock
Race condition seen between WAKE interrupt handler
and HOST triggered recovery. Due to the race PCI
link up is called back to back. Protect PCI bus
resume with bus_lock mutex.

Change-Id: Ifc140921bdf803bc2d46365b4e5a59cba34ee715
CRs-Fixed: 3614970
2023-09-16 14:13:57 -07:00
Sandeep Singh
328d2fa04f icnss2: use firmware_request_nowarn api to load qdsss/bdf file
Use firmware_request_nowarn api to load qdsss/bdf file instead
of request_firmware api. Firmware_request_nowarn doesn't produce
warning messages.

Change-Id: Ia8a2881cdd6eca43396cda0e05b0c75dc3d21610
CRs-Fixed: 3616145
2023-09-15 10:53:09 -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
Mohammed Ahmed
e144f654b8 cnss2: Add config files for sun compilation
Current code does not contain config files
required for sun compilation. Fix this
by adding sun config files.

Change-Id: I130e6d9f16e36335a0acc52f98715cab622ef8b4
CRs-Fixed: 3603141
2023-09-14 15:14:48 -07:00
Nijun Gong
e921bad259 cnss2: restore to gen2 speed for qca6490
There is known pcie linkdown issue for qca6490 if gen3 speed is used.
Previous solution is to downgrade to gen2 before enumeration, but it
doesn't work if platform support multiple wlan chips where device id
can't be determined until enumeration success.

The fix is:
1, Enumerate all devices with gen1 speed
2, When enumeration done, restore to gen2 if device is qca6490

Change-Id: I55d554c4dc7d01ed82fffe79f666b340b1004765
CRs-Fixed: 3612384
2023-09-13 04:22:26 -07:00
Sandeep Singh
111da9be47 icnss2: enable icnss2 compilation for pineapple
Enable icnss2 compilation for pineapple and remove
unused configs for icnss2.

Change-Id: I500cd3dc2ea9f846f80bf1e57427106df4ae2bbc
CRs-Fixed: 3600796
2023-09-09 09:43:00 -07:00
Nijun Gong
744c0f19d7 cnss2: use disable_irq_nosync for rome linkdown
When PCIE linkdown happen, IRQ handler will disable IRQ line then
trigger SSR. disable_irq() is used but it introduce sleep in IRQ
context(unexpected). Crash will happen if CONFIG_SCHED_WALT is set:
	android_rvh_schedule_bug+0x4/0x8
	__might_sleep+0x50/0x84
	synchronize_irq+0x48/0xc4
	disable_irq+0x70/0x9c
	cnss_pci_handle_linkdown+0x1a8/0x1c0 [cnss2]
	cnss_pci_event_cb+0x148/0x348 [cnss2]
	msm_pcie_notify_client+0x110/0x180
	msm_pcie_handle_linkdown+0x2d8/0x2f8
	handle_global_irq+0x464/0x5dc

To avoid this issue, should use disable_irq_nosync(), which doesn't
wait IRQ handler to finish. It should introduce no side effect, as
the whole device will be restated later by SSR.

Change-Id: I5ec96d41337a14280333ab9fea0c1f6132a532af
CRs-Fixed: 3548604
2023-09-08 04:11:00 -07:00
Linux Build Service Account
d1685f0347 Merge e44a22665b on remote branch
Change-Id: Iec6ff7989e967830852594941c7fdb0e4ed69461
2023-09-05 09:06:24 -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
Prateek Patil
5d5c769c28 cnss2: include qcom_aoss.h file at correct place
There may be multiple time inclusion of inline definition of the
APIs defined in the header file qcom_aoss.h if config
CONFIG_QCOM_AOSS_QMP is disabled for underlying target.
This may result in linking error. Move the header file to the correct
place in power.c.

Change-Id: I5c79eff3be4c758db1ab313843b36a02ecccbef9
CRs-Fixed: 3603827
2023-09-01 07:02:24 -07:00
Balaji Pothunoori
2f4117dcd2 icnss2: send ICNSS_UEVENT_FW_DOWN uevent instead ICNSS_UEVENT_FW_CRASH
PD restart triggered as part of host based SSR triggered,
this will call PLD shutdown and HDD shutdown.
While processing HDD shutdown host driver check CDS recovering state
and then ASSERT if it is not set.
To Avoid this ASSERT, fix introduced to set CDS recovering by
sending ICNSS_UEVENT_FW_DOWN uevent to Host driver during firmware
crash.

Change-Id: I4f06404b02bb7ce0018b3f8e1e5253e0ba155095
CRs-Fixed: 3595285
2023-08-31 21:46:40 -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
Balaji Pothunoori
89f8f5e0b2 icnss2: support to add new flag rproc fw download
Currently wpss_supported variable which helps to download
wlan FW binary using rproc channel and also includes SMP2P
communication between platform and FW.
Currently SMP2P is not required for QCS405 target, Hence
introduced rproc_fw_download to download only wlan FW via rproc.

Change-Id: If230e05fc6098d4ea017d8af74b2b1c7a7afce25
CRs-Fixed: 3596283
2023-08-31 21:46:39 -07:00
Balaji Pothunoori
89ebfe7d2c icnss2: Enable icnss2 module for qcs405 target
This change is to enable icnss2 module for qcs405
target.

Change-Id: I9c7565b44a72145e11178fe360f413ff578142bb
CRs-Fixed: 3551635
2023-08-31 21:46:39 -07:00
Prateek Patil
e44a22665b icnss2: include qcom_aoss.h file at correct place
For bengal target, getting compilation error due to
Change-Id: Ifc5ff95208e79280543471d56fdb0a87ca973cf5, resulting in
multiple time inclusion of inline definition of the APIs defined in
the header file qcom_aoss.h. This is resulting in linking error.
Move the header file to the correct place in power.c.

Change-Id: I5a0f83fa954feb4656af09527c090f8e7d96bab8
CRs-Fixed: 3595936
2023-08-28 21:12:28 -07:00
Linux Build Service Account
bb158b3f8f Merge 6f7e807fb9 on remote branch
Change-Id: Iafce56bfcef93403a16ee4faf344a42c8ebb90ef
2023-08-24 06:23:45 -07:00
Reut Zysman
0efc799a87 cnss2: Add securemsm-kernel uapi path
Add securemsm-kernel uapi path to
makefile, since smcinvoke.h is moving.

Change-Id: Ic44f31e2050bfd09400da312250029ab732ff0e1
CRs-Fixed: 3562598
2023-08-10 11:18:15 -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
Linux Build Service Account
ba6587aeaf Merge 882ac969c2 on remote branch
Change-Id: I4a68b7c4b35ec36379c318f33fcb0753abc5d209
2023-08-07 19:55:07 -07:00
Sandeep Singh
87ee900083 icnss2: add blair config files to enable bazel compilation
Add blair config files to enable bazel compilation.

Change-Id: If22e082f51a53f359d760f70bde6d89189e12271
CRs-Fixed: 3578579
2023-08-03 16:28:08 -07:00
Sandeep Singh
dca762d821 cnss2: add support to enable wlan module based on target
Add support to enable wlan module based on target.

Change-Id: I43e6adce83ec0657604a00c953a18bb675f05a8c
CRs-Fixed: 3577272
2023-08-03 00:14:20 -07:00
Linux Image Build Automation
3c443cad7c Revert "cnss2: Add logs to identify request_firmware issue"
This reverts commit 5ca1ebc32b.

Change-Id: I565f00a1b99613c0d614097215b3ab64e3d4fb21
2023-07-31 12:50:30 -07:00
Prateek Patil
882ac969c2 icnss2: 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: Iae8302fd2e40181a192a2c9afaebdb807b7cf1c3
CRs-Fixed: 3571108
2023-07-31 15:17:01 +05:30
Naman Padhiar
5ca1ebc32b cnss2: Add logs to identify request_firmware issue
Add logs to identify request_firmware issue while downloading
files to WLAN FW.

Change-Id: Ibea603306a029aa7f7cf8e91290870dddb78f0b3
CRs-Fixed: 3567760
2023-07-27 15:15:47 -07:00
gaolez
ac9fb6837b cnss2: Refine the pci power setting log
In current implementation, the error log not record the
return value of setting pci power function, with this return
value we can know the reason of why setting pci power failed.

Change-Id: Icf1fdba16faf539334704ca1f8ce24fecd49aa94
2023-07-24 15:51:36 -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
785ec89f2a cnss2: Add logs to identify request_firmware issue
Add logs to identify request_firmware issue while downloading
files to WLAN FW.

Change-Id: Iff09261513650ff3cd61381453c30616fd9b087a
CRs-Fixed: 3567760
2023-07-22 06:40:28 -07:00
Yu Ouyang
7de707a939 cnss2: Trigger pci link to retrain
When feature CNSS2_CONDITIONAL_POWEROFF enabled, wlan chip HST and
HSP will not power off in cnss probe. PCI link will not be triggered
to retrain once CNSS2_ENUM_WITH_LOW_SPEED enabled.

So, add API cnss_pci_link_retrain_trigger() to trigger pci link retrain
when HST and HSP not power off.

Change-Id: I2ba44837a03b09b1ef3cd0c23a780b89ff837740
CRs-Fixed: 3491396
2023-07-21 13:39:53 -07:00
Naman Padhiar
4561632548 cnss2: Complete power_up event on probe failure
Complete power_up event on probe failure to avoid timeout while
waiting for this event during unregister of host driver.

Change-Id: Ie262305ef960ab40cd38b4a695d409eb36fcf0d7
CRs-Fixed: 3565756
2023-07-21 01:16:38 -07:00
Linux Build Service Account
85bf216799 Merge c4bc8cea33 on remote branch
Change-Id: I2dd89ba303468c24ac926af4850cf6062bceac62
2023-07-19 16:33:21 -07:00
Naman Padhiar
1eb85173ef cnss2: Enable debug config only for debug build
Remove CONFIG_CNSS2_DEBUG from GKI config so that debug
config get enabled only for debug builds.

Change-Id: Iebe86b3b3969d7de5d5f65c372f7e6d6aa7aa126
CRs-Fixed: 3565145
2023-07-19 23:14:24 +05:30
Linux Image Build Automation
7d79a3f178 Revert "cnss2: Resume PCI bus before reading registers"
This reverts commit a633e6ce82.

Change-Id: I0947e545338b3159db63fc5482ccd8b709166785
2023-07-18 15:47:40 -07:00
Linux Image Build Automation
1e5fc2a58e Revert "cnss2: Correctly check for WCNSS_MEM_PRE_ALLOC macro"
This reverts commit da084bcb06.

Change-Id: Ib46c33b9ebed28aa6e12d63910ebf05b9009b599
2023-07-18 15:40:13 -07:00
Naman Padhiar
c4bc8cea33 cnss2: Add PCI link info to Host Cap QMI message
PCI link info contains maximum link speed and link width
supported by platform. WLAN FW will use supported link
speed to restrict link speed switch upto maximum
supported speed.

Change-Id: Icdf54c8729192faf4966514b57bd826f86652065
CRs-Fixed: 3535790
2023-07-14 03:57:54 -07:00
Naman Padhiar
da084bcb06 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: Icd65573b02d95198e26c37ebe4ac93839cf21ad9
CRs-Fixed: 3553530
2023-07-12 20:06:14 -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
Naman Padhiar
a633e6ce82 cnss2: Resume PCI bus before reading registers
In some scenarios, during force FW assert,
cnss_pci_pm_runtime_get_sync might not resume bus.
Make sure PCI bus is resume before accessing.

Change-Id: I4701adef1f0d30852edb8656931db315bebfa3d3
CRs-Fixed: 3540601
2023-07-11 15:43:52 -07:00
Naman Padhiar
c727c5eab9 cnss2: Resume PCI bus before reading registers
In some scenarios, during force FW assert,
cnss_pci_pm_runtime_get_sync might not resume bus.
Make sure PCI bus is resume before accessing.

Change-Id: Ic5c17c3385318dbc739358ac7ccdb148aed1052a
CRs-Fixed: 3540601
2023-07-11 06:52:00 -07:00
Li Feng
4a3ea46b17 cnss2: Set irq vector affinity to CPU0 with VT-d disabled
With VT-d disabled on x86 platform, only one pci irq vector is allocated.
Due to the irq is not freed when suspend, the kernel will migrate irq to
CPU0 if it was affine to other CPU and then allocate a new MSI vector,
which cause the issue about no irq handler for vector once resume since
the driver only configure MSI data once during driver loading.

The fix is to set irq vector affinity to CPU0 before calling request_irq
to avoid the irq migration.

Change-Id: Id366e33113089f50899eb3631db66dcde0999d84
CRs-Fixed: 3550165
2023-07-11 06:52:00 -07:00
Linux Build Service Account
84d0a7d5d1 Merge 2ec2768bfc on remote branch
Change-Id: I10b34446fc3d9c813818d1665925a19c0b170891
2023-07-07 15:36:04 -07:00
Sandeep Singh
495980e3ab icnss2: use platform_get_irq api to get irq for wcn6750/wcn6450 target
Use platform_get_irq api to get irq for wcn6750/wcn6450 target
instead of platform_get_resource as in 6.1 kernel implemetation
of platform_get_resource has changed.

Change-Id: Iaef73896dd0db08df3d29f4377c60b57394f3517
CRs-Fixed: 3536604
2023-07-07 11:25:15 -07:00
Naman Padhiar
4d274cd5af cnss2: Download QDSS config file based on build type
Add build type string to file name. "qdss_trace_config_debug_v<n>.cfg"
for debug build and "qdss_trace_config_perf_v<n>.cfg" for perf build.

Change-Id: I349a6524c7040d88d69ac329604ade9b9ba07318
CRs-Fixed: 3548322
2023-07-07 11:25:15 -07:00