Commit Graph

670 Commits

Author SHA1 Message Date
Nandha Kishore Easwaran
dfa5fa4106 qcacmn: Add 8074V2 type for interrupt handling
Add 8074V2 type check in enable and disable irq
routine.

Change-Id: I0e22d3f6a134c9de2148730efbafed4e1b5eace2
2018-10-09 19:58:43 -07:00
Sathyanarayanan Esakkiappan
29c8fd48da qcacmn: Update Interrupt name list
Update Interrupt name list of dummy_irq handler.

Change-Id: I8e79f6e64a0fec2bb72d4c44cd8647669cbb44cf
2018-10-05 17:39:43 -07:00
Kai Liu
598b1dd3ae qcacmn: claim host only when there are packets to send
Async task thread will claim sdio bus, this claim action will
keep sdio clock on.

During system suspend, after mmc controller suspended, wlan
claim sdio, then it will cause mmc exit suspend as it found clock is on.
Move this claim action before bus transaction to avoid rebundant claim.

Change-Id: I3bab449d0a93c9107c455ee7dbcc6df99ca28636
CRs-Fixed: 2299526
2018-10-04 03:37:10 -07:00
Rajeev Kumar
1de8fdf2ab qcacmn: Do not schedule a work before reschedulign tasklet
Current wifi driver breaks tasklet storm by scheduling a work
whenever wifi driver tasklet reschedules itself to avoid excessive
tasklet storm and wd barks as a side effect. Remove work scheduling
from tasklet reschedule such that tasklets can be rescheduled as
fast as possible and reap CE rings as fast as possible and let linux
kernel handle the tasklet storm by bringing in ksoftirqd as needed.

Change-Id: I985369f534c09903b2d269f858adb88640e4fd2f
Crs-Fixed: 2325935
2018-10-02 19:03:40 -07:00
Alok Kumar
fea70e3c49 qcacmn: Fix qdf_mem_header_assert_valid check failure
In ce_alloc_ring_state(), in case of DMA coherent failure driver
trying to free wrong pointer, instead of allocated pointer which
leads to qdf_mem_header_assert_valid check failure.

Free the actual allocated pointer in case of DMA coherent failure

Change-Id: I227c8240ca37a138335bb0766445564a10493c56
CRs-Fixed: 2320196
2018-10-01 14:59:50 -07:00
Nirav Shah
7c59c2d9b0 qcacmn: Add support for Genoa register definitions
Add support for Genoa register definitions.

Change-Id: I998549c4c19030cbe835882f356eeda3f776b7a0
CRs-Fixed: 2317215
2018-09-28 09:06:32 -07:00
Nirav Shah
59b6c45fbc qcacmn: Changes for QCN7605(Genoa) bringup
1. Add QCN7605 device id for PCIe
2. Enable PLD implementation for QCN7605.
3. Add enable/disable msi interrupt implementation for
   legacy CE.

Change-Id: I8ae8a230bbd7d2d521ad11c0602e32171440ffc8
CRs-Fixed: 2317211
2018-09-25 15:33:48 -07:00
Manjunathappa Prakash
4a010f442d qcacmn: Use %pK to log kernel addresses
Use %pK format string to log kernel module data structure addresses.

Change-Id: Ifd343848d47e022e7cf4bb5832df4bcdc0764273
CRs-Fixed: 2321440
2018-09-25 05:33:44 -07:00
Kiran Venkatappa
f3e6bf1557 qcacmn: Add target service ce map for HKV2
HKV2 has support for three radios. Update Target service map
for HKV2 to map third endpoint for WMI commands corresponding to
third radio.

Change-Id: I9b84dedf1fcddf5c6d43e12c6688d8f9ee7db886
CRs-Fixed: 2313124
2018-09-19 02:54:44 -07:00
Sathyanarayanan Esakkiappan
fa1ddd5447 qcacmn: Trigger IRQ on Peregrine/swift by setting IRQ Bit of LF_TIMER 0
Set Interrupt bit of LF_TIMER 0 to induce interrupt on swift/peregrine

Change-Id: I8a3941262dd7a4b19f8734b4017c9293fbb1b981
2018-09-18 16:17:50 -07:00
Sathish Kumar
86876490f2 qcacmn: CE services separation for legacy and lithium architecture
CE service file includes APIs for both legacy and lithium
architecture.

These are getting compiled for both targets today. Separate the CE
services into legacy and srng and selectively compile based on
targets present in the SoC.

Note: Generic APIs implemented for both legacy and SRNG services
      are separated out through this change. Fast path implementation
      will be de-coupled from common service and moved to legacy source
      in a follow-up change.

CRs-Fixed: 2258640
Change-Id: If86c21c0bf560a360474c9efcdbcd4841a09828d
2018-09-17 21:29:26 -07:00
Venkateswara Swamy Bandaru
33b1bdd1b6 qcacmn: Fix bucket calculation in NAPI case
Take care of corner case when normlized value is just
one more than QCA_NAPI_BUDGET and add normlized to debug prints.

Change-Id: Ife2010b0ada534a487639dbb780e24445d98c045
CRs-Fixed: 2286601
2018-09-17 04:27:02 -07:00
Debasis Das
0c88e0f704 qcacmn: Use wrappers for bus-oriented OS API's
Use appropriate wrappers for bus and platform related
OS API's.

Change-Id: I2b6d16f698816ef4851594717810bda6f167de32
CRs-Fixed: 2297169
2018-09-10 04:25:32 -07:00
Pavankumar Nandeshwar
5bdd94bf14 qcacmn: Disable bh while holding completion_freeq_lock in process context
Avoid deadlocking by disabling bh while holding completion_freeq_lock
operating in process context.

Change-Id: I16b105f68e07939d340ccccfd96f81a37959d5bc
CRs-Fixed: 2308549
2018-09-07 15:33:26 -07:00
Krunal Soni
287dee3f43 qcacmn: Disable CE-IRQ interrupt before cleaning up the tasklets
Current driver calls ce_tasklet_kill API which does
tasklet_disable() first and then does tasklet_kill which invites
race condition as follows.

1) Lets say CPU-0 is executing ce_tasklet_kill() API
   for CE1 (in process ctx) to kill any tasklets associated with CE1-IRQ

2) t1 time- CPU-1 has scheduled the tasklet as part of rescheduled API
   ce_schedule_tasklet(), so this tasklet goes to be scheduled list of
   kernel.

3) t2 time- CPU-0 executes tasklet_disable() and about to execute
   tasklet_kill()

4) t3 time - kernel got a chance and wants to run the tasklet which was
   scheduled at t1 time but it can't because t2 time, tasklet has been
   disable.

5) t5 time- CPU-0 now executes tasklet_kill which checks if any
   tasklet which is in "SCHEDULE" state to go to "RUNNING" state and
   finish and tasklet on CPU-1 can't go to "RUNNING" state due to
   tasklet_disable(), driver is stuck waiting for it to finish.

Fix the situation by removing tasklet_disable()

Change-Id: I3ac56975dc1f6538962060dd20e881c43e7516ca
CRs-Fixed: 2301368
2018-09-05 23:55:47 -07:00
Balamurugan Mahalingam
2b791597da qcacmn: Avoid including hal_api.h for non qca8074 targets
Removing the compilation flags throws compilation error for non
qca8074 targets

Change-Id: I8e83bf229c487cff7db8af41be387b89c2b7fed0
2018-09-04 11:53:45 -07:00
Balamurugan Mahalingam
5d80641550 qcacmn: [1/2] Support both qca8074v1 and qca8074v2 from hal
Some of the macro names defined in qca8074v1, are defined with
a slightly different name in qca8074v2, and few macros have the
same name in both headers but are defined with different values.
Fixed the same.

Change-Id: I5e948baf5326d1d8fdfa2bd7ee8aa072c710d17c
2018-09-04 11:53:36 -07:00
Alok Kumar
7f4494ffc5 qcacmn: Avoid race condition between tasklet schedule and kill
Tasklet get stuck when cds_is_driver_recovering and the driver
state is unloading. It happens due to race between schedule of
tasklet and tasklet_kill. Here one thread is trying to disable &
kill the tasklet while another thread is trying to concurrently
schedule it.

Cancel the tasklet work and make tasklets[i].inited = false before
disabling the tasklet in ce_tasklet_kill() and validate if tasket is
inited before rescheduling the tasklet.

Change-Id: Ib6f4013a73bca8558da097b73535bb8a8f80354d
CRs-Fixed: 2290951
2018-08-21 12:31:40 -07:00
Dustin Brown
041b10a5f7 qcacmn: Fix CE history compilation issue
alloc_mem_ce_debug_history() is currently stubbed out when
HIF_CONFIG_SLUB_DEBUG_ON is defined, leading to silent CE history
collection failure on MCL devices. Fix the #define to include the full
definition of this function when HIF_CONFIG_SLUB_DEBUG_ON is enabled.

Change-Id: I8cd4c81e21a3874d717e361751372912ce38d560
CRs-Fixed: 2299012
2018-08-20 13:28:58 -07:00
Min Liu
c86412881c qcacmn: Remove legacy code
Remove legacy code which is not used

Change-Id: I0cf3e39506d6d1f43738ac706d45ba4aca8fe269
CRs-Fixed: 2288640
2018-08-20 05:29:56 -07:00
Nirav Shah
681004968b qcacmn: HIF: Add logging macros without function/line info
Add per module logging macros without function/line info
to avoid adding function/line info where it is not required.

Change-Id: Id36cbf9e3848a7ea0095c111319bfa5d46cab5af
CRs-Fixed: 2278876
2018-08-14 21:44:19 -07:00
jitiphil
e393cf4170 qcacmn: Deinit CE tasklet work before CE Cleanup
During freeing up of hif_config_de resources, the ce tasklet workers
are deinitialized after the ce cleanup is done. This causes a race
condition between shutdown and ce tasklet in case rescheduling of ce
taslket is done.

Deinitialize the taslket workers before ce structures are deinitialized.

Change-Id: I708711174cf818c0d15ef92c881c8d8aee49e9f1
CRs-Fixed: 2283272
2018-08-13 12:57:57 -07:00
Venkateswara Swamy Bandaru
e8774bdf67 qcacmn: Fix race condition on setting irq_requested to true
Fix race condition on setting irq_requested to true by releasing
spin lock irq_save and taking it again. This will update the irq
flags to the irqs enabled after taking the lock.

Change-Id: Ic68847994fd053b8061d35a346ee65a495c7b725
CRs-Fixed: 2293004
2018-08-11 00:29:38 -07:00
Aditya Sathish
648ce114ab qcacmn: Clean up hif and htc component prints
Clean up hif and htc component prints by correcting trace levels
for regularly occurring prints and removing newlines from converged
print APIs since qdf_trace_msg appends them by default.

Change-Id: I45b1bbe7b16ab7fb8e229b59a094c7382561d658
CRs-Fixed: 2243843
2018-08-10 18:11:24 -07:00
Venkateswara Swamy Bandaru
dbacd5e70f qcacmn: Add hif support for qca8074v2
Add new target type for qca8074v2 and extend target
type checks of QCA8074 for QCA8074V2.

Change-Id: Ib3ff4505e2057fc843b492b9720004dcac042a65
CRs-Fixed: 2292271
2018-08-10 18:11:12 -07:00
Venkateswara Swamy Bandaru
8223158f81 qcacmn: Add qca8074v2 register structures
Add separate register structures for qca8074v2 chip.

Change-Id: Idf2ee0559c48edfb2c1835a6244578143b47f0fa
CRs-Fixed: 2292210
2018-08-09 06:38:51 -07:00
Venkata Sharath Chandra Manchala
509429fee1 qcacmn: Add QCA6390 definitions
Add QCA6390.def file to include QCA6390  definitions

Change-Id: Ibb19c77cedc1c71d70d1a1a1ed70d2228bf1e27d
CRs-Fixed: 2269800
2018-08-08 12:53:54 -07:00
Venkata Sharath Chandra Manchala
79860aa182 qcacmn: Enable QCA6390
1. Allocate and Initialize host and target copy engine configuration
   for QCA6390 based products.
2. Setup Copy engine service map for QCA6390.
3. Add conditional compilation flag QCA_WIFI_QCA6390 to support
   QCA6390 based products.

Change-Id: Ia4dd4d436b8ecae0e9f91faa0c1fe7dbd14f001f
CRs-Fixed: 2259312
2018-08-08 12:53:51 -07:00
Venkateswara Swamy Bandaru
50d811e50d qcacmn: Fix dead lock issue while enabling group interrupts
We are taking spinlock irqsave before requesting group irqs. But some
times interrupt is coming immediately for the iqr we reuested even before
releasing spinlock irqlock. Since We are trying to take same spin lock
again for disabling interruts in irq handler dead lock is happening.
Fixing the issue by not handling irqs coming during request irq time.

Change-Id: I31484ab64942cc9e318139c522aac3d7cef9b109
CRs-Fixed: 2286715
2018-08-07 15:57:40 -07:00
Karthik Kantamneni
c1b9dcf734 qcacmn: Fix invalid memory access while adding napi
When new napi is added unique napi_id is assigned and an entry
is allocated in kernel napi hash table of size 256, vice versa
napi del will remove the entry from hash table. Currently during
driver unload dummy rx napi's(added for GRO case) are not deleted
which causes resource leakage in kernel napi hash table.
While adding new napi if napi_id exceeds hash table size,
then entry from zero index is accessed to find unclaimed
hash entry which trigger invalid entry access since previous
driver unload did not delete napis properly.
In use case where multiple wlan driver instances are used this issue
can be quickly reproducible since it triggers napi_id to exceed
hash table size within less number of driver load/unload.

Fix is to delete rx dummy napi's during driver unload

Change-Id: Idfb24c5c09ebc131c2b19d894d08a8ea34675ed6
CRs-Fixed: 2288118
2018-08-07 08:41:31 -07:00
Dustin Brown
1ec1510b48 qcacmn: Reduce the setup info console logging from hif and htc
Excessive info logging on to console is leading watchdog. Reduce info
logging

Change-Id: I0e098c95bfffb1e8d63a95226552e400cd7f610c
CRs-Fixed: 2287777
2018-08-02 18:30:10 -07:00
Santosh Anbu
dbfae9b995 qcacmn: Add debug log to print length of the buffer
When the number of bytes to be transmitted in HTC is greater than
allocate buffer length, dump_stack messages are seen on console.
For further debugging on the difference in the length of the buffer
this debug log is added.

Change-Id: I63f105b1f2251726fdd31efbabb14c985525b879
CRs-Fixed: 2274020
2018-08-02 02:48:46 -07:00
Nandha Kishore Easwaran
7cdaae2be8 qcacmn: Cleanup CE poll implementation
Change CE poll timer to wake up CPU so that timer kicks in even though
CPU is in idle state. This is needed so that poll happens in regular
10ms intervals. Also made ce_inited false during wifi down path to
prevent polling during wifi down.

Also made some cleanup in polling implementation to remove global scn
flag to enable polled mode and use attr flag to enable per CE polling.

Change-Id: I1d894c99193cc9902fcf4d6cbfd179c557ec6219
CRs-fixed: 2269599
2018-08-01 12:32:00 -07:00
narayan
8235eb53c1 qcacmn: Fix for BMI transaction timed out
Root Cause : We are observing BMI transaction issue beacuase the
             Fw signal is getting timed out as FW independent bit
             is not getting set.
Solution : Read the register value for flushing the PCIe write

Change-Id: I1c877449104dc9e23eaaa18ef848730c81dd5c02
CRs-Fixed: 2266242
2018-07-24 16:58:35 -07:00
Shashikala Prabhu
6cb53789f5 qcacmn: Avoid scheduling ce_tasklet after tasklet_kill call
Description:
Scheduling ce_tasklet after tasklet_kill call creating kernel
panic during dma operations in ce_per_engine_service.
So added changes to avoid scheduling ce_tasklet after
tasklet_kill call.

IR-228333

Change-Id: Ic8758e22c040aae2a007c0ebe8a613caa9263b15
2018-07-24 04:46:23 -07:00
Balamurugan Mahalingam
96d2d41c87 qcacmn: Fix compilation issues and a minor issue
Removed qdf exports on functions defined in target specific
header files and defined those functions as static. Revert
changes on hal_rx_msdu_end_sa_idx_get and make
hal_rx_msdu_end_da_idx_get target specific

Change-Id: I2858b1d77118f0a26b54bf983bd342c7a4fe757d
2018-07-21 00:03:36 -07:00
Balamurugan Mahalingam
54d16a9371 qcacmn: Use txrx_intr_attach function to attach to poll and interrupt
Use appropriate reo dst ring size based on target type

Change-Id: I6e26537d25b4b8d4507acc689b9d17c83aa4d27e
2018-07-21 00:03:25 -07:00
Balamurugan Mahalingam
1b4476e7b6 qcacmn: remove PLD_PCIE_INIT compile flag and use runtime checks
This change will help to have pld and non-based based chipset
to work on the same WIN AP platform.

Change-Id: I778cf0d548f5a8575cd6a4fcc76afd0043e5942b
2018-07-21 00:03:22 -07:00
Rajeev Kumar
b2c14c4f0d qcacmn: Remove qdf_assert from hnc_link_clusters
Remove qdf_assert from hnc_link_clusters as it already
has required debug log.

Change-Id: Id11eb10ad7164ff5347260d3933d633242a8ddd1
CRs-Fixed: 2281122
2018-07-20 16:24:02 -07:00
Qiwei Cai
85cfe85c70 qcacmn: Featurize wlan BMI
Featurize wlan BMI to compile out in mission mode.

Change-Id: I1ac98765e470749d372be508b1f4fcb2a9012cb9
CRs-Fixed: 2259801
2018-07-17 03:48:45 -07:00
Nirav Shah
f1e3fb5c6a qcacmn: Add hif register windowing support
Add hif register windowing support for
Genoa.

Change-Id: I216382aed4dba25ccdcc1126f73f0096f398a5b3
CRs-Fixed: 2265915
2018-07-12 12:34:55 -07:00
c_priys
0757caeff0 qcacmn: Initialize wifi_core_id to default value
During device reset, wifi_core_id will not be initialized if the
target is not in ready state. Hence assigning default value to it.

Change-Id: I91f3f640ed9252351cb82fbde2515c9308992635
CRs-Fixed: 2180836
2018-07-11 14:29:16 -07:00
Will Huang
d6c3b87fcd qcacmn: Fix active_tasklet_cnt mismatch issue
Issue can be reproduced when test D0WOW ROME PCIE.
Multi interrupts may only trigger tasklet one time,
which will cause active_tasklet_cnt mismatch.

Check tasklet/napi scheduled state

Change-Id: I66b5544c4d57fe91eae75d4cf8578e30b498e1fd
CRs-Fixed: 2070872
2018-07-11 14:29:10 -07:00
Rajeev Kumar
49496d088a qcacmn: Enable CE scheduling logging feature
Enable CE schedulign logging feature such that each CE
activity can be recorded for debug purpose. Previous commit
I68a765c6219a2ff2a6a7adc7e8ed031f8957d243 has broken this
debug feature. Fix the CE scheduling logging feature properly
such that its available in SLUB debug enabled builds.

Change-Id: I24ca711378ecda8a8563fe3899fae16ca032f29d
CRs-Fixed: 2272459
2018-07-10 14:06:49 -07:00
Sriram Madhvapathi
6615d89b58 qcacmn: SDIO HIF Layer refactor
1. Modifications for SDIO HIF interface with stack.
 Mailbox based devices do not use the SDIO abstraction layer.
 So, devices like QCA6174, QCA9379 etc are to interface with
 the SDIO stack directly, even if the CNSS wrappers are used.
 ADMA based devices use the SDIO abstraction layer. So, devices
 like QCN7605 do not interface with the SDIO stack directly.

2. Remove redundant osdrv layer and refactor the functions
3. Propagate hif context to all the interface functions in hif
4. Remove duplicate hif object allocation (scn) in SDIO hif

Change-Id: I75cfe97b1ef913d1a3e6e556ec5eff796eb9f1d9
CRs-Fixed: 2271110
2018-07-09 12:58:31 -07:00
Nirav Shah
4c8b78a44c qcacmn: Add support for QCN7605(Genoa)
1. Copy engine assignment changes for Genoa.
2. Add support for QCN7605 device type.

Change-Id: I5cf6b765a51608c27f2ef2e6d3bf45b64875dd6c
CRs-Fixed: 2265278
2018-07-06 03:19:17 -07:00
c_priys
85191774b5 qcacmn: Re-configure interrupt bits once again after FW resets
Issue:
Customer sees a lot of NOC errors after wifi comes up as
FW resets the interrupt bits that host configured and
then checks whether interrupt bits are enabled. FW then enters
into MSI mode without filling the necessary MSI address and MSI
data registers with proper values and this leads to lot
of NOC errors on the platform.

Fix description:
Configure the interrupt bits one more time after FW
resets the registers and then mark the host ready bit
in FW indicator address

CRs-Fixed: 2056198
Change-Id: I7a8871a9878b415ec90c4938df669c6225e79586
2018-07-06 00:16:33 -07:00
Ajit Pal Singh
973024916e qcacmn: Add new definition of usb_hif_get_logical_pipe_num()
Add new definition of usb_hif_get_logical_pipe_num() for Genoa(QCN7605)

Change-Id: I278407b6f373c8a4e0509a1597ca27d83f8104fd
CRs-Fixed: 2266915
2018-07-05 06:42:22 -07:00
Ajit Pal Singh
a63ed8be19 qcacmn: Init tgt_info->target_type for QCN7605 USB
1) Setup target_type for QCN7605(Genoa) USB.
2) Do not reset soc in hif_usb_diag_write_cold_reset() for QCN7605
3) Skip USB_REQ_SET_CONFIGURATION and usb_set_interface() for QCN7605
4) Return false in hif_needs_bmi() for QCN7605

Change-Id: I159b7043d55c5a1a341defde89cd8ccc760bb830
CRs-Fixed: 2266915
2018-07-05 06:42:20 -07:00
Ajit Pal Singh
cd4a1c4308 qcacmn: qcn7605: Add support for HIF_RX_CTRL_PIPE
For QCN7605-USB, WMI_CTRL_SERVICE will use an exclusive
IN USB endpoint.

Change-Id: Ia943c9c3741e91f4b13a85719eee770c08ce8379
CRs-Fixed: 2266915
2018-07-05 06:42:17 -07:00