ASoC: msm: Change QOS value for low latency path

There were variations in the time taken to
return from each write. This was due
to the delay in switching in and out of
power collapse. To manage this set QOS
value to 1ms so that the core has enough
time to wake up from power collapse

Signed-off-by: Alexy Joseph <alexyj@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
Revert "ASoC: msm: Decrease the playback period size of PCM driver"

This reverts commit b0580099ac7d5e735fb42946612a499bf196cda1.

Change-Id: I487797334cf75978daa3c536ff92de8a54b1f7fb
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
ASoC: msm: Flexible period size for pcm playback

PCM driver was configured for fixed buffer
size on the playback path. With this, varying
the buffer sizes on the playback path was not
possible. To fix this, support for flexible
period sizes is added by setting different
values for min and max buffer sizes

Change-Id: I7f69db4940f67e5e3a795101af1b1682afbdb530
Signed-off-by: Alexy Joseph <alexyj@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
msm: kgsl: Use the kmalloc/vmalloc trick for the sharedmem page array

It was previously assumed that most GPU memory allocations would be
small enough to allow us to fit the array of page pointers into one
or two pages allocated via kmalloc.  Recent reports have proven
those assumptions to be wrong - allocations on the order of 32MB will
end up trying to get 8 pages from kmalloc and 8 contiguous pages
on a busy system are a rare beast indeed.

So use the usual kmalloc/vmalloc trick instead - use kmalloc for the
page array when we can and vmalloc if we can't.

CRs-fixed: 513469
Change-Id: Ic0dedbad0a5b14abe6a8bd73342b3e68faa8c8b7
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: kgsl: send ringbuffer NOP padding with the next command

If there isn't enough room at the bottom of the ringbuffer for a
whole command, the remaining space is filled with NOPs and
the command starts again at the top of the ringbuffer, the write
pointer of the ringbuffer shall update accordingly; the existing
implementation sends out in-complete NOP command which may potentially
cause GPU hang. This fix submits the NOP command along with the next
command instead of submitting them separately to have GPU read both
commands in the same fetch.

Change-Id: Ia3c9933c11d986c6743d8026b809bbcb1eaf54bf
Signed-off-by: Zhong Liu <zhongl@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>
msm: pm: add failed stats

for idle and suspend failed cases the stats
are not updated correctly, they are just added to
success bucket.

This patch is to log the failed stats separately.

Change-Id: I4b290944e3f4b74ada13ef0ba51b812c83b5ec5d
Signed-off-by: Venkat Devarasetty <vdevaras@codeaurora.org>
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
ASoC:msm: Increase Proxy buffering

-Proxy buffering can overflow if BT
playback setup takes a lot of time
-Fix this by increasing the proxy
buffer size so that we will end
up buffering the additional data that
can come in during this time

Change-Id: I736937ad03684a3b9aff586b8f676ec60259a442
Signed-off-by: Alexy Joseph <alexyj@codeaurora.org>
u_hsuart: Fix a bug in opening the SMUX port

commit 9fdf017a (tty: n_smux: add separate close notifications)
implemented SMUX_LOCAL_CLOSED notification for clients to know
when the port is ready for opening again.  Use this notification
and defer opening until the port is ready.  If the port is opened
before this notification is arrived, the open will fail and
rmnet/dun does not work.

CRs-Fixed: 509013
Change-Id: I18bf9f08029fb98d611679d3aa65d13b088da8bc
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>

Conflicts:
	drivers/usb/gadget/u_ctrl_hsuart.c
	drivers/usb/gadget/u_data_hsuart.c
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>
usb: u_bam: Fix spinlock leak followed by lockup from workqueue

Driver has missing code to release spinlock while returning from
workqueue in case of memory allocation failures.
Returning from workqueue without releasing spinlock messes up
with worker thread and kernel keeps throwing up warnings like:
"BUG: workqueue leaked lock or atomic: kworker/u" for any
sleeping function called from worker thread afterwards. Later
when driver again tries to acquire same (unreleased) spinlock
it results in spinlock lockup.

CRs-Fixed: 497158
Change-Id: I4eaa7aaa42ed95a9b78a8939e80f4c0694e574b2
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
Bluetooth: Disable Sniff on HID ACL(s) if SCO is active

This patch disables sniff support on HID ACL(s) if SCO is active by
updating Link Policy settings. Once SCO is disabled, link policy is
again updated to re-enable Sniff on HID ACL(s). Without this patch
it was seen in presence of SCO, disconnection was observed on HID
ACL(s).

Change-Id: I81e0b3725bdadffe06ddb345afb9de2e042d5f9a
CRs-Fixed: 509616
Signed-off-by: Hemant Gupta <hemantg@codeaurora.org>
Bluetooth: Fix for the l2cap layer crashes while turning OFF BT

-This patch fix a case where while turning OFF BT l2cap channel
 & l2cap conn get deleted in one process context, which preempted
 the another process, where l2cap con was being used while trying to
 disconnect l2cap.  As the result l2cap conn pointer become invalid.
 Later which is leading a crash.  L2cap conn should be guarded by
 spin lock while disconnecting l2cap to avoid preemption which will
 avoid  crash due invalid conn pointer.

-This patch fix list_add crash due to invalid skb pointer.
 & BUG sleep warning as well.

CRs-Fixed: 499732, 504054

Change-Id: I90c5d29cc8728566a420f0dedaf7075846b32d1a
Signed-off-by: Nitin Shivpure <nshivpur@codeaurora.org>
Revert "u_hsuart: Fix a bug in opening the SMUX port"

This reverts commit 2deee01e6e23d8288f86d96c0a005afd701d777c.
msm: kgsl: reconcile with apq8064

Change-Id: If20dd9fd8cba6c735f010c91b7e32a492000ee7b