Fix not able to disconnect from the Host after SMP requests

The following fixes were added:
1. While using whitelist API for connection, if SMP requests are received
before the L2CAP channel is correctly setup, queue the SMP requets
and execute them once the channel state is bounded and connected and
therefore maintaining the correct connection reference count.
2. If the status LE start encryption command is not successful,
then call hci_conn put which would decrement the HCI connection
reference count.

CRs-fixed: 447092
Change-Id: Ibb11ecf94f28e0b0aff5eacc86d1660e7ec2e25d
Signed-off-by: Archana Ramachandran <archanar@codeaurora.org>
Bluetooth: Dont retry eSCO for WBS

This fix will allow the hci event handler
to notify the eSCO connection failure for mSBC,
to BT host which can fallback to CVSD and retry
the eSCO again with a new codec negotiation.
This behavior will allow PTS test case
TC_AG_ACC_BI_12_I to pass as it expects
a codec negotiation after the first attempt
for mSBC is rejected from the PTS.

CRs-Fixed: 390563
Change-Id: I93973d14a035a743f582e751047bf23b66681932
Signed-off-by: Nitin Srivastava <nitinsr@codeaurora.org>
media: dvb: Seperate secure demuxing to secure feeds only

In current implementation secure demux performs demuxing on all filters
including non-secure filters.
This implementation fails in case output buffer is externally allocated by
the user from a heap that does not allocate physically contiguous memory,
which is allowed for non-secure filters.
Secure filters buffers are guranteed to be allocated from a heap that
allocates physically contiguous memory.
To overcome this problem, this patch splits the processing between
normal sw demux filters, and secure demux filters.
Filters which user defined as secured will be processed only by the secure
demux, while other filters will be processed by the normal sw demux.

Change-Id: I25c2e0a8e37cf0d3590de85a10c80b84a4f950c6
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
msm: avs: Restore core voltage when disabling AVS

AVS changes the core voltage to match the current operating conditions
on the part. Not all frequencies supported by the target have characterized
AVS delay synthesizer (AVSDSCR) values. For frequencies that do not have
AVSDSCR set, AVS is not enabled and so need to operate at the
characterized voltage for that frequency. Disabling AVS does not
however, restore the operating voltage to the value the rail was
configured to. This may cause frequencies that do not have AVSDSCR to
run at lower voltage than prescibed.
Set up the core voltage back to the last known good value when disabling
AVS.

Change-Id: I5389996288fa49e45c469d2a8917e00900261de7
CRs-fixed: 457772
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
Signed-off-by: Anji Jonnala <anjir@codeaurora.org>
msm: wfd: Return proper error if mmap fails

Change amends the check condition for mmap return
values appropriately to fix the allocate buffer
failure cases.

CRs-Fixed: 453057
Change-Id: I05ceb4f2960c26e4bc024e0c5f530f874c90a048
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
Revert "power: pm8921-charger: add boundary check for out of bounds issues"

This reverts commit 13c972d87f309a326449b42b50b1b923ef3e168f,
which is a duplicate cherry-pick already done by a mega cherry-pick patch
from msm-3.4 branch.

Change-Id: I8a394645d4a80f236cec63fb0ea7a09ff896319a
Signed-off-by: Willie Ruan <wruan@codeaurora.org>
Merge "media: dvb: Seperate secure demuxing to secure feeds only"
Merge "Bluetooth: Dont retry eSCO for WBS"
Merge "msm: wfd: Return proper error if mmap fails"
msm: board-8064-camera: disable i2c for sglte2

GSBI4 is used to configure i2c for camera control. In SGLTE2 platform,
GSBI4 needs to be used for UART. So, disabling the i2c mux register
for camera in acse of SGLTE2 platform

Change-Id: Ide0dc353e669105271b6b25d1fe445f135b74572
Signed-off-by: Punit Soni <punits@codeaurora.org>
Merge "Fix not able to disconnect from the Host after SMP requests"
Merge "msm: avs: Restore core voltage when disabling AVS"
Merge "msm: board-8064-camera: disable i2c for sglte2"
Merge "Revert "power: pm8921-charger: add boundary check for out of bounds issues""
Merge remote-tracking branch 'caf/jb_2.5' into d2-jb_2.5
kernel: gtod: vsyscall

Introduce kernel user helper vsyscall to allow a higher performance
gettimeofday implementation in user-space.

Change-Id: I9b9971d217382129170ecd6a35461539dac9eebb
Signed-off-by: Brent DeGraaf <bdegraaf@codeaurora.org>
kernel: ARM-specific implementation of user-accessible timers

Expose a read-only timer page to user-space to allow for a more
efficient implementation of gettimeofday in user-space.

Change-Id: Ibd6ce41f5f4ff9435e4bf4582ef5de721283d56b
Signed-off-by: Brent DeGraaf <bdegraaf@codeaurora.org>
kernel: gtod: Add MSM-specific user-accessible timers

Enable MSM-specific timers to be readable from user-space.
This allows implementation of a higher-performance
gettimeofday in user-space.

Change-Id: I1f322b5396ee335b10aeb81c681593621d151176
Signed-off-by: Brent DeGraaf <bdegraaf@codeaurora.org>
kernel: Add hooks for user-accessible timers in the kernel.

Hooks for user-accessible timers allow implementation of a
more efficient gettimeofday in user-space.

Change-Id: If2f63d010c1cf142eb84f3745617e756913e46f7
Signed-off-by: Brent DeGraaf <bdegraaf@codeaurora.org>
msm: Disable deprecated QCache

 * QCache is deprecated, remove it from configs so we can use ZCache

Change-Id: I3b2fc40ecce757530b64ddabb03081aaa425b603