nf: IDLETIMER: time-stamp and suspend/resume handling.

Message notifications contains an additional timestamp field in nano seconds.
The expiry time for the timers are modified during suspend/resume.
If timer was supposed to expire while the system is suspended then a
notification is sent when it resumes with the timestamp of the scheduled expiry.

Removes the race condition for multiple work scheduled.

Bug: 13247811

Change-Id: I752c5b00225fe7085482819f975cc0eb5af89bff
Signed-off-by: Ruchi Kandoi <kandoiruchi@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_v2: Fix CAMIF stop sequence

Only stop CAMIF immediately if all active PIX and RAW streams
are stopped.

Bug: 13891761
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
Change-Id: Idb0bc8da91a46c997c31c8075f9f4152a63d046d
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
firmware_class: Introduce the request_firmware_direct API

On devices with low memory, using request_firmware on rather
large firmware images results in a memory usage penalty that
might be unaffordable. Introduce a new API that allows the
firmware image to be directly loaded to a destination address
without using any intermediate buffer.

Change-Id: I3ac3c5036c14773125291eccf83d494a8703b4cd
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
msm: peripheral_loader: Use the new request_firmware_direct API

The request_firmware_direct API is more suited to devices
with memory constraints. Replace the call to request_firmware
with this new API.

Change-Id: I7e23c7b1f0728126b2b285addf81beee4d80a2b0
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
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>
net: ipv4: current group_info should be put after using.

Plug a group_info refcount leak in ping_init.
group_info is only needed during initialization and
the code failed to release the reference on exit.
While here move grabbing the reference to a place
where it is actually needed.

Signed-off-by: Chuansheng Liu <chuansheng.liu@intel.com>
Signed-off-by: Zhang Dongxing <dongxing.zhang@intel.com>
Signed-off-by: xiaoming wang <xiaoming.wang@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Conflicts:
	net/ipv4/ping.c

Change-Id: I51931e439cce7f19b4179f5828d7355bb3b1dcfa
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>
Power: Changes the permission to read only for sysfs file
/sys/kernel/wakeup_reasons/last_resume_reason

Also changes the sysfs read callback name so that __ATTR_RO can be used.

Change-Id: I9b625f6cafcb35d207def4157d0fb4a9964104de
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>
msm: vidc: update with fixes and enhancements

Add LTR support for video encoder.
Add control to enable Hierarchical P num.
Enable vp8 error resilience support.
Avoid re-initialize of v4l2 spin lock.
Fix a race condition with core instances list
Add VP8 QP min and max control.
Add support to set VP8 QP range.
Update msm_media_info with MV Color format.
Cleanup v4l2 buffer flags.
Don't erase buffer flags in EBD
Rewrite v4l2 cluster construction
Detect mbaff information from firmware
Add support for setting initial qp
Configure and set hier-p layers
Fix a race condition in cluster construction
Indicate secure sessions in debugfs
Remove non fatal error messages
Query deblocker parameters from cluster
Set error concealment color to FW
Added v4l2 control to set the color of concealed MBs.
Disable Hier-P when LTR is enabled

Signed-off-by: Praveen Chavan <pchavan@codeaurora.org>
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
Revert "Revert "ASoC: msm: Add support for Gapless audio playback""

This reverts commit 9c03acaa075ba26cd18c926cdbd21daeb1c55896.
Revert "Revert "ASoC: qdsp6: Add support for gapless audio playback""

This reverts commit 17cf70155f43a03a03d49e686d7e34ee97f1737b.
ASoC: msm: Enable initial/trailing silence removal

For gapless audio playback, the DSP HW decoder needs to
remove the initial and trailing samples from the decoder
output according to meta data present in the stream. This
change is to enable the silence removal by sending the
meta data down to DSP.

Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
ASoC: msm: qdsp6v2: Fix APR de-register issues during session close

APR de-register should get called for all open streams. The
change handles a case where de-register is not called.

CRs-fixed: 584533
Change-Id: Ied50b68cdf675583e1451954f7ddf40e9c4f53df
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
net: wireless: apply cfg80211 vendor command

apply cfg80211 vendor patch for L-release development

Signed-off-by: broadcom <eccopark@broadcom.com>
(cherry picked from commit 7fcfa25c9fa1e5ba7428f9f76c0f1e485c8278cc)

Change-Id: I3735a092885d7bd1cf52d60502ff52521d53054c
net: wireless: bcmdhd: add GSCAN Support

add GSCAN code in DHD 1.88 v2 (r)
Signed-off-by: Ecco park <eccopark@broadcom.com>
(cherry picked from commit 81653bb1bd03e031556371f2a2858fd3368a9054)

Change-Id: I927da6508de1a26539fc046de72780806266c2d2
Revert "msm: vidc: update with fixes and enhancements"

This reverts commit 5c2139e0d1ee6b64167008cace1814f7a4123f53.

Change-Id: I0305c13ed4def223ad497015ea529609b064d189