Commit graph

564526 commits

Author SHA1 Message Date
Rohit Gupta
e80ff9a87c cpufreq: Add Input Boost feature to the cpu-boost driver
On incoming input events boost the frequency of all online cpus
for at least input_boost_ms ms. This is accomplished by changing
the policy->min of all the online cpus to input_boost_freq.

Change-Id: Idb0ab75d68ae4ceff259cbbaaec1a9bb3bc871d3
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
2016-03-23 19:58:41 -07:00
Rohit Gupta
43cc939d93 cpufreq: Add a sync limit to cpu-boost
Perform frequency synchronization only when source CPU's frequency
is less than sync_threshold, else sync to the sync_threshold.

Change-Id: I544c414568d4e015b80ce5891dd215275bac95da
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
2016-03-23 19:58:41 -07:00
Saravana Kannan
2014424f4a cpufreq: cpu-boost: Add cpu-boost driver
When certain bursty and important events take place, it might take a while
for the current cpufreq governor to notice the new load and react to it.
That would result in poor user experience. To alleviate this, the cpu-boost
driver boosts the frequency of a CPU for a short duration to maintain good
user experience while the governor catches up.

Specifically, this commit deals with ensuring that when "important" tasks
migrate from a fast CPU to a slow CPU, the frequency of the slow CPU is
boosted to be at least as high as the fast CPU for a short duration.

Since this driver enforces the boost by hooking into standard cpufreq
ADJUST notifiers, it has several advantages:
- More portable across kernel versions where the cpufreq internals might
  have been rewritten.
- Governor agnostic and hence works with multiple governors like
  conservative, ondemand, interactive, etc.
- Does not affect the sampling period/logic of existing governors.
- Can have the boost period adjusted independent of governor sampling
  period.

Change-Id: Ibd814a20043d0aba64ee7637a4a79b9ffa1b0991
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
[rameezmustafa@codeaurora.org]: Port to msm-3.18]
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
[joonwoop@codeaurora.org: fixed conflict in drivers/cpufreq/Kconfig.]
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2016-03-23 19:58:40 -07:00
Srivatsa Vaddagiri
74463329e4 sched: window-based load stats for tasks
Provide a metric per task that specifies how cpu bound a task is. Task
execution is monitored over several time windows and the fraction of
the window for which task was found to be executing or wanting to run
is recorded as task's demand. Windows over which task was sleeping are
ignored. We track last 5 recent windows for every task and the maximum
demand seen in any of the previous 5 windows (where task had some
activity) drives freq demand for every task.

A per-cpu metric (rq->cumulative_runnable_avg) is also provided which
is an aggregation of cpu demand of all tasks currently enqueued on it.
rq->cumulative_runnable_avg will be useful to know if cpu frequency
will need to be changed to match task demand.

Change-Id: Ib83207b9ba8683cd3304ee8a2290695c34f08fe2
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
[rameezmustafa@codeaurora.org]: Port to msm-3.18]
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
[joonwoop@codeaurora.org: fixed conflict in ttwu_do_wakeup() to
 incorporate with changed trace_sched_wakeup() location.]
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2016-03-23 19:58:39 -07:00
Srivatsa Vaddagiri
97ae7bae2c sched: Make scheduler aware of cpu frequency state
Capacity of a cpu (how much performance it can deliver) is partly
determined by its frequency (P) state, both current frequency as well
as max frequency it can reach.  Knowing frequency state of cpus will
help scheduler optimize various functions such as tracking every
task's cpu demand and placing tasks on various cpus.

This patch has scheduler registering for cpufreq notifications to
become aware of cpu's frequency state. Subsequent patches will make
use of derived information for various purposes, such as task's scaled
load (cpu demand) accounting and task placement.

Change-Id: I376dffa1e7f3f47d0496cd7e6ef8b5642ab79016
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
[joonwoop@codeaurora.org: fixed minor conflict in kernel/sched/core.c.]
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2016-03-23 19:58:38 -07:00
Matt Wagantall
5f10bd75eb sched/debug: Make sysrq prints of sched debug data optional
Calls to sysrq_sched_debug_show() can yield rather verbose output
which contributes to log spew and, under heavy load, may increase
the chances of a watchdog bark.

Make printing of this data optional with the introduction of a
new Kconfig, CONFIG_SYSRQ_SCHED_DEBUG.

Change-Id: I5f54d901d0dea403109f7ac33b8881d967a899ed
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2016-03-23 19:58:37 -07:00
Steve Muckle
521a572def tracing/sched: add load balancer tracepoint
When doing performance analysis it can be useful to see exactly
what is going on with the load balancer - when it runs and why
exactly it may not be redistributing load.

This additional tracepoint will show the idle context of the
load balance operation (idle, not idle, newly idle), various
values from the load balancing operation, the final result,
and the new balance interval.

Change-Id: I1538c411c5f9d17d7d37d84ead6210756be2d884
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
[rameezmustafa@codeaurora.org: Initialize variables in load_balance() to
				avoid crashes and inaccurate tracing.]
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
[joonwoop@codeaurora.org: fixed minor conflict in
 include/trace/events/sched.h.]
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2016-03-23 19:58:36 -07:00
Steve Muckle
387dcd0663 sched: change WARN_ON_ONCE to printk_deferred() in try_to_wake_up_local()
try_to_wake_up_local() is called with the rq lock held. Printing to
console in this context can result in a deadlock if klogd needs to
be woken up. Print to the kernel log buffer via printk_sched()
instead which avoids the wakeup.

Change-Id: Ia07baea3cb7e0b158545207fdbbb866203256d3c
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
2016-03-23 19:58:35 -07:00
Arun Bharadwaj
9f6eb26ae8 tracing/sched: Track per-cpu rt and non-rt cpu_load.
Add a new tracepoint trace_sched_enq_deq_task to track
per-cpu rt and non-rt cpu_load during task enqueue
and dequeue.

This is useful to visualize and compare the load on
different cpus and also to understand how balanced
the load is at any point of time.

Note: We only print cpu_load[0] because we only care about
the most recent load history for tracking load balancer
effectiveness.

Change-Id: I46f0bb84e81652099ed5edf8c2686c70c8b8330c
Signed-off-by: Arun Bharadwaj <abharadw@codeaurora.org>
2016-03-23 19:58:34 -07:00
Srivatsa Vaddagiri
0ec4cf2484 sched: re-calculate a cpu's next_balance point upon sched domain changes
A cpus next_balance point could be stale when its being attached to a
sched domain hierarchy. That would lead to undesirable delay in cpu
doing a load balance and hence potentially affect scheduling
latencies for tasks. Fix that by initializing cpu's next_balance point
when its being attached to a sched domain hierarchy.

Change-Id: I855cff8da5ca28d278596c3bb0163b839d4704bc
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
[rameezmustafa@codeaurora.org: Modify commit text to reflect dropped patches]
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
2016-03-23 19:58:34 -07:00
Steve Muckle
63249df6b2 sched: provide per cpu-cgroup option to notify on migrations
On systems where CPUs may run asynchronously, task migrations
between CPUs running at grossly different speeds can cause
problems.

This change provides a mechanism to notify a subsystem
in the kernel if a task in a particular cgroup migrates to a
different CPU. Other subsystems (such as cpufreq) may then
register for this notifier to take appropriate action when
such a task is migrated.

The cgroup attribute to set for this behavior is
"notify_on_migrate" .

Change-Id: Ie1868249e53ef901b89c837fdc33b0ad0c0a4590
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
[rameezmustafa@codeaurora.org: Use new cgroup APIs, fix 64-bit
			compilation issues and resolve some merge
			conflicts. Also squash "2bd8075 sched:
			remove migration notification from RT class"
			into this patch.]
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
[joonwoop@codeaurora.org: Incorporated with new __migrate_task().]
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2016-03-23 19:58:33 -07:00
Srivatsa Vaddagiri
82f6fb4f5c sched: Fix SCHED_HRTICK bug leading to late preemption of tasks
SCHED_HRTICK feature is useful to preempt SCHED_FAIR tasks on-the-dot
(just when they would have exceeded their ideal_runtime). It makes use
of a a per-cpu hrtimer resource and hence alarming that hrtimer should
be based on total SCHED_FAIR tasks a cpu has across its various cfs_rqs,
rather than being based on number of tasks in a particular cfs_rq (as
implemented currently). As a result, with current code, its possible for
a running task (which is the sole task in its cfs_rq) to be preempted
much after its ideal_runtime has elapsed, resulting in increased latency
for tasks in other cfs_rq on same cpu.

Fix this by alarming sched hrtimer based on total number of SCHED_FAIR
tasks a CPU has across its various cfs_rqs.

Change-Id: I1f23680a64872f8ce0f451ac4bcae28e8967918f
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
[rameezmustafa@codeaurora.org]: Squash "c24fb502 sched: fix reference to
				wrong cfs_rq" into this patch]
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
2016-03-23 19:58:32 -07:00
Steve Muckle
2c04026b17 kernel: reduce sleep duration in wait_task_inactive
Sleeping for an entire tick adds unnecessary latency to
hotplugging a cpu (cpu_up).

Change-Id: Iab323a79f4048bc9101ecfd368e0f275827ed4ab
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
[rameezmustafa@codeaurora.org]: Port to msm-3.18]
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
2016-03-23 19:58:31 -07:00
Steve Muckle
03ab01a318 sched: add sysctl for controlling task migrations on wake
The PF_WAKE_UP_IDLE per-task flag made it impossible to enable
the old behavior of SD_SHARE_PKG_RESOURCES, where every task
migrates to an idle CPU on wakeup.

The sched_wake_to_idle sysctl value, when made nonzero, will cause
all tasks to migrate to an idle CPU if one is available when the
task is woken up. This is regardless of how PF_WAKE_UP_IDLE is
configured for tasks in the system. Similar to PF_WAKE_UP_IDLE,
the SD_SHARE_PKG_RESOURCES scheduler domain flag must be enabled
for the sysctl value to have an effect.

Change-Id: I23bed846d26502c7aed600bfcf1c13053a7e5f61
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
(cherry picked from commit 9d5b38dc0025d19df5b756b16024b4269e73f282)
2016-03-23 19:58:30 -07:00
Matt Wagantall
cc06d4a91d sched/rt: Add Kconfig option to enable panicking for RT throttling
This may be useful for detecting and debugging RT throttling issues.

Change-Id: I5807a897d11997d76421c1fcaa2918aad988c6c9
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
[rameezmustafa@codeaurora.org]: Port to msm-3.18]
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
[joonwoop@codeaurora.org: fixed conflict in lib/Kconfig.debug]
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2016-03-23 19:58:29 -07:00
Matt Wagantall
841af4dbae sched/rt: print RT tasks when RT throttling is activated
Existing debug prints do not provide any clues about which tasks
may have triggered RT throttling. Print the names and PIDs of
all tasks on the throttled rt_rq to help narrow down the source
of the problem.

Change-Id: I180534c8a647254ed38e89d0c981a8f8bccd741c
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
[rameezmustafa@codeaurora.org]: Port to msm-3.18]
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
2016-03-23 19:58:28 -07:00
Steve Muckle
74b3b06c52 sched: add PF_WAKE_UP_IDLE
Certain workloads may benefit from the SD_SHARE_PKG_RESOURCES behavior
of waking their tasks up on idle CPUs. The feature has too much of a
negative impact on other workloads however to apply globally. The
PF_WAKE_UP_IDLE flag tells the scheduler to wake up tasks that have this
flag set, or tasks woken by tasks with this flag set, on an idle CPU
if one is available.

Change-Id: I20b28faf35029f9395e9d9f5ddd57ce2de795039
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
[joonwoop@codeaurora.org: fixed conflict around set_wake_up_idle() in
 include/linux/sched.h]
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2016-03-23 19:58:27 -07:00
Srivatsa Vaddagiri
8da8122d5f sched: Make the scheduler aware of C-state for cpus
C-state represents a power-state of a cpu. A cpu could have one or
more C-states associated with it. C-state transitions are based on
various factors (expected sleep time for example). "Deeper" C-states
implies longer wakeup latencies.

Scheduler needs to know wakeup latency associated with various C-states.
Having this information allows the scheduler to make better decisions
during task placement. For example:

- Prefer an idle cpu that is in the least shallow C-state
- Avoid waking up small tasks on a idle cpu unless it is in the least
  shallow C-state

This patch introduces APIs in the scheduler that can be used by the
architecture specific power-management driver to inform the scheduler
about C-states for cpus.

Change-Id: I39c5ae6dbace4f8bd96e88f75cd2d72620436dd1
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2016-03-23 19:58:27 -07:00
Sreelakshmi Gownipalli
fc116784df diag: Add snap shot of diag driver
Add snap shot of diag driver

Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
2016-03-23 19:58:26 -07:00
Mayank Rana
0163608079 usb: gadget: cdev: Add USB serial driver functionality
This change adds below functionality:
1. Add USB serial driver functionality
2. Add configfS support
3. Enable USB character serial driver

Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-03-23 19:58:25 -07:00
Girish Mahadevan
203411ee67 drivers: of: Add snapshot of of_slimbus driver
Add snapshot of of_slimbus driver from msm-3.18 tree.
3.18 baseline
e70ad0cd5efdd9dc91a77dcdac31d6132e1315c1

Change-Id: I1bd2a767b238b4cf0184bc778940cd3a9eef2e9b
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
2016-03-23 19:58:24 -07:00
Mayank Rana
d559208e1a usb: Rename u_data_bridge.c as f_cdev.c
To reduce depedency on f_serial.c, this change rename u_data_bridge.c
as f_cdev.c and USB serial functionality shall be added on this driver.

Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-03-23 19:58:23 -07:00
Mayank Rana
3c2bb805ce usb: u_data_bridge: Check for USB cable connect with gbridge_port_write()
There is NULL pointer crash seen due to accessing port->port_usb from
gbridge_port_write() when port bridge application's write thread is
pre-empted and USB cable disconnect is being performed. Fix this issue
by adding check for USB cable is connected or not and handling USB
request accordingly.

Change-Id: Ide14de298b7186cbe7b7af1e99c8c47bc389130b
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-03-23 19:58:22 -07:00
Mayank Rana
ea1cd34463 usb: u_data_bridge: Lower DTR on USB cable disconnect to modem
When DUN call is operational and USB cable is being disconnected,
DTR is not being lowered with modem. This results into no DUN call
functionality on next USB cable connect case. Fix this issue by
lowering DTR to modem on USB cable disconnect.

This change also returns zero instead of -EAGAIN when there is no
write USB request available. Also it moves port open interrupted
message loglevel from pr_err() to pr_debug to reduce logging on
serial console.

Change-Id: I3259417aceee2713d7765c9de34ace4ea2d3ed96
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-03-23 19:58:21 -07:00
Mayank Rana
4687a02e76 usb: u_data_bridge: Check allowable size with gbridge_port_write()
Currently gbridge_port_write() is not checking size of user space
provided data and directly copies buffer into USB request buffer
which is having size as 2KB. If user space application writes data
bigger than 2KB, copy_from_user() tries to copy data beyond allocated
USB request buffer size which results into memory corruption. Fix
this issue by checking allowable size with gbridge_port_write() and
making sure that it doesn't copy data beyond allocated buffer size.

Change-Id: I7a34e37f5d1609792374f07b70542b80edbe6944
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-03-23 19:58:21 -07:00
Mayank Rana
df2968af9f usb: u_data_bridge: Improve USB RX (read) functionality
This change handles below cases and improves performance:
1. If USB OUT request buffer is bigger than provided read buffer
from application, then data equal to read buffer is copied. This
results into data loss. Handle this case by making sure that
whole USB OUT request buffer is provided to application across
multiple read() call.

2. If read buffer size is greater than available data as part of
one USB OUT request buffer, then copy data from other USB OUT
request buffers until read buffer is filled completely.

Change-Id: If2756ed82bd6e95650ebcc38c4042bfb593f8a2b
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-03-23 19:58:20 -07:00
Mayank Rana
3cbb89d1a4 usb: u_data_bridge: Return error when no USB TX request available
In some cases, it has been observed that all USB TX requests are
queued with USB controller and port bridge is trying to write data.
gbridge_port_write() API is returning zero (success of data) instead
of error code which results into data loss. Hence return -EAGAIN
when there is no USB TX request available. Also mark this error as
non-fatal by using pr_debug() here.

Change-Id: Id56788b372b62a005448a729e5f00de6fb895e47
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-03-23 19:58:19 -07:00
Mayank Rana
1ec29eb231 usb: u_data_bridge: Fix handling of USB RX requests
Currently on USB composition switch or USB cable disconnect,
USB RX requests are being added as part of read_queued list
instead of read_pool. In some cases it is seen that if port
bridge is trying to read data, those requests are requeued
and fails with -ESHUTDOWN, and again it continues with results
into watchdog timeout due to error log coming from read request
completion handler. Fix this by adding proper check in read
request completion handler.

Also reduce USB Tx/RX buffer size from PAGE_SIZE to 2048 bytes.
It also fixes issue where USB RX requests are not being queued
after USB composition switch.

CRs-Fixed: 854301
Change-Id: I3616dc35c093cfa19865891f46e7b1ccc7302573
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-03-23 19:58:18 -07:00
Mayank Rana
aae7a3ff40 USB: gadget: Add support for DUN Character Driver
This driver provides character device node (/dev/at_usb0)
to user space application for file operations like open,
close, read, write, poll and ioctl (for control signals).
This change also adds required support to use this new
character bridge driver with existing USB Serial driver
and android gadget driver.

Change-Id: I26f297636de585d3fd99d10fac76ecb71f852df3
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-03-23 19:58:17 -07:00
Rohit Vaswani
e95affa994 power_supply: smbcharger: use psy pointers to check init
The current driver uses a boolean flag psy_registered to track
whether the power supplies are initialized. Instead check if the
psy pointers are non null to ensure they are initialized.

Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
2016-03-23 19:58:16 -07:00
Rohit Vaswani
638f324728 irqchip: Compile IRQ_MSM
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
2016-03-23 19:58:15 -07:00
William Clark
745f49266d defconfig: Seemp: add seemp functionality
Needed to add seemp functionality

Change-Id: I43b4eee9191adc7777b9cb937bc4cd0e455dc198
Signed-off-by: William Clark <wclark@codeaurora.org>
2016-03-23 19:58:15 -07:00
Mona Hossain
e0f32de9cf qmp: Add support for QSSP Enhancements
update seemp_api header file
update seemp_parm_id header file
update seemp_core to log data with blk header set to 64B
remove logging from fs proc base and net socket modules

Change-Id: I583e3129d62651b155b0372e173564d5a17e3153
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2016-03-23 19:58:14 -07:00
William Clark
7a494e6444 seemp: add more seemp parameters
Add more seep parameters for frameworks refactoring.

Change-Id: I9807ef0dc6d5a54c82dea64cec68be3fd0ff7396
Signed-off-by: William Clark <wclark@codeaurora.org>
2016-03-23 19:58:13 -07:00
William Clark
5f0d2109e1 seemp: prevent assert
The change fixes event parameter encoding for seemp. It will
prevent an assert in seemp functioning

Change-Id: Ib3681d526a1dfb45cd5de5a40ee8cf07e02296dd
Signed-off-by: William Clark <wclark@codeaurora.org>
2016-03-23 19:58:12 -07:00
William Clark
0990b37505 seemp: enhance support for malware detection
Improves the ability of a malware protection program
to detect anomalies in various activities. It records
task activities in a log and rates the actions
according to how a typical user would use the tools.

Change-Id: I976bc97f57215f173b046326b5f905522d785288
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: William Clark <wclark@codeaurora.org>
2016-03-23 19:58:11 -07:00
Maya Erez
c7a777070b defconfig: msm8996: Enable wil driver
Enable wil driver as module for MSM8996.
Wil driver is needed for 11ad wireless card.

Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-03-23 19:58:10 -07:00
Hamad Kadmany
915823609a msm_11ad: Enable driver by default
Enable 11ad msm platform driver by default. The driver
must be built-in within kernel so that by default it turns
off any power related to the 11ad chipset when connected
to msm.

Change-Id: Ice3a85fcd5e3c10fbe3193d52d6d4cf26f0abe74
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
2016-03-23 19:58:10 -07:00
Maya Erez
cd958296ac wil6210: enable WA for PCIe HW errata
WA for HW errata for PCIe in MSM8998 v1, QCTDD02664351.
Due to this issue, PCIe write ordering rule may be violated
causing cluster to read older data from its L2 cache, in specific
scenario.

To avoid that for wil6210 rx transactions, we set "no snoop" for
PCIe wr transactions (from device to host).
For configuring the above bit 4 of 0x8812C4 register is set.

Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-03-23 19:58:09 -07:00
Maya Erez
faab237c9c wil6210: handle multiple connect/disconnect events
In the current solution wil6210 configures the vring in a worker
and holds only one pending CID. This implementation may lead to
race conditions between connect and disconnect events of multiple
stations or fast connect/disconnect events of the same station.

In order to allow the removal of the connect worker and handling of
WMI_VRING_CFG_DONE_EVENTID in the connect event, the WMI replies
that provide the reply in a given buffer needs to be handled
immediately in the WMI event interrupt thread.
To prevent deadlocks, WMI replies that requires additional
handling are still handled via the events list.

Change-Id: I81f08011ef98be845d98fbe15d98bbf050032f88
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: 0916d9f2b6bea53a830ae5061b63a515c04da62e
Git-repo: https://github.com/kvalo/ath.git
CRs-Fixed: 971604
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-03-23 19:58:08 -07:00
Maya Erez
fdf67e3dd1 wil6210: find TX vring only if vring_tx_data is enabled
In TX vring allocation, vring_tx->va is allocated before WMI command to
configure the vring is sent to the device. As the WMI command can take
time to complete, it can lead to scenarios where vring_tx->va is not NULL
but vring is still not enabled.

This patch adds a check that vring_tx_data is enabled before returning
a valid TX vring.

Change-Id: I21bad8fdbb7bb0ff8fe0447efb94dbfd69f4e6b0
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: b729aaf066b013458e95cd6c69a5e371eb9ce355
Git-repo: https://github.com/kvalo/ath.git
CRs-Fixed: 971604
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-03-23 19:58:07 -07:00
Maya Erez
f4309fe27e wil6210: handle tx completions only if vring tx data is enabled
wil_vring_fini_tx is called in disconnect in order to free the
allocated vrings.
wil_vring_fini_tx is disabling the vring_tx_data before napi_synchronize
is called in order to avoid the tx handling of this vring, while
wil_vring_free is called only after napi finished the current handling
of the tx completed packets.
Due to that, in case of disconnect, wil6210_netdev_poll_tx can be called
when vring->va is not NULL but vring_tx_data[i]->enabled is already
disabled.

This patch checks vring_tx_data[i]->enabled in wil6210_netdev_poll_tx
to prevent handling of disabled vrings.

Change-Id: I6c38be5b47eb3c34ccb4b503545fccada26806e4
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: 640751ac30b2ddfbe06ad712aa7d57a8d89a7eef
Git-repo: https://github.com/kvalo/ath.git
CRs-Fixed: 971604
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-03-23 19:58:06 -07:00
Lior David
92009e8020 wil6210: use extra IEs from probe response
In the start_ap/change_beacon API, when we set up probe response
offloading, we only use the IE list from the probe response
template and not the IE list from the proberesp_ies argument.
As a result, we miss important IEs and it causes problems with
some scenarios such as P2P.
With this change, we merge the list of IEs from the probe response
template and proberesp_ies and send the merged list to the FW
for offloading. It is still FW responsibility to filter out
irrelevant IEs when sending probe response, based on the actual
contents of the probe request.
Also in case association response termplate is not provided,
we will use the merged list of IEs from probe response in the
association response as well.

Change-Id: Ic21e9a70f64af67c630dc710ccd6825879f872b6
Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: c100c883e785802ab333604237928a65ae62c6bc
Git-repo: https://github.com/kvalo/ath.git
CRs-Fixed: 970919
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-03-23 19:58:05 -07:00
Lior David
00ffb353aa wil6210: fix privacy flag calculation in change_beacon
Currently the privacy flag calculation in change_beacon
checks for RSN IE inside proberesp_ies, but normally it
is not found there. It works today because of code inside
the function wil_fix_bcon, but wil_fix_bcon is not directly
related to change_beacon, and it may be changed or removed
in the future and break the calculation.
To fix this issue, change the privacy flag calculation
to check RSN IE inside the beacon itself. The new check is more
reliable and will not be sensitive to changes in wil_fix_bcon.

Change-Id: Ida5b55f6456d04e22303fedddc8c77c5ad081177
CRs-Fixed: 970919
Signed-off-by: Lior David <liord@codeaurora.org>
2016-03-23 19:58:04 -07:00
Maya Erez
5e89efd09c msm_11ad: add VDD and VDDIO regulators voting
On platforms where the power supply for 11AD is external
the wil6210 driver has to vote for the VDD and VDDIO regulators.

This patch adds such voting and guarantees the required
voltage for each regulator.

Change-Id: I472fe6b0600557bc4e623a3dd1b6352fd4a86e27
[merez@codeaurora.org: using regulator_set_load]
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-03-23 19:58:04 -07:00
Lior David
add338b4a5 msm_11ad: add support for subsystem_restart framework
Add 11ad as a subsystem (WIGIG) within the subsystem_restart
framework, in order to allow proper support for recovery from
11ad firmware crashes, and support automated collection of
crash dumps for offline analysis and bug reporting.

Change-Id: I7acbe8860e046cdba2ce027f91ed2fa995a70c70
Signed-off-by: Lior David <liord@codeaurora.org>
[merez@codeaurora.org: fixed merge conflicts]
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-03-23 19:58:03 -07:00
Lior David
f9b44400f7 wil6210: support for platform specific crash recovery
Added a simple interface for platform to perform crash
recovery.
When firmware crashes, wil driver can notify the platform
which can trigger a crash recovery process. During
the process the platform can request a ram dump
from the wil driver as well as control when firmware
recovery will start. This interface allows the platform
to implement a more advanced crash recovery, for
example to reset dependent subsystems in proper order, or
to provide its own notifications during the recovery process.

Change-Id: I2545d220b779c24931b6263249449f37bcad75a4
Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: ea3ade75db690dc47c78a77d71dfd7c2df3bb15d
Git-repo: https://github.com/kvalo/ath.git
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-03-23 19:58:02 -07:00
Hamad Kadmany
eba9e63599 wil6210: fix kernel OOPS when stopping interface during Rx traffic
When network interface is stopping, some resources may
be already released by the network stack, and Rx frames
cause kernel OOPS (observed one is in netfilter code)

Proper solution is to drop packets pending in reorder buffer.

Change-Id: Id043d466135f20fe980814380e6f01e2554c22e3
Signed-off-by: Hamad Kadmany <qca_hkadmany@qca.qualcomm.com>
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: dea16eddb4753129dbcd8dc8d1a58ff0cc4ea38c
Git-repo: https://github.com/kvalo/ath.git
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-03-23 19:58:01 -07:00
Dan Carpenter
5a45ce7b35 wil6210: fix a warning message condition
"iter" is -1 at the end of the loop and not zero.  It means we don't
print a warning message.

Change-Id: I532bd54fbdafb92e71205c317ae5d467c4cd5f3b
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: f94c48d6c315a580b60b062c0360561b61faa311
Git-repo: https://github.com/kvalo/ath.git
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-03-23 19:58:00 -07:00
Maya Erez
fa8629d210 wil6210: prevent external wmi commands during suspend flow
In __wmi_send we check if fw is ready at the beginning of the function.
While we wait for the completion of the previous command, system suspend
can be invoked and reset the HW, causing __wmi_send to read from HW
registers while it is not ready.
Taking the wmi_mutex in the reset flow when setting the FW ready bit
to zero will prevent the above race condition.

Change-Id: I5d2e823a27beaeaaf5b8b1e25457c158efd3ea46
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-03-23 19:57:59 -07:00