Commit Graph

397 Commits

Author SHA1 Message Date
Dustin Brown
5d0d104798 qcacmn: Use qdf_cpuhp APIs for NAPI
Abstract NAPI's use of CPU hotplug events by using the new QDF CPU
hotplug APIs.

Change-Id: Iad590768476b4dc6bad63b3ee3b1b1bbf7698251
CRs-Fixed: 2141180
2017-11-15 15:53:37 -08:00
Yun Park
3fb3644e61 qcacmn: Clarify usage on Q_TARGET_ACCESS_BEGIN/END
Document where register writes are for legacy vs srng devices.
With the target access begin/end calls being associated with
the register writes and the register writes being associated to
specific HW, we avoid performing unneeded force wakes on common
code paths shared by legacy & srng based hardware.

Change-Id: Id91399d03298bfc5df56f0c5d5d14b648b665279
CRs-Fixed: 2117144
2017-11-14 12:07:30 -08:00
Tiger Yu
d448fad508 qcacmn: Fix memory leak for SDIO RX path in the HIF layer
qcacld-2.0 to qcacmn propagation

There is a memory leak if fail to process the rx packet header in the HIF
layer. Add sanity checking to free all resources if failure hit.

Change-Id: Ifa443dcec0a31ae39356ac1ddf7cfe652d8968ce
CRs-Fixed: 2137736
2017-11-11 09:25:12 -08:00
Yun park
c80eea7fcc qcacmn: ensure dynamic ce_count < CE_COUNT_MAX
This ensures scn->ce_count is less than CE_COUNT_MAX without having to
check all the constants it could be initialized to based on device
type.

Change-Id: I8482b5d7c455366d69dcda2b13785b305f192b3f
CRs-Fixed: 2128347
2017-11-10 00:27:49 -08:00
bings
be998d8c2d qcacmn: Free sdio hif device when hif_device_inserted fails
hif_device_inserted may be failed when installing sdio wlan module,
which causes memory leak.

To fix this memory leak, free the hif_sdio_dev and its related DMA
buffers when sdio driver fails in hif_device_inserted.

Change-Id: I6ee53cd2a55fbb1492c66caa260ba8b3681526e6
CRs-Fixed: 2131539
2017-11-07 00:01:53 -08:00
Surabhi Vishnoi
6f752b487b qcacmn: Check target address boundary before access
Athdiag procfs entry does not have address sanity check, this is
resulting in invalid ioread32/iowrite32 if out of PCIE BAR address
is used.

Fix this by allowing address with in PCIE BAR range.

Change-Id: I8365eacca7ccc4f489b7d0bda6c998384d0fec7b
CRs-Fixed: 2112270
2017-11-05 20:37:06 -08:00
Dustin Brown
bbba9176f8 qcacmn: Set the initial wake flag on MSI resume
When the wlan driver is suspending, the last thing it does is check to
see if the firmware has indicated a wakeup during the suspend process.
This is done by checking the initial wakeup flag, which is set when a
specific copy engine payload is received from firmware. For the new
dedicated wake MSI, only the wake signal is received, no payload. When
the wake MSI is toggled, set the initial wakeup flag to prevent race
conditions during the suspend process.

Change-Id: Id53cc7884431a437136d8dca068449bc5a25b87c
CRs-Fixed: 2133469
2017-11-01 13:57:00 -07:00
chenguo
23b6502d88 qcacmn: Fix memory leak for RX path of SDIO WLAN
There is a memory leak for RX path of SDIO WLAN if skb allocation
fails. Add condition check and free all resources for scenario.

Change-Id: Ic4a58d3d4e93f1d6d57bfb045dfdeb131b24f72a
CRs-Fixed: 2128051
2017-10-31 17:39:02 -07:00
Sarada Prasanna Garnayak
e9f0e9c77f qcacmn: add device pointer in pld snoc API
Add device pointer in all pld snoc API to support
for numerous WLAN module.

Change-Id: I2e3a296d9b40f14633e0f6e1ed6392536d854552
2017-10-30 05:38:26 -07:00
Yingying Tang
474bba0579 qcacmn: Add "static" to fix compilation error for HL bus
Add "static" before some functions which only be used in 1 file to
resolve the compilation error.

Change-Id: I5bf80fe2e124bf4258c9bfdc997a5423773ca474
CRs-Fixed: 2010227
2017-10-27 13:33:01 -07:00
Sravan Kumar Kairam
26cf747681 qcacmn: Release the spin lock before return
Currently in interrupt handler of per CE, spin lock is taken for
send or receive and returns with out releasing the lock held if
target register access is not allowed. This condition will lead
to kernel panic if some other context is trying for the same lock.

Change-Id: I115f6fbb006d28097168342aa4add3526ad3939d
CRs-Fixed: 2077464
2017-10-27 01:57:52 -07:00
Manjunathappa Prakash
96713609aa qcacmn: Get rid of spinlock lro_unloading_lock
Spinlock "lro_unloading_lock" was required to synchronize the LRO
instance being deleted when there is LRO packet inflight.
With LRO moved to qdf and LRO is tied to hif_napi, LRO instance is
active with life time of the driver. So no need to protect via lock.

Change-Id: I06f7b43e80ddf0ce5e096351b38ce954eb634a95
CRs-Fixed: 2028318
2017-10-26 23:48:06 -07:00
bings
21f4cdaee2 qcacmn: Free sdio global variables scn, ol_sc in hif_sdio_close
When BMI failed in sdio, hif_sdio_dev->claimed_ctx is not set as valid
value. Then scn, ol_sc can't be freed through hif_disable_bus as usual.

To fix this memory leak, free scn, ol_sc in hif_sdio_close.

Change-Id: I96b9b7c86ea6e84a32eec1c57c27ef042673e2e1
CRs-Fixed: 2131452
2017-10-26 21:49:14 -07:00
Yun Park
b5e74bb6ae qcacmn: Fix irq mismatch from wake irq
Fix irq mismatch from wake irq, as well as extra irq free.

Change-Id: Id4415312868e54909521f0016923f859b228db64
CRs-Fixed: 2118005
2017-10-25 17:48:05 -07:00
Balamurugan Mahalingam
1666dd32aa qcacmn: Enable support for Coldboot calibration in IPQ8074 platform
This changes checks the con_mode value and passes corresponding PLD mode value

Change-Id: I08a8f87c3dc92b7af02c36851b27eec800b7f4a7
2017-10-24 04:51:47 -07:00
Govind Singh
bc679dc919 qcacmn: Do not allow CE register access when recovery is in progress
Currently, Shadow registers is not implemented for all registers.
This can lead to unclocked access and followed by NOC errors.
In Rx path Interrupt Status and src/dst read index are directly
accessed without shadow block. Target may execute
reset sequence due to PDR/SSR while rx path is active.

Avoid direct access to below registers if target is crashed due
to PDR/SSR.

HOST_IE_ADDRESS
HOST_IS_ADDRESS
CURRENT_DRRI_ADDRESS
CURRENT_SRRI_ADDRESS

Return from ISR without scheduling the bottom half if target is
crashed due to PDR/SSR.

Change-Id: Ifa993e978579b4d061d21281338494292e19700a
CRs-Fixed: 2123967
2017-10-12 14:22:34 -07:00
Orhan K AKYILDIZ
9e5b93c55c qcacmn: Limit yield log to rx data CEs
A recent change added NAPI yield stats update call for all CEs.
With another receent change that shortened the yield time, we see
a lot of logs complaining about CEs where this particular stats
are not applicable to. Limit the stats update to NAPI CEs.

Change-Id: Ia17a4ddf53ce52116f30d48190f47914721a548e
CRs-Fixed: 2092084
2017-10-12 14:22:24 -07:00
Houston Hoffman
d42ab38aa3 qcacmn: Remove WMI_CONTROL_SVC_WMAC1/2 from the default service map
WMI_CONTROL_SVC_WMAC1/2 services are not supported by adrastea/rome firmware.

Change-Id: Ibf5ab94c44e91f9e61110b5c395c69a408d12b77
CRs-Fixed: 2122123
2017-10-12 14:21:47 -07:00
Dustin Brown
0d7163dbd4 qcacmn: Log failures to prevent PCIe power collapse
Currently there is no indication when calls into pld_wlan_pm_control
fail. Add an error log in such situations to improve debugging.

Change-Id: Ic061a1735878930a5ab55711da58f8bad1a6a8a6
CRs-Fixed: 2119173
2017-10-05 16:11:29 -07:00
Nachiket Kukade
e5738b5a87 qcacmn: Return proper error status from modules under hif_start
Some of the HIF API's that do buffer allocations and operations
return either 0 or 1 as return status. Information is lost since
the same value is returned in case of buffer allocation failures,
queue operation failure or anything else. Caller can't decide if
to perform recovery, graceful failure or BUG_ON.
Return the appropriate error status to the callers.

Change-Id: Idccd3968231d030311fa5581aed78849b729227d
CRs-Fixed: 2105913
2017-10-05 09:20:03 -07:00
Govind Singh
ae820d08e5 qcacmn: Remove diag config from HOST CE config
IHelium uses qmi path for read/write access to
target registers, legacy diag path is not used.
Remove diag config to reduce unnecessary allocations.

Change-Id: Ic251364b5a724c1efd7d34bba55b020189e8e599
CRs-Fixed: 2041887
2017-10-05 09:19:57 -07:00
Jeff Johnson
b945021c30 qcacmn: hif: Replace instances of unadorned %p
Replace instances of unadorned %p in hif.

Change-Id: I282573452a2c12b4bccdbdaab611dcd6f84a6240
CRs-Fixed: 2111274
2017-10-03 16:02:39 -07:00
Sravan Kumar Kairam
bd20096931 qcacmn: At set DMA mask skip IPA version check
Currently while setting DMA mask based on IPA HW version DMA
address bit mask is set. So when IPA is disabled at HW wrong
DMA bit mask is set which leads to allocation failures.

In this change skip IPA version check if IPA HW support is
absent.

Change-Id: I8e438ea012ca889f9d38f22b64207b2a9532a99b
CRs-Fixed: 2067774
2017-10-01 23:41:13 -07:00
Arunk Khandavalli
e14e8e9fcf qcacmn: Fix Dma memory allocation leak from Hif layer
HIF close is not freeing RRI memory allocated during HIF initialization
resulting in memory leak of RRI memory after driver unload

To mitigate the issue, freeing RRI memory in HIF close.

Change-Id: Ib3daba8de0cabc1d8e303d7148448d21c47905e7
CRs-Fixed: 2019147
2017-09-27 20:08:51 -07:00
chenguo
ebc085458b qcacmn: Fix RX dead loop for SDIO WLAN
There is a dead loop when nbuf allocation failed for SDIO WLAN.
Do not change the status back to OK when E_RESOURCE is triggered.

CRs-Fixed: 2112323
Change-Id: I50b8fff99707cdccb1e5e837558131d6777ec9c0
2017-09-24 23:20:23 -07:00
Venkateswara Swamy Bandaru
b3d6b4e446 qcacmn: remove module parameter from dp code
Remove napi_budget module parameter from dp code.

Change-Id: Ib48d08044977da9091f1a1264d219420d7f53962
CRs-Fixed: 2096650
2017-09-21 16:41:57 -07:00
Dustin Brown
49a8f6e37e qcacmn: Prepend kernel includes with "kernel/"
To avoid include conflicts, prepend all kernel includes with "kernel/"

Change-Id: I1c3ae9078d5537b03486afff9c2491881c9f694c
CRs-Fixed: 2098814
2017-09-15 12:22:51 -07:00
psimha
a079b8c678 qcacmn: Deregister HIF ext groups on rmmod
- Deregister & free the hif ext ctx when detaching DP interrupts.
- Unregister the hotcpu_notifier during rmmod.

Change-Id: Icbd3c6cee70b6b224059a4b301b9840485a96d11
CRs-Fixed: 2086729
2017-09-08 19:40:02 -07:00
Houston Hoffman
579c02f570 qcacmn: Provide special sleep_state_adjust api for srng based targets
current pci version of sleep_state_adjust is not supported on srng based targets.

Change-Id: I6ff0c78681cc15c677b6458b3a7d8b571a051925
CRs-Fixed: 2090590
2017-09-08 18:57:10 -07:00
Houston Hoffman
5645dd2803 qcacmn: Use qdf_dbg instead of qdf_print for non-error logs
Stats printing with excessive loops should not go to the console.
Avoids watch-dog bites.

Change-Id: I7b0f9d73139dff97c16f492cbd1cb2d255255b3e
CRs-Fixed: 2091039
2017-09-08 02:37:26 -07:00
Dustin Brown
2af3d67336 qcacmn: Add Wake MSI support
Using the same MSI for wake and copy engines has a number of negative
side effects. Instead, set aside a whole MSI just for the wake
notification from firmware.

Change-Id: If871b88ca255ad970dabb4a7773d2b4d3b71c3fe
CRs-Fixed: 2055359
2017-09-07 17:31:36 -07:00
Govind Singh
903165f2ef qcacmn: Reduce CE msg flush count for SLUB build
With SLUB build in Low memory condition rx processing is taking
more time, reduce CE msg flush count for fastpath in SLUB build.

Change-Id: I8901bd770ca01997299f882394bbe99871d2400e
CRs-Fixed: 2043999
2017-09-07 13:30:34 -07:00
Chris Guo
175e034a96 qcacmn: Fix RX Bus bundle error for SDIO WLAN
Fixed below errors:
1 RX bundle number calculation error.
2 Last bundled PKT block error.
3 RX bundle max checking error.

CRs-Fixed: 2071151
Change-Id: I3cf2cb7e933a47c88ac4916a18234d81ff068d2a
2017-09-05 03:21:56 -07:00
Venkateswara Swamy Bandaru
ed15e74a87 qcacmn: Add support to pass napi budget as module parameter
Add module parameter to pass napi budget for dp interrupts. Default value is
set to 128.

Change-Id: I6b3761c6908ed9cec4e40118a657b39da6ac2532
CRs-Fixed: 2095242
2017-09-01 23:17:18 -07:00
Balamurugan Mahalingam
dcb5226baf qcacmn: Fix PACKET_LOG_SVC service to ce_map for QCA8074
Add a new entry for PACKET_LOG_SVC. FW needs this entry
for initializing packet log CE pipe.

CRs-Fixed: 2094058
Change-Id: I496a2bdf78dd79cc17a60b4f0d227d4e570c93e6
2017-08-31 13:21:38 -07:00
Houston Hoffman
9b55b5fbb9 qcacmn: Fix ce ring timeout interrupt hw work arround
Interrupt was constantly firing because the low_threshold was
improperly configured.  The low threshold needs to be 1 less than
the number of buffers posted when the CE is fully posted.  The
srng backed CE's are setup with nentries - 2 buffers as the fully
posted amount, therefore the threshold needs to be nentries - 3.

Also fixes a bug where a reused variable is not cleared.  This
bug could result in the threshold being set to a garbages value.

Change-Id: Iac840bfd6677683bf2feb42d8bdbd050f42e895d
CRs-Fixed: 2090603
2017-08-31 06:27:43 -07:00
Houston Hoffman
1ef0c77b45 qcacmn: remove QCA_WIFI_NAPIER_EMULATION from pci enable
Use srng based runtime check to bypass legacy register based fw handshakes.
Also remove deprecated emulation based io_remap hack

Change-Id: Idc599bec69a191131e866a2db36d6df3e8e8057f
2017-08-29 20:55:31 -07:00
Venkateswara Swamy Bandaru
4b0ee101ca qcacmn: Fix napi polling issue
Do not enable interrupts and continue polling when there is pending work
group napi poll function.

Change-Id: I51184bc5b97f44a65e0883eb614bc47b2b5ca428
CRs-Fixed: 2094313
2017-08-28 14:47:04 -07:00
Liangwei Dong
7a3433459f qcacmn: add FW self recovery for SDIO
add hif_check_fw_reg implementation for SDIO
solution.

Change-Id: Ic6948cfc7400d93a53e27074a17d5ceac45b558b
CRs-Fixed: 2071352
2017-08-18 21:27:08 -07:00
Poddar, Siddarth
725e9f5a0d qcacmn: Add missing qdf_spinlock_destroy() to free debug cookie
Add missing qdf_spinlock_destroy() to destroy spin lock debug cookie
for SLUB build. For normal builds, qdf_spinlock_destroy() is a NO-OP
function.

Change-Id: If5a3843a468e460952dc64f0e6b5b1fba05ebbb3
CRs-Fixed: 2078940
2017-08-18 05:37:30 -07:00
tfyu
6c7625b2ca qcacmn: Add macro protection for HIF CE
Add macro protection for HIF CE, it shouldn't include the ce head file
when the module is usb or sdio.

Change-Id: Icc38ffaa24581141f86d41afe2db7c5aa944a1cd
CRs-Fixed: 2090621
2017-08-17 03:26:53 -07:00
Prashanth Bhatta
65b0eaa24b qcacmn: Change semantics of Runtime Lock APIs
Runtime PM lock init API right now returns pointer to a context
but this would cause confusion to the caller if feature is not
defined and dummy function return NULL as caller can't find real
failure versus dummy function returning because feature not being
enabled.

Fix declaring a data structure in QDF layer that caller can use
but it hides the internal details of HIF implementation for
Runtime PM locks.

CRs-fixed: 1116509
Change-Id: I4dcba604e803faa0e14fac6403610391895e382e
2017-08-15 13:27:07 -07:00
Karunakar Dasineni
9a4ddd6a40 qcacmn: Compilation fix without FEATURE_NAPI
Fix compilation failures with NAPI disabled.

Change-Id: I5ebd122436b7fc2f85b09880eddd884ca114e121
CRs-Fixed: 2080092
2017-08-14 13:58:08 -07:00
Houston Hoffman
817ff7fc72 qcacmn: Add target type for adrastea chip
Add adrastea target type definitions to hif.h.

Change-Id: Id3183287ecd749577cfc1b71a0cfd96210073612
CRs-Fixed: 2066361
2017-08-11 19:38:21 -07:00
Manjunathappa Prakash
7ddb964c75 qcacmn: Use HOST_INTEREST_ADDRESS from targaddrs.h
WIN side code already uses the address FW interface header file.
No impact on MCL side as these are addresses are for WIN chips.

Change-Id: I540de3adf749d02aa9e56cca3f1f1baa39052dc7
CRs-Fixed: 2066361
2017-08-11 19:38:20 -07:00
Chris Guo
0d276aab16 qcacmn: Enhance t-put for SDIO bus WLAN
Because of wrongly using #ifdef instead of #if, DEBUG_BUNDLE is
always on after enable bus bunlde for SDIO bus WLAN.

CRs-Fixed: 2073795
Change-Id: I7b94dbc0a63dbea2384a455eed1e46d0eb60c530
2017-08-11 05:07:12 -07:00
Venkateswara Swamy Bandaru
9b8dcb46d9 qcacmn: Fix race condition issue with enabling interrupts
Add lock before disabling and enabling group interrups to avoid race
condition between enabling and disabling group interrupts. Avoid mutiple
enabling/disabling of interrupts by maintaining the irq enabled information.

Change-Id: I79afc987e3853de84aaa05321cfcee72cdc0acb0
CRs-Fixed: 2087792
2017-08-10 03:11:59 -07:00
Will Huang
82e91e0541 qcacmn: Check pointer tbuffer always before access it
Pointer tbuffer is allocated from heap or get from other module, it
is checked in some if branch but not every possible NULL branch.

Adding NULL check of tbuffer in every possible branch.

Change-Id: Id3c9f941623995ff73a993e29c53f3b9ce66f10e
CRs-Fixed: 2064350
2017-08-09 19:36:58 -07:00
Poddar, Siddarth
0efe289db5 qcacmn: Perform napi state comparison before releasing napi lock
Release napi spinlock only after performing napi state
comparison to avoid any race condition.

Change-Id: Icd7b713e474a818dfc6d0fa402496bbe06a3af66
CRs-Fixed: 2078294
2017-08-09 19:36:57 -07:00
Will Huang
2411f76c2b qcacmn: Check pointer before dereference it
sync_completion_queue pass to function hif_dev_issue_recv_packet_bundle
may be NULL when asyncProc is true, and this queue pointer will be
dereferenced in HTC_PACKET_QUEUE_ITERATE_ALLOW_REMOVE.

Add checking before dereference this pointer.

Change-Id: I7e6f7923c819a7af8ed5444853ee74ffe1dd1a76
CRs-Fixed: 2071228
2017-08-09 19:36:55 -07:00