Revert "ARM: msm: hammerhead: Update wlan locale translation table"

This reverts commit 2063faa0a2a2f0b1cd57091a79e1f586cd2592a7.
ARM: msm: hammerhead: Remove DFS channels in default locale

Change-Id: Ic61e5c029d9a7043c0e60401db8f91c784e73cd3
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
msm: camera: Add support for RAW streams in camera

Add suport for raw streams in ISP driver.

Change-Id: I5121981f63d656d08a72f362a6a9621031226dab
Signed-off-by: Rajakumar Govindaram <rajakuma@codeaurora.org>
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
msm: camera2: cpp: Append frame buffers to the list

In case of late buffer allocation, allocated buffers
have to be appended to the existing queues.

Change-Id: Ie14f00038e86b9d7c8caa01587a2ed1aee7d80e8
Signed-off-by: Iliya Varadzhakov <ivarad@codeaurora.org>
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
msm: camera: Fix buffer index mismatch for HAL buffer

AXI irq could arrive before EOF irq. Because of this,
folowing changes are made:

1. Set request_frame flag during IOCTL instead of waiting
until EOF, and
2. Set AXI skip flag during SOF instead of EOF.

Bug: 13887745
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
Change-Id: I25a238e2cfae0e3a792a3689e00e16bc46dcb9d0
net/ipv6/addrconf: fix wdog_bark caused by infinite spinning on a deadlock

A synchronization issue may occur while addrconf_ifdown(),
when it updates inet6_addr_lst[] with already destroyed *ifp
by ipv6_add/del_addr(), using the same addrconf_hash_lock.

[core 0]                                        [core 1]
   |                                               |
   |->ipv6_add_addr                                |->addrconf_ifdown
       |                                               |
       |                                               |-> spin_lock(&addrconf_hash_lock);
       |                                               |-> remove ifa->addr_lst from inet6_addr_lst
       |                                               |-> spin_unlock(&addrconf_hash_lock);
       |-> spin_lock(&addrconf_hash_lock);             |
       |-> add ifa->addr_lst to inet6_addr_lst[hash]   |
       |-> spin_unlock(&addrconf_hash_lock);           |
       |-> write_lock(&idev-lock);                     |
       |-> add ifa->if_list to idev->addr_list         |
       |-> write_unlock(&idev->lock);                  |
       |                                               |-> write_lock(&idev->lock);
       |                                               |-> remove ifa->if_list from idev->addr_list
       |                                               |-> write_unlock(&idev->lock);

[28055.378524] ------------[ cut here ]------------
[28055.378591] WARNING: at net/ipv6/addrconf.c:546 inet6_ifa_finish_destroy+0x98/0xc8()
[28055.378691] [<c010de1c>] (unwind_backtrace+0x0/0x144) from [<c09fd08c>] (dump_stack+0x20/0x24)
[28055.378747] [<c09fd08c>] (dump_stack+0x20/0x24) from [<c0192adc>] (warn_slowpath_common+0x58/0x70)
[28055.378840] [<c0192adc>] (warn_slowpath_common+0x58/0x70) from [<c0192bec>] (warn_slowpath_null+0x2c/0x34)
[28055.378931] [<c0192bec>] (warn_slowpath_null+0x2c/0x34) from [<c0911a90>] (inet6_ifa_finish_destroy+0x98/0xc8)
[28055.379026] [<c0911a90>] (inet6_ifa_finish_destroy+0x98/0xc8) from [<c091498c>] (addrconf_ifdown+0x2e4/0x430)
[28055.379120] [<c091498c>] (addrconf_ifdown+0x2e4/0x430) from [<c0915b70>] (addrconf_notify+0xe4/0x3ac)
[28055.379209] [<c0915b70>] (addrconf_notify+0xe4/0x3ac) from [<c01b9df0>] (notifier_call_chain+0x54/0x94)
[28055.379321] [<c01b9df0>] (notifier_call_chain+0x54/0x94) from [<c01ba3ac>] (__raw_notifier_call_chain+0x24/0x2c)
[28055.379379] [<c01ba3ac>] (__raw_notifier_call_chain+0x24/0x2c) from [<c01ba3dc>] (raw_notifier_call_chain+0x28/0x30)
[28055.379475] [<c01ba3dc>] (raw_notifier_call_chain+0x28/0x30) from [<c0840ea4>] (call_netdevice_notifiers+0x38/0x60)
[28055.379568] [<c0840ea4>] (call_netdevice_notifiers+0x38/0x60) from [<c0844d5c>] (__dev_notify_flags+0x3c/0x6c)
[28055.379657] [<c0844d5c>] (__dev_notify_flags+0x3c/0x6c) from [<c0844dcc>] (dev_change_flags+0x40/0x58)
[28055.379747] [<c0844dcc>] (dev_change_flags+0x40/0x58) from [<c08d2834>] (devinet_ioctl+0x79c/0x8bc)
[28055.379837] [<c08d2834>] (devinet_ioctl+0x79c/0x8bc) from [<c08d3488>] (inet_ioctl+0x1c0/0x1d0)
[28055.379928] [<c08d3488>] (inet_ioctl+0x1c0/0x1d0) from [<c082d7f0>] (sock_ioctl+0x80/0x248)
[28055.379982] [<c082d7f0>] (sock_ioctl+0x80/0x248) from [<c0275364>] (do_vfs_ioctl+0x94/0x5bc)
[28055.380071] [<c0275364>] (do_vfs_ioctl+0x94/0x5bc) from [<c0275908>] (sys_ioctl+0x7c/0x8c)
[28055.380164] [<c0275908>] (sys_ioctl+0x7c/0x8c) from [<c0107300>] (ret_fast_syscall+0x0/0x30)
[28055.380252] ---[ end trace 920b8b321354f066 ]---
[28061.735021] Watchdog bark! Now = 28061.735014
[28061.735106] Watchdog last pet at 28050.179294
[28061.735245] cpu alive mask from last pet 0-3
[28061.735321] Causing a watchdog bite!

The addrconf_hash_lock should cover both modification of inet6_addr_list and idev->addr_list
to resolve any possible synchronization issue between addrconf_ifdown() and ipv6_add/del_addr().

Bug: 11293746
Signed-off-by: David C. Park <davidc.park@lge.com>
netlink: fix possible spoofing from non-root processes

[ Upstream commit 20e1db19db5d6b9e4e83021595eab0dc8f107bef ]

Non-root user-space processes can send Netlink messages to other
processes that are well-known for being subscribed to Netlink
asynchronous notifications. This allows ilegitimate non-root
process to send forged messages to Netlink subscribers.

The userspace process usually verifies the legitimate origin in
two ways:

a) Socket credentials. If UID != 0, then the message comes from
   some ilegitimate process and the message needs to be dropped.

b) Netlink portID. In general, portID == 0 means that the origin
   of the messages comes from the kernel. Thus, discarding any
   message not coming from the kernel.

However, ctnetlink sets the portID in event messages that has
been triggered by some user-space process, eg. conntrack utility.
So other processes subscribed to ctnetlink events, eg. conntrackd,
know that the event was triggered by some user-space action.

Neither of the two ways to discard ilegitimate messages coming
from non-root processes can help for ctnetlink.

This patch adds capability validation in case that dst_pid is set
in netlink_sendmsg(). This approach is aggressive since existing
applications using any Netlink bus to deliver messages between
two user-space processes will break. Note that the exception is
NETLINK_USERSOCK, since it is reserved for netlink-to-netlink
userspace communication.

Still, if anyone wants that his Netlink bus allows netlink-to-netlink
userspace, then they can set NL_NONROOT_SEND. However, by default,
I don't think it makes sense to allow to use NETLINK_ROUTE to
communicate two processes that are sending no matter what information
that is not related to link/neighbouring/routing. They should be using
NETLINK_USERSOCK instead for that.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
prctl: adds PR_SET_TIMERSLACK_PID for setting timer slack of an arbitrary thread.

Second argument is similar to PR_SET_TIMERSLACK, if non-zero then the
slack is set to that value otherwise sets it to the default for the thread.

Takes PID of the thread as the third argument.

This allows power/performance management software to set timer slack for
other threads according to its policy for the thread (such as when the
thread is designated foreground vs. background activity)

Change-Id: I744d451ff4e60dae69f38f53948ff36c51c14a3f
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
input: SynaImage_ds5: Firmware E079 (ORISE)

- Improved noise peak filter (increase from 60 to 70)
- Increased IM threshold of switching into 60Hz
- Increased software filter delay
- Less frequency shifting in noisy state
- Improved low temperature environment

Change-Id: I58a79c034ee1600cc7a2b79c48bf2ef2594efecb
Signed-off-by: Jongrak Kwon <jongrak.kwon@lge.com>
net: Fix "ip rule delete table 256"

[ Upstream commit 13eb2ab2d33c57ebddc57437a7d341995fc9138c ]

When trying to delete a table >= 256 using iproute2 the local table
will be deleted.
The table id is specified as a netlink attribute when it needs more then
8 bits and iproute2 then sets the table field to RT_TABLE_UNSPEC (0).
Preconditions to matching the table id in the rule delete code
doesn't seem to take the "table id in netlink attribute" into condition
so the frh_get_table helper function never gets to do its job when
matching against current rule.
Use the helper function twice instead of peaking at the table value directly.

Originally reported at: http://bugs.debian.org/724783

Reported-by: Nicolas HICHER <nhicher@avencall.com>
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reduce min capture period size from 320 to 64

Change-Id: I8d6ed9d06e49561e9a9db51940b997f321a1ae87
msm: camera: Directly use stride from buffer_plane_info

stride is already in the unit of bytes. Just need to convert
it to units of 64-bit words.

Bug: 14395767
Change-Id: I57960371911c492cab7d5ca5f710ca0f16572d77
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
arm/dt: msm8974: Enable Microphone Activity Detection

Add Microphone Activity Detection(MAD)'s slimbus device ID and configure
MCLK as a supply of MAD to add MAD support.

Reference CAF commit: 43a3f2d086f6f37acc91fc96cf6d4e887da880d7

Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
video: slimport: Fix the case of TV power off

When slimport is connected and TV is off.
slimport will keep seeking for hdmi connection and not notify it.
For the case of this, when connection lost,
Call power down and init, to initialize and wait for connection

Change-Id: I9bbf8b82d77ee69fb758adf8f1805fc88f17700a
Signed-off-by: Se Hun Kim <sean2.kim@lge.com>
video: slimport: Fix unblanced IRQ enable

If irq_enabled is set again, it causes the unblanced IRQ enable problem and
slimport would be not working properly. So if irq_enabled is set again,
In order to fix the problem, disable the irq and initialize the flags.

Change-Id: I27ad8ae7d553e515e15dd87744c221dbbb3a0717
Signed-off-by: Devin Kim <dojip.kim@lge.com>
video: slimport: Set/clear sp_tx_pd_mode in the power control function

sp_tx_pd_mode is the flag if tx power is down or not. So it should be
controlled in the power control function.

Change-Id: I394acbd6c6125dce8725aa81193b7be2abdf47b0
Signed-off-by: Devin Kim <dojip.kim@lge.com>
msm: mdss: hdmi: Ensure the audio has completed its processing

Before hdmi tx core is off, the audio should be completed its processing.

Change-Id: Ida370027fdcbf88fcbe6bc4ae9c2a48a5476e096
Signed-off-by: Devin Kim <dojip.kim@lge.com>
video: slimport: Do not access the sp registers after power down

The burst i2c errors sometimes causes a watchdog reset. The i2c errors
are caused by accessing the sp registers after SP is power down. So
do not access the sp register after power down to avoid the watchdog reset.

Change-Id: If64b0bf6f437292f356fa165d4203d522c26cfe6
Signed-off-by: Devin Kim <dojip.kim@lge.com>
cpufreq: interactive: Revert timer start modification

commit f8b276565ce95bd788af0fc8d060f92632590a40
(cpufreq: Sync on thread migration optimizations)
introduced a change to cpufreq_interactive_timer_start() in order
to reschedule the timer differently based on whether min or max
is changed. A better way is to reschedule the timer only when
necessary.

Revert timer start modification in preparation for the final fix.

Change-Id: I13f3b75a6eee03ac6380c24db899806a9bfbc96a
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
cpufreq: interactive: restructure CPUFREQ_GOV_LIMITS

The cpufreq_interactive_timer gets cancelled and rescheduled
whenever the cpufreq_policy is changed. When the cpufreq policy is
changed at a rate faster than the sampling_rate of the interactive
governor, then the governor misses to change the target frequency
for long duration. The patch removes the need of cancelling the
timers when policy->min is changed.

Change-Id: Ibd98d151e1c73b8bd969484583ff98ee9f1135ef
Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com>
Git-commit: 9b97d655a558607c5d46ef1f21365d695f8d1ee2
Git-Repo: https://android.googlesource.com/kernel/common.git
[junjiew@codeaurora.org: resolve merge conflicts]
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>