Commit 998de4a
Lets try to pull legacy
import drivers/staging/prima_legacy
import prima 3.1.7.11

Conflicts:
	drivers/staging/Kconfig
Import Prima v3.1.7.16
cfg80211: fix regulatory NULL dereference

commit de3584bd62d87b4c250129fbc46ca52c80330add upstream.

By the time userspace returns with a response to
the regulatory domain request, the wiphy causing
the request might have gone away. If this is so,
reject the update but mark the request as having
been processed anyway.

Cc: Luis R. Rodriguez <lrodriguez@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
cfg80211: fix race on init and driver registration

commit a042994dd377d86bff9446ee76151ceb6267c9ba upstream.

There is a theoretical race that if hit will trigger
a crash. The race is between when we issue the first
regulatory hint, regulatory_hint_core(), gets processed
by the workqueue and between when the first device
gets registered to the wireless core. This is not easy
to reproduce but it was easy to do so through the
regulatory simulator I have been working on. This
is a port of the fix I implemented there [1].

[1] https://github.com/mcgrof/regsim/commit/a246ccf81f059cb662eee288aa13100f631e4cc8

Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Conflicts:
	net/wireless/reg.c
cfg80211: amend regulatory NULL dereference fix

commit 0bac71af6e66dc798bf07d0c0dd14ee5503362f9 upstream.

Johannes' patch for "cfg80211: fix regulatory NULL dereference"
broke user regulaotry hints and it did not address the fact that
last_request was left populated even if the previous regulatory
hint was stale due to the wiphy disappearing.

Fix user reguluatory hints by only bailing out if for those
regulatory hints where a request_wiphy is expected. The stale last_request
considerations are addressed through the previous fixes on last_request
where we reset the last_request to a static world regdom request upon
reset_regdomains(). In this case though we further enhance the effect
by simply restoring reguluatory settings completely.

Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
wireless: Protect regdomain change by mutex

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
cfg80211: fix interface combinations check.

commit e55a4046dab28c440c96890bdddcf02dc8981f2d upstream.

Signed-off-by: Lukasz Kucharczyk <lukasz.kucharczyk@tieto.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
msm: cpufreq: Fix store_powersave_bias to account for sync' CPUs.

Current code assumes that all online CPUs runs their own timers to
collect CPU samples for demand based switching (dbs). But in case of
synchronous CPUs, ondemand governor registers only one timer at init
time because both CPUs are accounted in the same timer call. Hence
trying to restart/cancel dbs timers for all online CPUs is not legal
for these CPUs. This change fixes above function to restart/cancel
timers only once for group of synchronous CPUs.

Change-Id: I23f1697783a65f125679a07a076620e8fa5e62d5
Signed-off-by: Krishna Vanka <kvanka@codeaurora.org>
msm: cpufreq: Fix the race between dbs_refresh and hotplug.

The demand based switching responds to input events and schedules
work items on all online cpus to increase the frequency. This will
call the dbs_refresh_callback on respective cpu. If this work item
kicks in while cpu1 is progressing its way through cpufreq_add_dev,
there is a chance that work item grabs the cpu_policy_rwsem of cpu1
and relases that of cpu0, when add device is working through releas-
ing lock of cpu1 and reaquiring that of cpu0. This is locking out
cpu1 when it tries to come up online next time. The fix is hold the
hot plug lock while processing refresh work items.

CRs-Fixed: 362444
Signed-off-by: Krishna Vanka <kvanka@codeaurora.org>
(cherry picked from commit a3e04d8b2b5d996a75fc89a14d7fc1a0efe03e73)

Change-Id: I09cfcc03eb7a76ca1baa69a03228848eef989908
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
cpufreq: Make the "scaling_governor" sysfs node pollable

A userspace module programs different qos-rules depending on the
governor running in the system. Make the governor node
pollable, so that the userspace module can be triggered when
the value of the governor changes.

change-Id: Ic89c77c7d16b0f8954d59a211612e9a8e98a2c28
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
(cherry picked from commit 37d0b028bf4c8f877f7c0137ea430bd2a73c9461)

Signed-off-by: Dhivya Subramanian <dthiru@codeaurora.org>
cpufreq: fix utilization statistics for sync cpus

If the cpus are using related_cpus policy, then the
current implementaion will overwrite the the calculated
load for every iteration in the for loop. Hence, mpdecision
will read incorrect value, if the cores are using related
cpus policy. With this change mpdecision will read the
sum of the loads of all cpu's, if related cpu policy is
used.

Change-Id: I242c8fe39fd75dc3e48750a5b78a5d218b536ddd
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
cpufreq: Add a boostpulse interface to ondemand

For applications that require a one-shot increase in frequency,
the boostpulse interface would help to scale to max for the time
specified in boostime. This helps applications that currently
increases scaling_min_freq and resets later after a fixed duration.
Instead of changing scaling_min_freq applications can directly write
to boostpulse and governer resets during regular timer after the time
expires.

Change-Id: Ie5f490ff06b41364aa76dd468573433495da28a4
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>

Conflicts:

	drivers/cpufreq/cpufreq_ondemand.c
cpufreq: notify avg load for short sampling_rate

If the sampling rate is less than 50ms reporting
the actual load may lead to poor decision making
at user space. So, for sampling rates less than 50ms
report the average of load across two samples.

Change-Id: I0d1cf00801732bee8e4380158d7e892758226594
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>

Conflicts:

	drivers/cpufreq/cpufreq_ondemand.c
cpufreq: boost the sampling rate on touch event

For better Ux responsiveness ondemand sampling rate
needs to be 20ms. But, a 20ms sampling rate increases power
consumption. So, boost the sampling rate to 20ms on every
touch event for 2.5 ms and later reset to default rate.
Also, change sampling down factor proportional to the
sampling rate.

Change-Id: I111b1cf3b8ed133347149afc34d329d0384ecfcb
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
cpufreq: ondemand: Fix the boostpulse interface

Change-Id: I86ad61f462f23c5f9a32b12e4f64f33fc391c8f8

Conflicts:

	drivers/cpufreq/cpufreq_ondemand.c
cpufreq: ondemand: Add duration for boosting

Change-Id: I838d58edd8107adf726d2991d74f7bfd3927ea87
drivers/cpufreq: Add max duration for boosting

Change-Id: I87b180ecf52bf1dfe8e3bfe3be8731fea888e600