msm: kgsl: Map sync lock variables to every pagetable

Map sync lock variables to every pagetable since we don't
use TTBR1 anymore.

Change-Id: If2d43c4c57d0cdcf6076229dfad32c0375e74df4
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
msm: rotator: Wait for the pending commits in finish IOCTL

Due to asynchronuous rotator mechanism, sometimes the
MSM_ROTATOR_IOCTL_FINISH arrives before the previously queued
do_rotate work is completed. This causes fence to be signalled
before the buffer is used by rotator. In case of fast YUV 2 pass
scenario, this causes IOMMU page fault on 2 pass buffers, since
the buffer is unmapped when the rotator is still using it. Hence,
wait for the pending commit works to be finished before releasing
the fence and freeing the 2 pass buffers.

Change-Id: Iec9edd11406d102c7dd102c2ad7935184bbbba93
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm: vidc: Add LTR feature for H264 encoder

This change adds Long Term Reference picture
selection feature for H264 video encoder.

Change-Id: Ida957df244d8715c955afe8d809708123a94e999
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
tty: n_smux: add separate close notifications

When an SMUX port state is closed, the close request is sent to the
remote system.  The port cannot be re-opened until the remote system
acknowledges the close request.  If the client attempts to re-open the
port during this time, then the -EAGAIN error code is returned and the
client must keep retrying to open the port.  An event-driven approach
would be better, but the client does not receive local state
notifications, so this is not possible.

Add local and remote closed notifications so clients can handle the
closing state transitions without using polling.

CRs-Fixed: 510114
Change-Id: I48008804d23dbfd05df0becd4bc1c695e599a835
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
tty: n_smux: fix deadlock between RX and TX workers

smux_handle_rx_open_ack function acquires the channel state spin lock
and tries to add the channel into ready list causing spin lock lockup
between smux_rx_worker thread and smux_tx_worker thread running on
two different CPUs.

Add the channel to ready list after releasing the state spin lock.

CRs-Fixed: 514726
Change-Id: I11729290c5c28a13bed66cf7506b8aaf48a32d2a
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
msm: kgsl: Use no GPU fault tolerance flag passed by UMD driver

Kernel context creation is ignoring "No GPU fault
tolerance" flag passed in by UMD driver. This change forces
kernel to honor "No GPU fault tolerance" flag passed in by
UMD driver and not run GFT on contexts that have this flag set.
Ignoring this flag causes OpenCL to run GFT which is not correct.

CRs-Fixed: 510754
Change-Id: I52b7236d259ec930d07ddae1605e1e683a54d2ba
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: kgsl: Add a check to free the kgsl_timeline object.

Add a check to free the kgsl_timeline object only after
destroy flag is set. This is to avoid further references to timeline
from kgsl if it is already freed and also to catch any unbalanced
kref count.

Change-Id: I8017b9a928a26b703eb92b17ab6a361e4b479e5a
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
ASoC: wcd9304: Fix incorrect detection of headphone

On slow insertion of headphone, if the v_hs_max value
is too high, it can be detected as headset instead of
lineout when the mic is floating. Adjust the value of
v_hs_max to correct plug type detection.

CRs-Fixed: 507511
Change-Id: Ieeef329d93fc2d3ca6ca9c0171f00ceb756ea747
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
msm: camera: Guard the release of resources using mutex

The critical section of the code related to release needs to be
protected against race conditions.

Change-Id: I2165d37168882c345e2f845df08b74eb49b3cb23
CRs-fixed: 518302
Signed-off-by: Alok Kediya <kediya@codeaurora.org>
EHCI: HSIC: Disable CPU Idle states before resuming the port

The CPU idle states are disabled to reduce the USB GPT interrupt
latency during bus resume.  The pm_qos_update_request() is blocked
until all the online cores are brought out of idle states. If this
call is blocked for longer time than resume signaling, the resume
sequence is repeated again.  Fix it by calling pm_qos_update_request()
before resuming the port.

CRs-Fixed: 515547
Change-Id: I651910bf3ac296914af3642718bca3aa07d0d407
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
netfilter: qtaguid: rate limit some of the printks

Some of the printks are in the packet handling path.
We now ratelimit the very unlikely errors to avoid
kmsg spamming.

CRs-Fixed: 509090
Change-Id: I5ced3a04c64973a4856535d3796b4dcf6cf49ed8
Signed-off-by: JP Abgrall <jpa@google.com>
Git-commit: bd91f6b21861cde78d800deede8ebeca0cc0cdd2
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Gayathri <gramai@codeaurora.org>
avtimer: kernel driver to expose avtimer to userspace

This driver expose the API to get LPASS subsystem
out of power collapsed state and exposes ioctl control to
read avtimer tick.

Change-Id: I4b50fbfca5741449a8e5f0d0514f5ca7bccec04d
Signed-off-by: Srikanth Uyyala <suyyala@codeaurora.org>
msm: Add platform driver entry for avtimer

Register avtimer platform driver

Change-Id: I8211cd7c58845389676c5f96b48c6dd68793890c
Signed-off-by: Srikanth Uyyala <suyyala@codeaurora.org>
msm: Update kernel config entry for avtimer

Add avtimer entry in kernel config

Change-Id: Ie479f9787d062819b179539aceda7c7a44f2b924
Signed-off-by: Srikanth Uyyala <suyyala@codeaurora.org>
Merge "msm: rotator: Wait for the pending commits in finish IOCTL"
Merge "netfilter: qtaguid: rate limit some of the printks"
Merge "EHCI: HSIC: Disable CPU Idle states before resuming the port"
Merge "tty: n_smux: add separate close notifications"
Merge "tty: n_smux: fix deadlock between RX and TX workers"
msm: kgsl: Wake up gpu on kgsl_ioctl_timestamp_event only if necessary

Any call of kgsl_ioctl_timestamp_event wakes up gpu. In some cases
(like retired timestamp) it's not necessary. Wake up gpu only if it's
necessary.

Signed-off-by: Vladimir Razgulin <vrazguli@codeaurora.org>
Change-Id: I845faf6e9c6e4c9882a68489b64223919be3d21c