Commit Graph

724 Commits

Author SHA1 Message Date
Nandha Kishore Easwaran
18bbaf7484 qcacmn: Add unique irq name per pci slot
Added unique irq name per pci slot so that affinity settings
can be altered as needed. Pci id will be read from dts, and
when there is no entry in dts, default value 0 will be used.
Also for all other target types except qcn9000, default value
0 will be used.

If WLAN_MAX_PDEVS is defined to 1, then always return pci id as
0 since there is only one pdev present

Change-Id: I8159ec8d8daecae687fcc286d620bfe9861dff98
2020-05-13 01:30:37 -07:00
Vevek Venkatesan
516abea104 qcacmn: add HW version and name support for Hastings
Add support for HW version soc id and HW name string
for Hastings and HastingsPrime platform.

Change-Id: I1ba57339b2f9afd425e1ecc9f312ad484340d226
CRs-Fixed: 2681134
2020-05-11 11:44:11 -07:00
Rakesh Pillai
37cc4255e2 qcacmn: Drain group tasklets and reg write work for runtime PM
Currently as part of runtime PM, only the active
tasklets are being drained. For chips eg. QCA6390,
QCA6490 etc, there are grp_tasklets and delayed reg
write work which has to be drained before entering
runtime PM.

Add the logic to drain all the possible tasks
before entering runtime PM.

Change-Id: Ieb486f00fffd7346dcdc1faea6fed5850ef6daf7
CRs-Fixed: 2676000
2020-05-08 20:27:43 -07:00
Basamma Yakkanahalli
b8396604b4 qcacmn: Reduce number of CE to 6 for IPQ5018
Reduce the number of CEs used in IPQ5018 to 6 since it has only
one mac and requires only 6 CEs. CE7 and CE8 are reserved for FW
and not needed to be configured from host.

Change-Id: Ibe262c32d8b3234873391559d939bc198c658c60
2020-05-06 03:10:23 -07:00
Yue Ma
41890f9647 qcacmn: Refine runtime PM usage count checking logic
Commit c81a71e488 ("qcacmn: Cleanup and refine runtime PM open/close
logic") addes the change to align default usage count for both runtime
PM enabled and disabled cases. So active usage count for runtime PM
enable case is 0 and for disabled case is 2. Refine the usage count
checking logic based on that change.

Change-Id: I4e78089760a28d10e6b37bb1a7b2d5242de6c111
CRs-fixed: 2676761
2020-05-06 01:26:48 -07:00
Nirav Shah
e2d6e92a68 qcacmn: Do not vote for PCIe link for QCN7605
Do not vote for PCIe link for QCN7605 to allow PCIe
bus to go to low power mode.

Change-Id: I14e1a5d142497e3cbe8ed12874a428ab7d90afed
CRs-Fixed: 2649897
2020-05-04 00:32:53 -07:00
Vevek Venkatesan
e4a31a803d qcacmn: change logging with spin_lock held to debug level
Change the error level logging which are called by holding
the spin_lock to debug level to avoid printing to console.

Change-Id: If057087e808ed49000eba8b9795397a0cf35a357
CRs-Fixed: 2676235
2020-05-02 15:50:31 -07:00
Alok Kumar
25a79eb0f4 qcacmn: Register WAKE IRQ for QCA6750
Register CE2 IRQ as WAKE IRQ for qca6750

Change-Id: I62517ed09aef6662960c427e075dd3c1c4922783
CRs-Fixed: 2675316
2020-05-02 11:10:13 -07:00
Rajeev Kumar
0dffbe0845 qcacmn: Add validation assert for runtime pm get/put out of sync
As part of HIF runtime PM close add assert to make sure no runtime
PM user has missed any put which may lead to runtime PM getting
disabled at runtime. This assert ensures all runtime PM users
have get and put in sync.

Change-Id: I6663be013e85b8a262ccc0f60c8bd9c59bac25ef
CRs-Fixed: 2665231
2020-05-01 12:49:24 -07:00
Yue Ma
c81a71e488 qcacmn: Cleanup and refine runtime PM open/close logic
Runtime PM code has been refactoring multiple times so some open/close
logic may be duplicated and messed up. Cleanup and refine the logic.
In other to align both runtime PM enable and disable cases, make sure
default usage count is always 2 and sanitize the same when runtime PM
exit. hif_pm_runtime_stop() should always happen from HDD disable power
management APIs so clean it up from hif_pm_runtime_close().

Change-Id: I3b64369608c2d9aa4b3353503c12e0d05a57b592
CRs-fixed: 2666196
2020-04-29 16:03:38 -07:00
Vevek Venkatesan
9043089a40 qcacmn: Add prefetch_timer config for CE rings
Add prefetch_timer configuration for CE rings.
Set prefetch_timer=1 configuration for qca6490 destination CEs,
prefetch_timer=0 configuration for other targets CEs.

Basically setting to 1us asking CE hw to update ring tail pointer to
update within 1us. FW side CE SW sets all rings to 1us already.
Idea behind this change  is, we have seen pre-silicon issue where SRC
ring TP read by SW was not seen updated value when prefetch was set
to 8us. Changing prefetch timer value to 1us helps to resolve
pre-silicon issue.
So host side rings need to update the prefetch timer to 1us.

Change-Id: I0830c73517c29cf39e6b2974bf3faa44e5673741
CRs-Fixed: 2669762
2020-04-28 03:59:18 -07:00
Yeshwanth Sriram Guntuka
ac0322cce9 qcacmn: Set runtime pm state prior to runtime_init
During initialization of driver, the runtime pm usage
count is incremented to 1 when the pm state is NONE.
Runtime get is done as part of htc send packet for
a wmi command in scheduler thread context. In kworker,
runtime_start is processed as part of driver load and
runtime put is done prior to updating the pm state to
ON. Runtime put triggered as part of htc send packet
causes a panic since the state is NONE and usage
count is 1.

Fix is to set runtime pm state to ON prior to doing
a runtime put as part of initialization.

Change-Id: I52cca5240f2f0872c681aab3a58a382f3fa1df0e
CRs-Fixed: 2669029
2020-04-23 14:50:58 -07:00
Nirav Shah
eb3405c26a qcacmn: Disable copy complete interrupt for HTT copy engine
Disable copy complete interrupt for HTT copy engine.

Change-Id: I09510298f873a3bc4ca802a6fed3b7b0e103fd65
CRs-Fixed: 2649845
2020-04-22 14:03:40 -07:00
Alan Chen
528d6ccd70 qcacmn: Add check to avoid panic if FW is down
In order to avoid panic in hif_pci_runtime_pm_warn(), call
qdf_is_fw_down() to check if fw is down. If fw is down, return without
panicking.

Change-Id: I3fd3e0334220c1cf3ae6b3ec3fd5b1ede1705013
CRs-Fixed: 2664133
2020-04-18 13:50:35 -07:00
Nandha Kishore Easwaran
a8c046d68b qcacmn: Change DP interrupt names
Change DP interrupt names to unique values so that
interrupt affinity can be adjusted based on this. This is
similar to what is being done for Copy Engine interrupts.

Change-Id: I7f1789c8c0103e7c01b0a2956a7a37149c7462d1
2020-04-18 05:01:46 -07:00
Hong Shi
5312595f75 qcacmn: enable athdiag access for QCN7605
Currently, athdiag can't work with QCN7605.

Thus made below change to make it work:
1. Skip pci address boundary check for QCN7605 as QCA6390.
2. Make QCN7605 access target memory via QMI.

Change-Id: Ibfcccb57486c99d78c02e322c4e2ae1a7c8dab81
CRs-Fixed: 2653814
2020-04-16 05:37:55 -07:00
Rakesh Pillai
e0464a106c qcacmn: Do not increment tail pointer if no data in CE DST ring
Currently there are cases where the CE status ring
head pointer is incremented, but the corresponding
buffer in the CE DST ring has nbytes as zero. This
can be a possible case where the head pointer was
updated before the DMA copy was completed and before
the nbytes could be updated with the number of bytes
copied to the CE DST ring buffer.In such cases we
haven't processed this entry, and hence should not
increment the tail pointer.

Hence we do not increment the tail pointer if
there was no data in the CE DST ring. Also
enable the logging of CE STATUS RING REAP
even if the CE DST reap was not successful.
This will help identify the cases where the reap
was not successful because of nbytes being zero.

In Success case, the CE desc history will show
STATUS_RING_REAP and DST_RING_REAP events.
In nbytes=0 failure case, the CE desc history will
show STATUS_RING_REAP event with HP moving ahead,
but the TP will not have moved.

Change-Id: Ibc3145142b6c88f6da3e12748d0ac8090486e8e3
CRs-Fixed: 2657285
2020-04-10 00:45:11 -07:00
Nisha Menon
046f3623de qcacmn: Back pressure in REO2SW1 ring resulting in REO panic
Update QCA_NAPI_DEF_SCALE_BIN_SHIFT for defconfig builds to
the same value as the perf build.
Move the WLAN ext irqs to gold cores for defconfig builds.
Disable cpu isolation before moving the IRQs to gold cores.
Add the ability to move IRQs to gold cores when the cpus
hotplug in.

Change-Id: I4cfecd02a1a2200dc99adee9a324b90c877c13fd
CRs-Fixed: 2638820
2020-04-09 05:21:20 -07:00
Jingxiang Ge
55e387e16d qcacmn: Refine description for rtpm function
This is to refine description for some rtpm
function.

Change-Id: I24e078804491203e8a256d80c7b3b14dca8794c7
CRs-Fixed: 2658698
2020-04-08 09:58:43 -07:00
Jingxiang Ge
e7d41574f3 qcacmn: Add dbgid for each runtime put/get
This is to enhance statics for runtime put/get, which is
to detect if there is mismatch for usage_count.

Change-Id: I24cddb9d10e4cb675c8375cbd0f589c7718bd680
CRs-Fixed: 2647972
2020-04-07 01:20:41 -07:00
Yeshwanth Sriram Guntuka
8cf020f44a qcacmn: Add support to register hif recovery notifier
Add support to register hif recovery notifier to log
hang event data.

Change-Id: I7e7ce2bacc88f00e68c2c347c3a578f377f8214f
CRs-Fixed: 2649147
2020-04-03 03:43:06 -07:00
Karthik Kantamneni
765d5e27ed qcacmn: Make DMA coherent mask macro independent of IPA offload
Macro DMA_COHERENT_MASK_IPA_VER_3_AND_ABOVE is used in non
IPA offload case also so bring this macro definition out of
IPA offload feature and change it to DMA_COHERENT_MASK_DEFAULT.

Change-Id: Ib03aa8ae2938e1de1a957660923a711d452a9337
CRs-Fixed: 2649909
2020-04-02 22:16:38 -07:00
Aditya Kodukula
6a4676ec03 qcacmn: HIF_INFO to log the linkstate_vote in hif_main.c
Add HIF_INFO to log the linkstate_vote value in the hif_vote_link_up()
and hif_vote_link_down() functions in order to log the occurences of
the rare event when we vote for link up/down.

Change-Id: I7549b3400977583bd2cd4ec4fcb3f16dd0865ce7
CRs-Fixed: 2648860
2020-04-01 07:36:25 -07:00
Yue Ma
e3c95fdc04 qcacmn: Enhance runtime PM enablement check
Currently HIF runtime PM APIs will check runtime PM enablement using
pm_runtime_enabled() by checking for disable_depth which can be changed
at any time. This may cause usage count imbalance since the HIF API may
skip calling the corresponding runtime PM framework API to increase or
decrease usage count. Enhance runtime PM enablement check so that it
will always honor WLAN ini config first.

Change-Id: I4b2863ef7fa0dcd6fd61b776e6cb0ab109ffb3ec
CRs-fixed: 2647986
2020-03-31 21:03:38 -07:00
Yeshwanth Sriram Guntuka
d3db10ec5b qcacmn: Add support to log ce hang event info
Add hif APIs to support logging of ce hang event
data.

Change-Id: I9b930d5f983d57a7359ba9f97ea65050c4f54a8a
CRs-Fixed: 2649148
2020-03-30 17:11:00 -07:00
Nisha Menon
df7fb3627f qcacmn: Disable the PCIE scratch reg write for wake req handshake
Disable the PCIE scratch reg read/write to wake up PCI bus.
This fixes the PCNOC error seen during boot up on writing to
the PCIE scratch register.
Enable DEVICE_FORCE_WAKE_ENABLE feature flag to enable
PCIE sracth reg read/write.

Change-Id: If4efd0afbddf97462bf9d0f06d0085c0a5b37a64
CRs-Fixed: 2636160
2020-03-25 22:30:43 -07:00
Nandha Kishore Easwaran
e6ffcdabce qcacmn: Increase CE2 count to 128 for QCN9000
Increase destination CE2 buffer count to 128 for
QCN9000.

Change-Id: I4b497c385e461d093da5fa5ed03e2aa299dfb1f9
2020-03-23 19:57:35 -07:00
Basamma Yakkanahalli
9def5df14a qcacmn: device ID and target type checks for ipq5018 target
Initial changes for ipq5018 compilation.
Added device ID and target type checks for ipq5018 traget.

Change-Id: Ib86a371fbe66749fcb6d114e7a4a9931b684e03d
2020-03-20 23:45:43 -07:00
Jingxiang Ge
84e83c24c0 qcacmn: Enhance log for usage_count mismatch debug
Add below change:
1 log level change from error to debug level in
  hif_pci_runtime_pm_warn.
2 Change warn_on to bug_on in hif_pci_runtime_pm_warn.
3 change pm_stats to atomic
4 record last 128 caller both for get/put

Change-Id: I2dae883dfaed22812445c5d50920fb363b9e0ea7
CRs-Fixed: 2638863
2020-03-17 16:09:28 -07:00
Alok Kumar
048c20096b qcacmn: Use platform driver APIs to enable/disable IRQ
Use pfrm_disable_irq_nosync/pfrm_enable_irq APIs inplace
of disable_irq_nosync/enable_irq to enable/disable IRQ.

Change-Id: I4002a0c8efddac7211ab0c7e8b92356b0c7bc7bf
CRs-Fixed: 2636512
2020-03-17 09:16:17 -07:00
Chaoli Zhou
2e0fb4fd50 qcacmn: Change copy engine 8 entry numbers
From Genoa firmware request, in order to improve
the IPA througput, increasing the number of copy
engine 8 entries and other nbytes values.

Change-Id: Ib1ae170c3b3f5af61d03ad8a60bc616b7a58a725
2020-03-13 06:47:45 -07:00
Mohit Khanna
ace98f847f qcacmn: HIF APIs to prevent/allow low power states
Add HIF APIs to prevent or allow link to go into low power states. The
current implementation uses PLD APIs to make the needed configuration.

Change-Id: I22efb4bcf902f9aff674ed1872f4f23bef508aae
CRs-Fixed: 2602029
2020-03-09 20:58:34 -07:00
Naman Padhiar
f675e5c4f4 qcacmn: Set DMA mask as 37 for WCN6750
Set DMA coherent mask as 37 for WCN6750.

Change-Id: I1fdd98a9c221d2e8ee1ff730e37bd0adaed54dd6
2020-03-04 22:58:59 -08:00
Mohit Khanna
b34654bd55 qcacmn: Callback to get current bandwidth level
Add HIF callbacks to get current bandwidth level from upper layers.

Change-Id: I18524558296f4b7d684f18b0e6615b2a0516b6d2
CRs-Fixed: 2602029
2020-03-04 21:19:30 -08:00
Alok Kumar
32de2fe166 qcacmn: Fix compilation and update SHADOW REG OFFSET for qca6750
For qca6750, update the SHADOW REGISTER OFFSET value and
fix the compilation issue.

Change-Id: Ic4b44c1c40e62ddcc50c0a66d37c0663a70b5c54
CRs-Fixed: 2633044
2020-03-04 07:30:44 -08:00
Lihua Liu
a2d35b81ac qcacmn: Enable interrupt mode for CE4 of Genoa
Currently, Genoa CE4 is using interrupt mode. Host will not require
IRQ base on current CE configuration and change below:
"Change-Id: Icabe68298737dc412949484f6d3fdcd8c05910d5", which cause
no IRQ handle of tx completion and source ring full, blocking
TX finally. To unblock TX, correct configuration of CE4.

At the meanwhile, this issue expose another problem that the polling
mode seems doesn't work. Will scope it on another thread.

Change-Id: I31eed8806b939a12503bb4ddd8b9dec85f3c3540
CRs-Fixed: 2602888
2020-03-01 19:45:23 -08:00
Chaoli Zhou
588021e773 qcacmn: Pass shadow register address for IPA
Since it support PCIe shadow register for QCN7605,
and these shadow register also falls below 512K,
which can be used for IPA write directly without
windowing. So don't use the temporary PCIE_PCIE_SCRATCH_2
for IPA GSI write now, insteadly, passing the correct shadow
register of copy engine 5 to IPA.

Change-Id: Ica3a502b96e98ee6c07c1032760b5dcb512957d8
2020-02-25 14:03:43 -08:00
guangde
7b4e341e81 qcacmn: HIF changes to support Genova
Add HIF changes for supporting the newly added USB bus type
for Genova.
FW team need athdiag tool to operate FW information. Host
driver need to pass the command and result between athdiag
tool and FW.

Change-Id: I6158a9f8c723a797d39beca09a913c7cb9e10025
CRs-Fixed: 2595515
2020-02-25 06:23:43 -08:00
Venkata Sharath Chandra Manchala
607f32711f qcacmn: Increase the CE2 source entry buffer size
Allocate a buffer of size 4096 bytes for each buffer
posted to CE2 source/destination ring.

Change-Id: I0beb1e4e87c19508917e8564b441819031be2065
CRs-Fixed: 2619899
2020-02-23 22:43:30 -08:00
Nirav Shah
47fdeadbd1 qcacmn: Enable Shadow register from PCIe block in QCN7605
QCN7605 has 2 set of shadow registers, WCSS block and PCIe block.
As PCIe shadow register are at power domain boundary, enabling
PCIe shadow register for QCN7605.
Also PCIe shadow register falls below 512KB, no need to use register
windowing which is required to get it access from IPA FW

Change-Id: If18d2d0a3f16f492b3c32449695e70c2b9942375
CRs-Fixed: 2623853
2020-02-21 06:08:41 -08:00
Chaoli Zhou
10cfeb84a4 qcacmn: Pass phy address PCIE_PCIE_SCRATCH_2 to IPA
Currently, the IPA GSI can't update the index to copy
engine 5 write index register since such kind of
register address is above 512k, so as a workaround,
we use PCIE_PCIE_SCRATCH_2 to replace copy engine 5
write index register for IPA update the index. And then
WLAN firmware will poll this register to check if this
index update or not, if updtae, WLAN firmware will be
as agent to update the index to real copy engine 5 write
index register, and then the data from IPA to WLAN will
work. Before the real fix is ready, we use this method
for workaround.

Change-Id: I383a7d52f5685b633f1bd44659b11f30231c8ca8
2020-02-15 17:41:40 -08:00
Linux Build Service Account
67ef957780 Merge "qcacmn: Rename cmd ring to cmd_credit ring" 2020-02-15 11:08:15 -08:00
Alok Kumar
281aa22857 qcacmn: Update CE registers and CE IRQ for qca6750
Update CE registers offset during hal srng configuration
and configure CE IRQ for qcac6750.

Change-Id: I4fd3d37783361f0029c7ef80e32425f8790d1250
CRs-Fixed: 2617699
2020-02-14 20:20:07 -08:00
Chaoli Zhou
09815803eb qcacmn: Change copy engine 5 destination ring entries to 128
Genoa FW use the hardcode 128 for ce5 destination ring
entries, so change host code to follow up with it.

Change-Id: I1b7e70f8244efc3d3ca3dc659fb3d7687828b9c4
2020-02-14 05:48:08 -08:00
nakul kachhwaha
7fba021821 qcacmn: Fix compilation issue on non-msm platform
Fixing compilation issue for USB interface on non-
msm platform by adding pld_common.h header file in
if_usb.c which contains cnss pld specific definitions.

Change-Id: I67b3fd29bb21d827618655f337f38beb683a4c41
CRs-Fixed: 2615907
2020-02-11 02:39:31 -08:00
Basamma Yakkanahalli
f9529fbba8 qcacmn: Adding hal support for ipq5018
Added new qca5018 hal folder to add ipq5018 specific changes.
This includes interface files to access ipq5018 hal registers.

Change-Id: I7e19dc7c8719fa175695b268dc904fb4521a3330
2020-02-10 21:56:37 -08:00
Alan Chen
6760310422 qcacmn: Move hif_pm_runtime_resume() to hif.h file
This is a public API, so move it outside to hif.h file so it can be
used elsewhere as well.

Change-Id: Ic870cf804df69f6d7bb5a792da662759d687e0ed
CRs-Fixed: 2616491
2020-02-07 10:40:16 -08:00
Surya Prakash Raajen
ff8e33a3bd qcacmn: Export hif display stats api
Export hif display stats api to enable
ce stats debug print

Change-Id: Id3044a94ddfe5fb33eee6a09e873a58b489a30fc
CRs-Fixed: 2596873
2020-02-04 03:19:40 -08:00
Linux Build Service Account
9cf6099bec Merge "qcacmn: Replace 8074_VP with WIFI_EMULATION_3_0" 2020-01-31 05:37:08 -08:00
Nandha Kishore Easwaran
b7c18849ae qcacmn: Replace 8074_VP with WIFI_EMULATION_3_0
Replace QCA_WIFI_QCA8074_VP with CONFIG_WIFI_EMULATION_WIFI_3_0
since VP platform is not being used anymore.
Most of the parameters present inside QCA_WIFI_QCA8074_VP are related
to emulation timeouts. Hence replacing it with a more meaningful flag.

Change-Id: I22a0e5803e765333947f1613b376dcc6bd25b5af
2020-01-31 02:34:19 -08:00