커밋 그래프

114 커밋

작성자 SHA1 메시지 날짜
Alan Z. Chen
c532da94b6 cnss2: Remove DIAG related MHI channel configuration for Peach
As DIAG is now deprecated on Peach chipset onwards, create a new
MHI config struct that removes DIAG related channel configuration.
Then, register this new struct for peach chipset onwards.

Change-Id: I1ba1cadaa0d1a022d6c9af6d8ff14942d4f219cf
CRs-Fixed: 3684700
2023-12-22 13:14:05 -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
Prateek Patil
6d5176c254 cnss2: Update TME-L patch name
Update TME-L patch name as per the target version 1.0 and change the
patch file location.

Change-Id: I1e5e8e6ac330a093f61e34029f8aec35fd3f26aa
CRs-Fixed: 3687807
2023-12-17 15:45:14 -08:00
Prateek Patil
36a061b235 cnss2: Add dump collection for CAL memory
Add CNSS_FW_CAL dump segement for dump collection of CAL memory

Change-Id: Ie3d339f3db8898e087d8460d1efb7b9a8f75a13d
CRs-Fixed: 3684125
2023-12-15 09:26:28 -08:00
Prateek Patil
21931a8db7 cnss2: Add PBL error logging on host console
Add PBL error logging on host console and dump SOC reset cause
register and PCIE_PCIE_BHIE_DEBUG_n register

Change-Id: I80ae44354b1efc05ed72f69a7e3ee8d358d840d7
CRs-Fixed: 3661767
2023-11-17 22:27:21 -08:00
Naman Padhiar
0e4171f329 cnss2: Initialize completion event at right place
CNSS2 registers PCI event callback for wake irq from
PCI driver. When callback is called CNSS2 completes
wake_event to notify the waiting threads. Currently,
initialization of wake_event completion is done after
PCI event callback registration causing issue when
PCI even callback for wake irq is called before wake_event
completion could initialize.

Initialize wake_event completion before PCIe event callback
registration.

Change-Id: If8c6ca5a5d5de5fc903b479d6d32ac0e5349f069
CRs-Fixed: 3648865
2023-11-12 15:22:29 -08:00
Yu Ouyang
34e74266d2 cnss2: Genoa window enable bit set wrong
Genoa window enable bit should be set before function writel_relaxed.

Change-Id: I7592e3975fad76c5232377cc51a9c4906a90aab6
CRs-Fixed: 3646876
2023-11-07 05:06:10 -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
Chaoli Zhou
3350d6f679 cnss2: Add logic to support hang data for GNO
Support hang data enabled for genoa.

Change-Id: I93ac07159cddf067aa5f74bd26c9420f48d31710
CRs-Fixed: 3646227
2023-10-26 19:21:40 -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
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
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
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
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
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
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
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
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
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
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
Naman Padhiar
1f5d4ad661 cnss2: Get PM Runtime reference before RDDM trigger
Host triggered force assert can be called asynchronous.
As part of force assert, CNSS dumps few MHI registers and
trigger RDDM asynchronously. There are chances of race between
force assert and runtime suspend.
To fix that take runtime get reference before MHI operations and
runtime put later.

Change-Id: Icef23910587ff280270bdd7c60ad8eba392822e9
CRs-Fixed: 3464127
2023-06-02 16:51:28 -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
Gangadhar Kavalastramath
5eaf0073cc cnss2: Downgrade RC speed to Gen1 for Genoa EP
Some platform PCIe RC impedance can't achieve the target defined in spec.
It will result to Genoa card link down. To WA the issue, downgrade RC speed
to Gen1 for auto Genoa EP. Because the linkdown issue may happen during
enum, and before enumunation we do not know EP device ID, so set init
speed to Gen1, and then restore speed to default for others wifi chip.

The change does not affect Genoa throughput, because Gen1 speed is enough
for Genoa.

Change-Id: Iffdbf8b98a82c200faf11edcdd180213366ed6ca
CRs-Fixed: 3479848
2023-05-25 19:54:57 -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
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
Naman Padhiar
693e91a938 cnss2: Add support for MSIX interrupts
Read MSI-X address from device tree file and initialize
MSI-X address and data to support MSI-X interrupts.

Change-Id: I7cc43ca4d3e4c937f09facf12dd02437ddc2e039
CRs-Fixed: 3488821
2023-05-11 13:09:23 -07:00
Sandeep Singh
2dee0837c9 cnss2: record timestamps in smmu fault cb handler
Record timestamps in smmu fault cb handler.

Change-Id: I96042ffdc81fcca8069d16bf74899412cf04183c
CRs-Fixed: 3487738
2023-05-08 20:37:48 -07:00
Will Huang
33dff49a43 cnss2: Change AFC data pointer from char* to const uint8_t*
API cnss_send_buffer_to_afcmem pass AFC data from driver to target
which is not changed in platform driver, and it is pass-through byte
stream for platform driver.

Change the AFC data pointer in API from char* to const uint8_t*.

Change-Id: Ib492dbcf028776858926d8a3e11edc528566fac1
CRs-Fixed: 3478093
2023-04-28 00:50:19 -07:00
Sandeep Singh
18a4f28a8d cnss2: notify wlan fw to stop trace collection
Cnss2 driver receives cnss_pci_smmu_fault_handler cb from smmu
driver whenever wlan fw access illegal IOVA address. In
cnss smmmu fault cb handler, cnss2 driver rings trace stop
door bell register to stop tracing in wlan fw. This will
help to get proper traces to debug where illegal access
is happening in wlan fw.

Change-Id: I953ced55d4d847ccaabad15f5f70150aec8aabd6
CRs-Fixed: 3459443
2023-04-18 18:26:59 -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
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
Naman Padhiar
190e1efaa9 cnss2: Avoid PBL/SBL region dump in Mission mode
Access to PBL and SBL log region in SRAM is restricted in
Mission mode. Avoid PBL/SBL log region dump in Mission mode.

Change-Id: Ia8813ccd9e2c0339c280e6cb6d6f0bab0bee206e
CRs-Fixed: 3432159
2023-04-07 17:02:05 -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
Jayachandran Sreekumaran
9d783b8514 cnss2: Ensure driver registration before suspend
Ensure wlan driver registration before invoking suspend callback.

Change-Id: I2c8e40770209ae37364bdfea71045522d43465a8
CRs-Fixed: 3378544
2023-03-16 04:54:32 -07:00
Gangadhar Kavalastramath
313bb86570 cnss2: Set genoa dma bit mask to 32 bit
Currently genoa is using lower 32 bits of 64 bit dma
bitmask. Unexpected access of higher 32 bits may cause
issues.This code change avoids such possibilities.

Change-Id: I8bf17056a12661a7c50333bf5897721d363550a3
CRs-Fixed: 3428036
2023-03-11 15:42:16 -08:00
Chaoli Zhou
74ebfcdb0a cnss2: Skip any adsp operation if DRV not supported
At the auto platform, DRV feature is not applicable.
So do not issue any DRV related operation from cnss2
side, which may cause the RC PHY not ready in the LPM
case.

Change-Id: Iefae9a885c1adc289da518d65a2974e127bdf359
CRs-Fixed: 3419811
2023-03-10 21:15:43 -08: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
5c7494ce4a cnss2: Set TME-Lite support flag for Peach
Peach supports TME-Lite to validate FW image. TME-Lite supported
FW image format is different from currently used FW images and it
requires different way of downloading in MHI layer. Set TME-Lite
supported flag in MHI controller for Peach to inform MHI about
FW image format.

Change-Id: I615570914c9cec297aa422ce683b4d1c6c75ea1c
CRs-Fixed: 3364546
2023-02-26 22:53:13 -08:00
Chaoli Zhou
ef7ea762d7 cnss2: Force PM resume for qca6390
For whatever reason, the qca6390 is not in M3 state
during PM resume phase, but still functional if do
force resume. So calling mhi_pm_resume_force()
instead of the mhi_pm_resume() to unblock PM
resume for kernel 5.15.

Reference link:
https://lore.kernel.org/regressions/871r5p0x2u.fsf@codeaurora.org/

As for lower kernel version, like 5.4, it will do local
mhi pm state check in the mhi_pm_resume() instead of
target pm state check, so has no issue with qca6390.

Change-Id: I54c2cef457405720386af6a6f7d4617f3d081875
CRs-Fixed: 3402571
2023-02-20 08:30:48 -08:00
Chaoli Zhou
8fdf81fea5 cnss2: Support conditional power off in the LPM for HST/HSP
Should power off HST/HSP if it only finished pcie
enumeration without WLAN driver load before do
LPM. Otherwise, it will cause the mhi state switch
from INIT to SUSPEND failure that block LPM.

Change-Id: Ia2c5fbf0a2bf9c088be548eb533d7836f45a3cfd
CRs-Fixed: 3283893
2023-02-16 07:16:03 -08:00
Lin Bai
2684b4a9d8 cnss2: Avoid OS assert if SSR enabled
Current implementation tries to collect FW dump when cnss shutdown,
and then ASSERT after collection complete.

Do not invoke CNSS_ASSERT if SSR enabled.

Change-Id: I8d427603bfc7e6bb5d732fa3e29ff66c965e153b
CRs-Fixed: 3399930
2023-02-08 16:59:48 +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
Alan Chen
436eadfdaa cnss2: Update new register addresses for Peach Devices
Update new register addresses for Peach Devices.

Change-Id: I9543af4ca8aa4130533ea1975793ddce36b97eb1
CRs-Fixed: 3387208
2023-01-28 01:06:39 -08:00
Alan Chen
edab97e465 cnss2: Add support for WLAN PEACH PCI device
Add PCI device ID config and code updates to handle PEACH WLAN device.

Change-Id: Ib4f30a1dd5c3307c59694e94871617e766488677
CRs-Fixed: 3347738
2023-01-28 01:06:38 -08:00
Alan Chen
ae2498e987 cnss2: Collect and load elfdump data
Call collect_driver_dump() driver ops to add the data from the buffer
for the four log types.

Change-Id: Ic06d4520de6f87202d1c3ce24362d61002b85f61
CRs-Fixed: 3352310
2023-01-19 18:40:35 -08:00