Commit Graph

670 Commits

Author SHA1 Message Date
Alan Chen
850a888935 qcacmn: Change enable_runtime_pm from bool to uint8_t
Change enable_runtime_pm from bool to uint8_t in correspondence to
changing CFG_INI_BOOL to CFG_INI_UINT for enabling runtime PM.

Change-Id: Ib5031ada43fac864d933cdfee875593f896b2a62
CRs-Fixed: 2603918
2020-01-19 09:48:20 -08:00
Alok Kumar
44e048386b qcacmn: Add IPCIE directory for QCA6750
Add HIF changes for supporting the newly added IPCI
bus type for QCA6750

Change-Id: Icc06ac71caa3bb23aac5d4ec2f2e5aee8b7f8baa
CRs-Fixed: 2597345
2020-01-18 04:44:47 -08:00
Alok Kumar
ffc116e798 qcacmn: HIF changes to support Moselle
Add HIF changes for supporting the newly
added IPCI bus type for Moselle

CRs-Fixed: 2597321
Change-Id: I9097e4622e9d6d561e92f5a21cb279c4d631cfbb
2020-01-18 04:44:35 -08:00
Naga
ab425a2edf qcacmn: Fix return values in if_ahb.c
Fix return code to return error code instead
of -1 in if_ahb.c.

Change-Id: I41a6e0b6db44c9ade02a0f835232b5d6c9ba7a73
CRs-Fixed: 2597545
2020-01-13 23:18:22 -08:00
Linux Build Service Account
5e7141ceb3 Merge "qcacmn: Do not get/put the pm_runtime if RPM is disabled" 2020-01-11 20:06:29 -08:00
Tiger Yu
0778a3973d qcacmn: Do not get/put the pm_runtime if RPM is disabled
Do not get/put the pm_runtime if RPM is not enabled to avoid the WMI
command sending block.

Change-Id: Id6cddc4d5b6322fea063f08a1b641034ba0272d9
CRs-Fixed: 2587797
2020-01-11 19:23:39 -08:00
Surya Prakash Raajen
3206d614d1 qcacmn: Fix unknown symbol error for ce_tasklet_debug in 32bit
Fix unknown symbol error for ce_tasklet_debug_enable in 32bit

Change-Id: I76843f9569b79d4128932c2c2e27c8446285e831
CRs-Fixed: 2597243
2020-01-07 08:31:07 -08:00
Nandha Kishore Easwaran
54532861c7 qcacmn: Disable wake irq for QCN9000
Disable wake IRQ for QCN9000 since it doesn't require wake
feature.

Change-Id: I62e8712f9c7c7624c84889740249f3b70b21d6ff
2020-01-07 04:39:13 -08:00
Surya Prakash Raajen
b976076b3b qcacmn: Track tasklet execution and total time (sched+exec)
Add support to track tasklet execution and total time in different
buckets for debugging purposes

Change-Id: Ide459c385b2a44c0f16d05b37879c8b462782d72
CRs-Fixed: 2589199
2020-01-05 10:16:57 -08:00
Naga
3ea157570e qcacmn: Replace kernel calls with pfrm wrapper
HIF layer have kernel calls for interrupt registration
which need to be replaced in case of whunt framework,
as interrupt generation will be simulated by framework
itself, hence adding abstraction to call either kernel call
or whunt calls based on platform bus type.

Change-Id: Ife113d6338defa8e693e761992ce3a1bb9524306
CRs-Fixed: 2582523
2020-01-04 05:44:39 -08:00
Yu Ouyang
82e3fbda26 qcacmn: Support ROME SDIO
To support ROME SDIO card, change in HIF SDIO layer. Without CNSS or
CNSS2 module, it can bring up adapter successfully.

Output few logs in SDIO read and write thread, and optimize HIF
SDIO layer logging.

Change-Id: I96ba731a7fa572131aaaec8ab25d9cffc41ec0b2
CRs-Fixed: 2542051
2020-01-01 22:17:23 -08:00
Surya Prakash Raajen
141db5f642 qcacmn: Fix unknown symbol error in HIF_CE_DEBUG_DATA_BUF case
When HIF_CE_DEBUG_DATA_BUF is enabled for some apis when module is
inserted, it throws unknown symbol error, fix them by exporting the
required apis.

Change-Id: Icf6fc40f7df1c463ad7a6f9eff38adcbdf9276b7
CRs-Fixed: 2593859
2019-12-31 02:44:38 -08:00
Rakesh Pillai
4863352e53 qcacmn: Unmap the htc connect buffer after connect failure
The htc connect message buffer is not unmapped,
if the firmware does not send wmi ready event to the
host.

Scenario:
- Host sends htc init command.
- The command is queued into the src ring.
- The firmware has crashed before the Copy Engine
  could copy the message to the destination ring
- Due to the above point, no copy completion
  interrupt is received.
- The host times out during its wait for the wmi
  ready event.
- Hence the htc init command buffer stays unmapped
  and unfreed.

As a part of the wma ready event missing cleanup,
the htc connect buffer is not unmapped. Fix this
to avoid missing to unmap the buffer.

To avoid a side effect of sending a completion for
HTC connect command, all the commands are freed in
the htc completion handler in case of SSR.

CRs-Fixed: 2512344
Change-Id: I05026b3cbb764197e6df85c41634002d271a50e5
2019-12-25 22:11:36 -08:00
Nandha Kishore Easwaran
ee037a0f89 qcacmn: Reduce number of CE to 6 for QCN9000
Reduce the number of CEs used in QCN9000 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: I989ffdb0219e2628bac5536e25c4cb2dbba6b7fb
2019-12-22 22:14:41 -08:00
Nandha Kishore Easwaran
a4f6b8ecce qcacmn: Do not request irq if DISABLE_INTR is set
Do not request interrupt if DISABLE_INTR flag is set in CE flags.
This check is already present in hif_ahb_configure_irq but is missing in
MSI path.

Change-Id: Icabe68298737dc412949484f6d3fdcd8c05910d5
2019-12-22 22:14:22 -08:00
Venkata Sharath Chandra Manchala
87a56bc7b7 qcacmn: Increase the force wake timeout
Increase force wake timeout value to 500ms to
accommodate scheduler latencies.

Change-Id: Id3748539e4b4809530ff78bd810681cb2210ff31
CRs-Fixed: 2573863
2019-12-22 22:14:01 -08:00
Manikandan Mohan
b199b73f43 qcacmn: Fix unused expression result warning
Fix unused return value warning for hif_fw_interrupt_handler function
usage.

Change-Id: I64a063f795e5087baff37d4bb63f9fe79ce811fc
CRs-fixed: 2587457
2019-12-19 04:39:39 -08:00
Nirav Shah
eb26831637 qcacmn: Update tx/rx bundle statistics for USB interface
Update tx/rx bundle statistics for USB interface.

Change-Id: Ia7951f9feb88ca28e055d9f32f0dfee65c7f0bf9
CRs-Fixed: 2571550
2019-12-06 08:40:56 -08:00
Venkata Sharath Chandra Manchala
2b0d3f38d5 qcacmn: Support force wake request
1. Add hif_force_wake_request API to wake the
mhi and umac before reading/writing the memory region
greater than BAR+4K.
2. Add hif_force_wake_release API to release the
PCIE_PCIE_LOCAL_REG_PCIE_SOC_WAKE_PCIE_LOCAL_REG so the
umac can power collapse again at a later point of time.
3. Add pci stats to dump the force wake status.

Change-Id: Ic6d5463ea0cdb28d9144be61da55e43033b53298
CRs-Fixed: 2478052
2019-11-26 02:15:13 -08:00
Sravan Goud
3af8bd05e8 qcacmn: Increase the napi scale for slub debug builds
UMAC reo full condition is seen in slub debug builds in case of
DL throughput traffic. This is due to host process only 64 packets
per NAPI schedule in case of slub debug builds where in case of
perf builds budget is of scale 4 times. Also the time between two
napi schedules is in order of milliseconds which accounts for the
delay of host reo ring processing. So increase the napi budget
scale to 3 times which make sures host process enough packets per
napi schedule.

Change-Id: I3e134f31277a72056f3d7d5433ed1adeefa433fa
CRs-Fixed: 2563595
2019-11-19 16:55:09 -08:00
Tiger Yu
987de79182 qcacmn: Wake up system for early interrupt wakeup during suspending
During system suspending, the target might request wakeup early to the
host. The host will wakeup the system directly to abort current suspend
to avoid mismatching PM state between host & target.

Change-Id: Icf6e58ff24cbe072ef56aa22820432efb2ca1932
CRs-Fixed: 2559306
2019-11-13 06:53:29 -08:00
Nandha Kishore Easwaran
cbf2eb71d3 qcacmn: Enable interrupts for pine
Remove EPPING_CE_FLAGS_POLL from poll flags so that interrupt is
enabled for pine.

Change-Id: I8271ab47e75fbe254e0c5d745f861edbda4b07ce
CRs-fixed: 2507441
2019-11-13 00:56:22 -08:00
Venkata Sharath Chandra Manchala
ea6518b89e qcacmn: Record reo command srng events
Add debugging infrastructure to record every event posted to reo
command ring. The infrastructure maintains the record of the last
64 events posted to the ring.

Change-Id: Id56fc352050eb664a64b0abb767f3b4a6b4c3aa3
CRs-Fixed: 2552822
2019-11-07 19:50:09 -08:00
Nandha Kishore Easwaran
fb73acb147 qcacmn: CE flag changes for QCN9000
Added change to modify ce flags for Pine.
Also made changes in window enable bit

Change-Id: Id080be53d14450cb6d9376fc810177bce26a2869
CRs-fixed: 2507441
2019-11-05 16:18:38 -08:00
Venkata Sharath Chandra Manchala
7fa23c1502 qcacmn: Add support to record iova address
Add support to record iova and pa address for
every buffer posted to CE SRC ring. This is to
identify issues in memory corruption.

Change-Id: I774b705f9edc89490d1f8dfdd01e8e0d9e9165c0
CRs-Fixed: 2546824
2019-10-25 01:23:58 -07:00
Yeshwanth Sriram Guntuka
2a7ed0abd3 qcacmn: Record few more ce desc event during post_recv_buffers
CE events are not recorded during nbuf allocation and
nbuf map done in hif_post_recv_buffers_for_pipe.

Add few more events to be recorded to know the exact
time when nbuf allocation and map is done with respect
to rx_desc_completion and rx_post_desc events.

Change-Id: Ia2a3ea61dc99dd21d06b442ef00cd25550f4cb5a
CRs-Fixed: 2541986
2019-10-23 10:32:22 -07:00
Subrat Dash
e2e55cdec5 qcacmn: Fix Invalid HTC endpoint is observed in the rx header
The urb completion handler is asynchronous. Sometimes it is
called before prestart allocation is complete.
The urb_prestart_cnt is accessed unsynchronized manner from
usb_hif_usb_recv_prestart_complete. It presumes that it
is running out of prestart URBs and new allocation will be
done. Since bundling is not enabled at this point, the new
URBs allocated are not considered for bundling.
Use spin_lock to ensure synchronization in the above scenario.

Change-Id: I8c989aff7985a9ab614d63a71c7f97a0278647e0
CRs-Fixed: 2538796
2019-10-22 01:51:32 -07:00
Mohit Khanna
973308ae13 qcacmn: Add HIF changes to support qca6490
HIF changes to support qca6490 WLAN chipset.

Change-Id: I4b1be1770a2daf0a0db6f65f579831e3fcb10e79
CRs-Fixed: 2522133
2019-10-17 15:13:20 -07:00
Venkata Sharath Chandra Manchala
f73d891115 qcacmn: Add qca6490def.c file
Add the file to include host and
target based definitions.

Change-Id: I577e4be6a7d0b8258b69593ca45d29bfd5cbb0c0
CRs-Fixed: 2522133
2019-10-17 15:12:49 -07:00
Venkata Sharath Chandra Manchala
34a2ef695d qcacmn: Add support to copy buffers posted to CE SRC
Enable data field in hif_ce_desc_event structure
and copy the buffer posted to CE SRC ring. This is
done to validate the contents of the buffer.

Change-Id: I6745422f6c3a8ac013bb35032056f041d2216d89
CRs-Fixed: 2540707
2019-10-10 18:04:39 -07:00
Sravan Kumar Kairam
b96e5072de qcacmn: Add runtime pm apis to record last dp rx busy mark
Add runtime pm apis to record last busy mark set by data path
during dp rx process.

Currently for mcl in some scenerios runtime sync suspend is issued
which puts the link in low power state with out waiting for link
inactivity timeout. This leads to throughput degradation in case of
rx direction as in rx processing data path extends the timer by marking
last busy to avoid immediate runtime suspend. But runtime sync suspend
does not take in to account of the link idle timeout value before
suspending the link. So using this apis, before issuing runtime sync
suspend check the duration since last busy mark by data path rx process.
If the duration is less than run time delay just do runtime put.

Change-Id: I694ef6ddec8f11fed44bf3b9e5ae18ad93b6ec24
CRs-Fixed: 2512326
2019-09-30 03:18:14 -07:00
Himanshu Batra
7ee0677954 qcacmn: Replace linux print APIs with qdf print APIs
Replace linux print APIs with equivalent level qdf print APIs.

Change-Id: If0a4a5326de87c9f023e8f4de996a4734ed6cda2
CRs-Fixed: 2530137
2019-09-29 23:15:37 -07:00
Guisen Yang
6e0ca6a328 qcacmn: Fix compilation failure when NAPI is disabled
Encap napi APIs by macro, inline the no-op version
APIs, and define the API when the feature is disabled
but API is called by others.

Change-Id: I9c0409b8abcb6260b1adfd5a656f8c1fa42695b5
CRs-Fixed: 2534594
2019-09-28 21:49:59 -07:00
Venkata Sharath Chandra Manchala
780cbb8034 qcacmn: Avoid printing log in console
Avoid printing hif runtime resume log in
console while holding the srng->lock.

Change-Id: I57a361a746884504444028476f20b3735e261d1e
CRs-Fixed: 2522072
2019-09-18 15:49:45 -07:00
Alok Kumar
1c42376e40 qcacmn: Add paddr in CE descriptor history
Add IOMMU IOVA to PA and MMU virtual to phys address
in CE Desc History, hif_ce_desc_history.

Change-Id: I877a2275e7ea99748087ea6f2ad5f26aa3b2476e
CRs-Fixed: 2524381
2019-09-16 23:49:36 -07:00
Mohit Khanna
cd9abacf18 qcacmn: Mark DP interrupts wakeable
This is needed, because in SAP mode wlan_wake_irq is not used to wake up
the APPS when it goes to suspend, and each SRNG interrupt needs to
wakeup the APPS when needed. Hence mark DP interrupts with
IRQF_NO_SUSPEND flag.

Change-Id: I0138c94ad82da7cdef5856c15c5f4089a835bc22
CRs-Fixed: 2512383
2019-09-16 09:25:20 -07:00
Ajit Pal Singh
71bf52b242 qcacmn: qcn7605: usb: Do not call put/get dev and usb_disable_lpm
*For QCN7605 do not call usb_get_dev/usb_put_dev as its already called
in CNSS.

*Also for QCN7605 do not disable lpm in hif_usb_disable_bus().
This was a workaround done for Rome/Naples which is not needed for
QCN7605.

Change-Id: Ibb151390590f85a96ad83395420b08aee1be15ef
CRs-Fixed: 2516667
2019-09-15 20:41:03 -07:00
Yue Ma
a720310823 qcacmn: Log runtime PM wake source in debug level
Since callers who log runtime PM resume source may be invoked within
spinlocks or in other atomic contexts, log using info level will log
to console as well which may result overhead. Log using debug level
which will be logged to buffer only to avoid such issues.

Change-Id: I0497c7b7528200af9a34d816865e9bbbfd8bacf2
CRs-fixed: 2518800
2019-09-13 17:37:17 -07:00
Visweswara Tanuku
ebebd7632b qcacmn: Genoa: SDIO: Alloc Rx SKB buffer based on Payload Len
Allocate Rx SKB buffers based on Payload Length indicated in
HTC Header

CRs-Fixed: 2517051
Change-Id: I337e70eeae804ba8ef17a671a5fc39e59382e96d
2019-09-06 22:25:01 -07:00
Lin Bai
14143c2277 qcacmn: Fix maybe-uninitialized compilation failure
'dest_desc' may be used uninitialized in function
ce_recv_buf_enqueue_srng/hif_record_ce_srng_desc_event, when
Werror=maybe-uninitialized enabled.

Change-Id: I13281d74bcfff5eb7474af729fd70d90c024ee75
CRs-Fixed: 2519213
2019-09-04 11:31:16 -07:00
Visweswara Tanuku
8c730b08c0 qcacmn: Genoa: SDIO: Handle Rx Padding
In Genoa SDIO ADMA implementation FW sends bundled packets
which is terminated by a pad block

Handle the Rx Bundling using the pad block

CRs-Fixed: 2506247
Change-Id: I50f1c79a07398ed0fcfba358fc53aa02ad3c6964
2019-08-23 06:27:10 -07:00
Saket Jha
6caec001fa qcacmn: Correct return type for ce_send_single
Due to previous API change, ce_send_single function now returns
QDF_STATUS instead of int. In the case the condition is met
where ce send fails, this function should return QDF_STATUS type.

Change-Id: I0fe8cc2929623d6320bd782abcf75fff6ec60297
CRs-Fixed: 2509467
2019-08-21 20:54:17 -07:00
Jinwei Chen
38dbf13539 qcacmn: disable runtime PM for monitor mode
Disable runtime PM for monitor mode

Change-Id: I8d4c4f30859b01972423073ce1f7fc46d6341089
CRs-Fixed: 2509661
2019-08-21 02:59:44 -07:00
Naman Padhiar
ee289837ea qcacmn: Correctly calculate msi vector for CE
Calculate correct msi vector corresponding to ce id and pass it
to platform driver to get irq number.

Change-Id: I6f9b1b68c6bdaa4baebacf47b7a564413417c55a
2019-08-21 02:59:37 -07:00
Pavankumar Nandeshwar
2d247d0d5e qcacmn: Fix the deadlock situation during deconfiguration of grp_irq
Make sure the free_irq is not called with the group locks held.

Change-Id: I216e0cbae8bb45f1603dfe96e586130773744c50
2019-08-20 12:22:54 -07:00
Ajit Pal Singh
2573cf4667 qcacmn: Do not submit RX-URBs if device suspending
When WLAN device is suspended soon after driver load, the URB
complete callback for prestart URBs 'may' be called, since all
prestart URBs have not been utilised.In the complete callback
,fresh URBs will be requeued.
Check for suspend_state before queuing URBs.

Change-Id: I650080d65acde6b63340d1b90aef6d28df5022c6
CRs-Fixed: 2507594
2019-08-20 05:19:46 -07:00
Akshay Kosigi
07df14c270 qcacmn: Move config files out of cmn dev
Move AP specific CONFIG files out of cmn dev

Change-Id: I53adb20ea910c0bc8842daa85cb762d4d3968e45
CRs-Fixed: 2506563
2019-08-19 02:10:57 -07:00
Jingxiang Ge
5dab0d80c8 qcacmn: Cancel sleep_timer completely in pcie bus suspend
There is possibility that sleep_timer is in running state,
so even in hif_pci_cancel_deferred_target_sleep timer has
been stopped, it runs later.

Use fake_sleep in hif_sleep_entry to check if timer has been
stopped, if yes, without action in hif_sleep_entry.

Change-Id: I46f28f8d856b51792e27a1f80f763830956b2868
CRs-Fixed: 2482547
2019-08-18 21:17:28 -07:00
Yue Ma
ad85368f00 qcacmn: Add suspending and resuming states for runtime PM
Currently runtime PM only has inprogress state which means either
suspend or resume is in progress. Add suspending and resuming states
so that proper handling can be done for each state.

Change-Id: I9d92a8719d659b9ea271c46f8ce6bc912edc0863
CRs-fixed: 2507953
2019-08-16 18:32:56 -07:00
Rakesh Pillai
9d28e0e462 qcacmn: Make num_int_grp consistent with hif_num_grp
The HIF_MAX_GROUP value is not consistent with the
HIF_NUM_INT_CONTEXTS which can cause out of bound access.

Fix this issue by making both these values same.

CRs-Fixed: 2505220
Change-Id: Ia79d9c03de82a73662c189e61e83e43e71d2ef3f
2019-08-14 14:30:16 -07:00