Граф коммитов

302 Коммитов

Автор SHA1 Сообщение Дата
Manikandan Mohan
a6d64a1dd6 qcacmn: Fix kernel module check patch warnings in hif sdio files
Fix kernel module check patch warnings in hif sdio files

Change-Id: Ieb1bac5061969538095fad8f0311029b3d3161f0
CRs-fixed: 2033001
2017-05-02 13:29:20 -07:00
Karunakar Dasineni
6622bf43fc qcacmn: Remove dependancy on lithium_top_reg.h
Change definitions of HOST_IE_ADDRESS and HOST_IE_ADDRESS_2 to remove
dependancy on lithium_top_reg.h, which was removed from latest fwcommon headers.

Change-Id: I7dada478ffd58bcf15b8336d7388f98f6522231b
2017-05-02 01:05:06 -07:00
Poddar, Siddarth
55d6da0a41 qcacmn: Fix mem leak of datapath tx ring
when allocation for destination ring fails in ce_init function,
Clean up the complete datapath tx ring.

Change-Id: I7e46396f7a1903207768c79cd07e2dbda1e5a7d2
CRs-Fixed: 2028641
2017-04-18 17:13:59 -07:00
Kiran Venkatappa
c068709444 qcacmn: Fix crash due to corruption in ce_mark_datapath
Use length of service_to_pipe array to loop through services instead of
array size.

Change-Id: I107203861501ed5ac348979868ac981b5a6cd1ae
CRs-Fixed: 2033254
2017-04-13 22:08:52 -07:00
Venkateswara Swamy Bandaru
61824944ab qcacmn: Add API to support configuring external group interrupts
Added API to support configuring external group interrupts for AHB bus.

Change-Id: If65984183db808e68dea680c585692e1533e4c7a
CRs-Fixed: 2018655
2017-04-12 04:02:03 -07:00
Houston Hoffman
ac99ac8eea qcacmn: Update sw index from hw for ce_sendlist_send on data path ces
Fix CE full error when only legacy hif_send_head api is used on a ce configured
to use the fastpath logic.

Change-Id: I59530a0e5ff8b62a1b97007dcd959daa03025785
CRs-Fixed: 2018893
2017-04-11 11:04:44 -07:00
Houston Hoffman
1c72830f3b qcacmn: Unmap ce nbufs before free
freeing mapped memory may lead to resource leaks.

Change-Id: I75664b1a987c1339aa173672c9af670f8b3ffeb8
CRs-Fixed: 2020793
2017-04-11 11:04:42 -07:00
Houston Hoffman
b01db18853 qcacmn: simplify error handling in ce_init(1)
move ce_id_to_state assignment to the end where ce_init
is guaranteed to succeed.

Change-Id: I5172eb1136dde2aad915c2497ece94150c95630f
CRs-Fixed: 2020794
2017-04-11 11:04:42 -07:00
Houston Hoffman
748e1a690f qcacmn: use hif_select_service_to_pipe_map for consistency
Copy pasted logic was not maintained, leading to different
maps being used in different code sections. Also fixes
fw assert where multiple wmi services are not available on
the fw for napier.

Change-Id: Iff3ec8938cc16afe0ebae54244060afb0a7d0b2e
CRs-Fixed: 2030840
2017-04-11 11:04:40 -07:00
Dustin Brown
07d24be439 qcacmn: Implement hif_dummy_map_ce_to_irq
Implement hif_dummy_map_ce_to_irq to prevent runtime errors on new
platforms that do not use hif_map_ce_to_irq.

Change-Id: I9e3da22e237c351ecc9919e69d8d68a656ef7cc9
CRs-Fixed: 2028145
2017-04-11 11:04:36 -07:00
Mohit Khanna
4a76dde9ad qcacmn: stub core_ctl_set_boost if not defined
In hif_napi.c, we are calling this kernel API core_ctl_set_boost. This
API is only present in the kernel if the feature CONFIG_SCHED_CORE_CTL
is present. In case the feature is not present in the kernel, it will
result in a compilation error.
Create a new internal API hif_napi_core_ctl_set_boost as a wrapper
around the kernel API. The new API is stubbed in case the kernel feature
is not present.

Change-Id: Ia52f1110304816670efe3480da3aa78d7b2ecb9e
CRs-Fixed: 2018089
2017-04-11 11:04:31 -07:00
Mohit Khanna
012bfe3098 qcacmn: modify HIF NAPI blacklist mechanism
The existing HIF NAPI blacklist feature uses irq_blacklist_on(off) APIs
which make a call to the userspace irq_balancer.

Replace these APIs with kernel API irq_modify_status to mark (or unmark) the
individual interrupts with IRQ_NO_BALANCING flag. Once marked, the
msm-irq-balancer will not be able to move the CE interrupts around.

Change-Id: I4d780fa8780b42a668006e13a49eb1299304e633
CRs-Fixed: 1114161
2017-04-11 11:04:31 -07:00
Orhan K AKYILDIZ
5bfbc5b35b qcacmn: Make interrupt blacklisting robust
Interrupt blacklisting in kernel 4.4 happens through a user-space
entity. The kernel APIs irq_blacklist_on(off) essentially send
a message to the user space service(irq balancer) and
therefore are not synchronous and do not guarantee that blacklisting
has actually taken effect. It will be granted with some latency
(userspace entity's processing delay).

Make blacklisting more robust by:
a) move irq (if it has been moved around after blacklist_on call
has been made and not yet honored) to the designated CPU
on IRQ reception
b) stop cpu_isolation in blacklisting mode boost API
c) modify NAPI stats to indicate blacklisting mode

Change-Id: I13e478adbed1a6a66d320f69acdb012bee3dc1e8
CRs-Fixed: 1093770
2017-04-11 11:04:30 -07:00
Mohit Khanna
200e660f21 qcacmn: correct napi bucket calculation
NAPI bucket calculation was resulting in bucket number which was out of
bounds for the number of buckets.
Calculate bucket index correctly and check for out of bound
condition.

CRs-Fixed: 1091483
Change-Id: Ieb81b2eeec546a6128c6b878db4c65ccb8b62bda
2017-04-11 11:04:29 -07:00
Mohit Khanna
9ee4b9e84a qcacmn: Use sched_clock instead of jiffies to calc yield time
The current implementation uses jiffies to calculate the yield time and
yields after 2 jiffies. The problem with this is that we end up yielding
anywhere between 1 - 2 jiffies as each jiffies are incremented by 10 ms
intervals. Sometimes we are taking more than 2 jiffies to yield. This
prevents the update of deferrable_timer if its being done at the same
CPU where hif_napi_poll is executing. This may result in the CPU
frequencies not being updated resulting in some fluctuations.

Use sched_clock kernel API to calculate the precise yield time.
Reduce the yield time to 10ms.

Some stats here
- How many times did we have to yield because of time
	(%)0.670391061
	Total Number of completes	1790
	Total Number of complete 0	12
- When we yielded, how much did we exceed the time limit(10ms) by (ms)
	Average	1.327444
	Max	3.381667
	Min	0.037709
- How many HTT Messages did we process when we had to yield
	Average	22.41667
	Max	33
	Min	18
- How much time did we take when we had to yield 10ms + delta above

- How much time did we take when we did not yield (ms)
	Average	0.907641
	Max	8.649
	Min	0
- How many HTT Messages did we process when we did not have to yield
	Average	2.193476
	Max	24
	Min	1

Change-Id: I0d42c716ab8941b1de22a456447797c9ba5475c8
CRs-Fixed: 1089902
2017-04-11 11:04:28 -07:00
Mohit Khanna
518eb5092e qcacmn: Add NAPI statistics to dumpstats
Currently NAPI stats are retrieved as a part of iwpriv getStats command.
The buffer available for this command is limited and NAPI stats get
trucncated.

Add a new dumpStats parameter (9) to dump NAPI stats.

Change-Id: Iaf52a3dcecac2f7b24fde2f8220fbfddc767965b
CRs-Fixed: 1076563
2017-04-11 11:04:27 -07:00
Himanshu Agarwal
38cea4afc4 qcacmn: Reduce log level to avoid watchdog
Reduce log level to info/debug to avoid watchdog bark.

Change-Id: I14a77b9017ada3bc2f10fc78c69cb31b22452052
CRs-Fixed: 2026821
2017-04-04 06:54:50 -07:00
Yue Ma
f271ef063f qcacmn: Make sure no PCIe link access when runtime PM suspended
There should be no PCIe link access from DP fastpath when device has
runtime PM suspended. Runtime PM resume needs to be requested before
such access happens.

Change-Id: I924ea3e3d5b7d823efd3bd10e2be9b36a5998e24
CRs-fixed: 2023358
2017-04-03 18:02:14 -07:00
Yue Ma
9c6f84da99 qcacmn: Resume fastpath DP in correct place for runtime PM
Fastpath DP should be resumed after WOW is disabled from FW. Move
it to correct place.

Change-Id: I9108ee4393cc4ee5f8a232c3de14d68b47aa760e
CRs-fixed: 2023358
2017-04-03 18:02:13 -07:00
Dustin Brown
62af8f3909 qcacmn: Fix Runtime PM compilation issues
Fix several small issues preventing the Runtime PM feature flag from
being enabled by default.

Change-Id: I783a7955c061f40fe4f4342717893cebd32c672b
CRs-Fixed: 2026865
2017-03-31 14:02:59 -07:00
Himanshu Agarwal
bedeed9257 qcacmn: Remove unnecessary QDF_ASSERT to avoid watchdog bark
When bufs needed to post in a CE ring reaches (max no. of entries - 1),
assert happens to print the dumpstack in kmsg. Once this condition is
reached, a work is scheduled to recover CE from this OOM condition which
tries to post buffers in CE. If buf posting fails again, assert will happen
and work will be scheduled again. So, if system is in low memory situation,
then buf allocation and posting will fail leading to assert and work
scheduling again and again in a cycle. Due to these continuous dumpstacks
in kmsg as a result of QDF_ASSERT(), watchdog bark is happening.

Remove QDF_ASSERT from hif_post_recv_buffers_failure() as suffcient prints
and history is present to indicate the situation and so there is no need of
any kind of dumpstack in kmsg.

Change-Id: Ib8bafb9a9fe45c62a15c45fa8a610da2074e058c
CRs-Fixed: 2021793
2017-03-30 05:46:00 -07:00
Houston Hoffman
b12ccb74a0 qcacmn: Support oom recovery for rx ce's
In oom condition, when an rx ce is oom, the ce would
deadlock as the hw couldn't copy any messages (due to the oom)
and the sw wouldn't initiate a pipe refill without a new message.

When this happens submit a work to a workqueue to try and kickstart
the cycle by allocating an nbuf and posting it to the ce.

Change-Id: I047818145dbe230fefc447b6b034705f9b87ca70
CRs-Fixed: 2015778
2017-03-30 05:45:59 -07:00
Houston Hoffman
c0c00a2c46 qcacmn: Improve recv buffer refill failure logging
Make it easier to identify when nbuf allocation starvation
in hif is the root cause for a crash, by adding events to
the hif_ce_desc_history buffer.

Change-Id: Id3b919f17ee79770f5fa81b389f9a28a0670cfa2
CRs-Fixed: 2011015
2017-03-30 05:45:57 -07:00
Houston Hoffman
ff18ea7927 qcacmn: Remove thread unsafe ce_debug varialbes
The use of these static variables could lead to an skb
double free.

Change-Id: I42ebff2c5a713350922e21f4d581c3b8935507e3
CRs-Fixed: 2011773
2017-03-30 05:45:55 -07:00
Houston Hoffman
32f8ccfadc qcacmn: Increase the ring size of the IPA ring
IPA team wants to allocate more buffers and the IPA ring
should be able to hold them all since ipa doesn't have
an error path when the copy engine is full.

Change-Id: I30b8970ce59c7eb4e6a38170a56d6e00e88737fc
CRs-Fixed: 2011766
2017-03-30 05:45:53 -07:00
Houston Hoffman
3891949b8c qcacmn: Increase wmi ce rx ring size
In one log the rx ring is depleted in 2.4 seconds
durring a prolonged period of memory contention.
Double the rx ring size to allow 5 seconds before
the wmi ce is oom.

Change-Id: I2e9a6caeee10f317bd3d70b770fcae3ad2d96623
CRs-Fixed: 2015778
2017-03-30 05:45:52 -07:00
Houston Hoffman
cbcd8397ea qcacmn: Block non-wmi traffic in ce layer durring suspend
Upper layers are failing to block disallowed traffic durring suspend.
Hif can enqueue the messages on the ce rings without letting hardware
know they are there.  When fw is ready to recieve non wmi packets,
hif can inform hw of the queued packets.

Change-Id: I32810d9548416021c1da4f48a4ac539f75f1d907
CRs-Fixed: 2003582
2017-03-30 05:45:50 -07:00
Kiran Venkatappa
564d355833 qcacmn: Fix rmmod crash on 8074 soc emulation setup
Use correct dev_id in free_irq and add conditional check to avoid
access to registers not present on 8074 soc emulation.

Change-Id: I60055b8426b1941fca1b2f238d4e26b47ead54f9
2017-03-29 06:58:08 -07:00
Sathish Kumar
d5b7889c7c qcacmn: Add device ID for multinode support in Hawkeye emulation platform
Include Hawkeye emulation PCI device ids in hif_pci_enable_bus to
support PCI based emulation platform to support multiple nodes.

Change-Id: Iddc4c92a39713e27386c6f9cf64b5efd34b3ba44
CRs-Fixed: 1090092
2017-03-25 04:34:15 -07:00
Dustin Brown
6834d321d8 qcacmn: Fix IRQ disable for unit-test suspend on PCIe
pld_disable_irq is a no-op for PCI devices, causing unit-test resume
to fail in some cases. Define new IRQ disable/enable API's in HIF for
unit-test suspend/resume to use.

Change-Id: Ib3e6007025e791c867463c7d9f64512628c4ca0b
CRs-Fixed: 2023978
2017-03-24 15:16:59 -07:00
Yun Park
42096a2a7a qcacmn: Remove unnecessary NULL check before dereferenced
Pointer is dereferenced after it was positively checked for NULL.
Since the handle should already check for null when we call
cds_get_context, when we recieve the handle as an argument, we should
know that it is not null. So remove the unnecessary null check here.

Change-Id: I9e46c8151dec3ff9d36292d7d306f8bf3ae61b7d
CRs-Fixed: 1111505
2017-03-24 14:16:36 -07:00
Poddar, Siddarth
f53a9b0f41 qcacmn: HIF: Reduce the log spam in Kmsg
Move the logs to appropriate log levels to reduce the log spam in kmsg.

Change-Id: I3b759274d8e4bad13f4390fd906ec487ad5cbd1e
CRs-Fixed: 2019280
2017-03-24 04:18:58 -07:00
Himanshu Agarwal
846cf37306 qcacmn: Do IPA version based DMA coherent mask setting
In case of IPA hw version less than 3.0, only 32 bit DMA
address can be handled as it is only 32 bit compliant.
Because of this, setting DMA coherent mask of 37 when
IPA hw version is less than 3.0, crash is happening.

Do IPA version based DMA coherent mask setting such that
when IPA hw version is less than 3.0, set DMA coherent mask
as 32 only.

Change-Id: I8dec7da47766985ab0590f885b29f345f153cd08
CRs-Fixed: 1114605
2017-02-23 07:29:54 -08:00
Kiran Venkatappa
e17e3b63e0 qcacmn: Support per mac CE for WMI commands
Firmware requires WMI commands to be sent on different copy engine for
each MAC. Change CE assignement to support this.

Change-Id: I91a2422a944741dc25c3bf45b18cde30e7409632
CRs-Fixed: 2005214
2017-02-22 11:13:16 -08:00
Sarada Prasanna Garnayak
ed8018ded1 qcacmn: optimize the usage of runtime PM spinlock
Analyze the critical section of the runtime PM feature
and replace the spin_lock_irqsave with spin_lock_bh.
Disabling the IRQ and usage of spinlock for runtime PM
debugging, logging and warning feature Is not required,
remove the usage of spinlock from this context.

The runtime PM APIs which is used for the prevent/allow
runtime PM suspend /resume can be use spin_lock_bh instead
of spin_lock_irqsave. For the runtime PM APIs add check point
to identify the IRQ context, If the runtime PM APIs calling
from IRQ  context report WARN_ON for debugging purpose.

CRs-Fixed: 1112447
Change-Id: If06970c6ac610a0128344e8c25a9cdd57b2542a3
2017-02-15 14:15:10 -08:00
Yu Wang
1e487a58a6 qcacmn: fix bus-open-failure for BUS_TYPE_SDIO
Failed to open sdio bus for HL target, due to
missing of 'break' in 'switch' case.

Add 'break' for QDF_BUS_TYPE_SDIO

Change-Id: I0d43a61c89828f76223c9f95f4de41a76381c7bb
CRs-Fixed: 2004349
2017-02-14 16:28:07 -08:00
Sathish Kumar
2d2f19a6ca qcacmn: Add device id for multi-node support in Hawkeye M2M
Include Hawkeye emulation PCI device ids in probe list to enable
PCI based emulation platform to support multiple nodes.

Change-Id: I539c099912e5e7fa4865f57a139f5e75c1b06462
CRs-Fixed: 1090092
2017-02-13 22:22:30 -08:00
Houston Hoffman
bb3ac37d02 qcacmn: Remove unneeded pktlog prototypes from hif
hif is not responsible for pktlog.  These prototypes
do not need to be defined here

Change-Id: I9dd99b9cb7ec9aa5f0763d8f6cc0e9f95d13c016
CRs-Fixed: 2004398
2017-02-10 18:10:35 -08:00
Houston Hoffman
f60a3488d0 qcacmn: Add config flag to use shadow registers
For platforms that don't use QMI and have firmware
enable shadow registers, host needs to ignore the
shadow register configuration it calculated.

Change-Id: I91a3d9a0c65172afde6a2ddab61651f9f8683aee
CRs-Fixed: 2003581
2017-02-10 18:10:34 -08:00
Govind Singh
23a1564da5 qcacmn: Do not copy buffer to user-space if diag read fails
ATH diag procfs read is copying read_buffer to user space
unconditionally, causing kernel heap information leak of
uninitialized read_buffer if hif diag read fails.
Do not copy buffer to user space if diag read fails to
avoid information leak to user space.

Change-Id: I5e07cad4f90e5e9b3c461268b8fa3635c3128b9f
CRs-Fixed: 1104731
2017-02-07 09:56:35 -08:00
Houston Hoffman
e49a538582 qcacmn: Ensure shadow_v2 config is initialized
Fix a crash durring hif_wlan_enable where the shadow_v2 was
dereferenced while pointing to garbage memory.

For legacy ce, uninitialized values from the stack were left
in the pld shadow_v2 config.  The checks to skip printing the
shadow_v2 config were confused by uninitized stack memory and
the driver tries to dereference unitialized shadow_v2 memory.

Ensure the configuration is filled with NULL & 0 when it is
not applicable.

Change-Id: I668fcf78b1a7c8e6e235d96e428a9808a4e072c7
CRs-Fixed: 2001315
2017-02-03 11:43:01 -08:00
Houston Hoffman
72ddc02a93 qcacmn: Propperly free ce recv buffers durring driver unload
Ce recv buffers that were given to hardware and never returned
need to be freed.

Change-Id: I427ef993110e24dcbbc1891fe3eb456f688526ae
CRs-Fixed: 2000136
2017-01-31 18:53:13 -08:00
Houston Hoffman
3274fbc178 qcacmn: Remove ce_debug_cmplsn_context_srng
static globabl variables are not thread safe.

Change-Id: Ib315051d6a1da99740b501131cae449f8440e83c
CRs-Fixed: 2000140
2017-01-31 18:53:11 -08:00
Houston Hoffman
d2e9dcd716 qcacmn: balance spin_lock_create (lro)
Adding lock stats print upon spinlock & mutex destroy.
The spinlock destroy of the lro unloading lock in the
napi context did not match the create in location.
When a station adapter goes down and is brought back up,
the mismatch appears.

Change-Id: I137e6ffce3fb23f32a085b9fa36b065449a6d8a1
CRs-Fixed: 1111956
2017-01-31 18:53:06 -08:00
Houston Hoffman
a4b5f900be qcacmn: Don't flush irq_enable register write
The Common subsystem shutdown is allowed after the irq_enable
register is written.  A race condition in host (multiple other
interrupts firing on the same core). Can delay the register read
and allow the common sub system to be shutdown before the read.
The read would then cause an SNOC error as the register is unclocked.

Change-Id: Icb90c185eabcbd63b28b02bdf5c1de2d06d3620e
CRs-Fixed: 1108494
2017-01-31 18:53:05 -08:00
Houston Hoffman
03f4657b7b qcacmn: balance spin_lock_create (ce)
Adding lock stats print upon spinlock & mutex destroy.
Without the destroy api invoked the lock stats are not printed.

Change-Id: I50b4db8412e336fcc22514be3ae4aaa2188415a8
CRs-Fixed: 1100505
2017-01-31 18:53:03 -08:00
Houston Hoffman
3c84105dc1 qcacmn: balance spin_lock_create (napi)
Adding lock stats print upon spinlock & mutex destroy.
Without the destroy api invoked the lock stats are not printed.

Change-Id: Id3c432e1f6982ea47bdf1de5c15f1a3568df4eb9
CRs-Fixed: 1100505
2017-01-31 18:53:02 -08:00
Orhan K AKYILDIZ
0f521bf9be qcacmn: Harden NAPI event handler
Make sure that NAPI event handler would handle events only
after it has been initialized. Check init flag before procesing
the event and emit a warning and return an error to the caller.

Change-Id: I9d2b84560ee2363ecf2a570dbef0275dfb87786a
CRs-Fixed: 1091678
2017-01-31 13:14:49 -08:00
Houston Hoffman
403c2df426 qcacmn: Fix wmissing errors in shadow_register code
hif_prepare_hal_shadow_register_cfg and hif_print_hal_shadow_register_cfg
needed to be declared static after enabling "Werror=missing-prototypes"

Change-Id: I3682436edb7bcb3ee02f1c4037aefc82863c0ec5
CRs-Fixed: 1113131
2017-01-30 22:18:23 -08:00
Houston Hoffman
10fedfc050 qcacmn: move shadow_config_v2 to srng services
Wish to keep ce_main.c independent of hal.

Change-Id: Ia1caddc9cb81ac996955ad316e4646a4abc8b876
CRs-Fixed: 1113131
2017-01-30 22:18:22 -08:00