ASoC: wcd9xxx: Don't enable micbias if headset is removed

If special headset is removed, the callback to
disable micbias will be called, as micbias is
always on with special headset. Mbhc driver
checks a flag, used to disable/enable micbias
for special headset, to make sure micbias is
not disabled by recording. If this flag is not
updated properly before the callback is called
while the headset is removed, it can cause that
micbias is left enabled.

CRs-Fixed: 687630
Change-Id: Id49a2a0ba43821deef8fc5b6fb904239b2273f69
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
power: qpnp-bms: always limit soc to [0, 100]

Currently, soc is only limited to [0, 100] when adjust_soc runs.
However, there are some cases where the main algorithm of adjust_soc is
skipped, due to charging, SOC being too high or in the flat region of
the PC/OCV curve.

This can cause issues where SOC is calculated to be over 100 or under
0, which is undesirable. Fix this by moving the bound_soc call to the
main calculate_soc function so that it is never skipped.

CRs-Fixed: 697713
Change-Id: I641f513d182c62731a4fc115f29c0e38e5ec4c14
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
Merge "power: qpnp-bms: always limit soc to [0, 100]"
ASoC: msm: qdsp6v2: check proxy port is open when closing

The current logic opens the afe proxy port only if the
proxy instance virtual port is opened. If only
pcm instance virtual port is opened and a close of the
afe proxy port is attempted, this causes the device to
crash due to a wait event timeout as the driver tries
to close an unopened afe port.
The change ensures that only if both the virtual ports
are opened, which in effect starts the proxy port,
the afe close commands for the proxy port is sent to DSP,
else return immediately.

Change-Id: I9450001c608208f3d8da22b2881a88db1c21d950
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
ASoC: msm: qdsp6v2: check proxy port is open when closing

The current logic opens the afe proxy port only if the
proxy instance virtual port is opened. If only
pcm instance virtual port is opened and a close of the
afe proxy port is attempted, this causes the device to
crash due to a wait event timeout as the driver tries
to close an unopened afe port.
The change ensures that only if both the virtual ports
are opened, which in effect starts the proxy port,
the afe close commands for the proxy port is sent to DSP,
else return immediately.

Change-Id: I9450001c608208f3d8da22b2881a88db1c21d950
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
Merge "ASoC: msm: qdsp6v2: check proxy port is open when closing"
Merge "ASoC: msm: qdsp6v2: check proxy port is open when closing"
wcnss: avoid msleep after WCNSS power state check

Move msleep() call to before WCNSS power check to avoid
WCNSS power state change during the 50 msec sleep.

Change-Id: I5adcaf82395dea2454f3059fb09363e4a5e106ae
CRs-Fixed: 717927
Signed-off-by: Anand N Sunkad <asunka@codeaurora.org>
Merge "wcnss: avoid msleep after WCNSS power state check"
ASoC: msm: Fix ADM GET PARAM callback.

Add size check on inband get param call and do
not process inband if RTAC is active.

Change-Id: I2c099f5ea254a214f224dda556773a7fe6754fe5
CRs-fixed: 548397
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
Merge "ASoC: msm: Fix ADM GET PARAM callback."
ASoC: wcd9306: fix the NULL pointer dereference in the tapan codec

During the close of the AFE port the AIF1 PB widget will be closed
which access the core variable.
If the core is not initialized yet it will result in the kernel panic.
Fix by adding the check for the core structure to be initialized.

CRs-Fixed: 635790
Change-Id: Ic057e2eb75b25dbc55aa06cbce2b49aca0b1b25f
Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
Merge "ASoC: wcd9306: fix the NULL pointer dereference in the tapan codec"
ASoC: msm: qdsp6v2: Fix memory corruption in ASM driver

During VoIP call if SSR happens there is no audio from the next call
onwards. Incorrect typecasting of void pointer causing memory corruption
in ASM driver resulting in aforementioned issue.

CRs-Fixed: 687854
Change-Id: Ib04b40b978c82e00fe78cc7b12122f2052fb14c1
Signed-off-by: Venkata Narendra Kumar Gutta <vgutta@codeaurora.org>
Merge "ASoC: msm: qdsp6v2: Fix memory corruption in ASM driver"
Update to AU_LINUX_ANDROID_LNX.LA.3.5.2.1.04.04.02.060.148

Change-Id: I590f643f26423655dbb7842dd8b4eaf628338aff
Signed-off-by: B2G User <b2guser@localhost>
Merge "Update to AU_LINUX_ANDROID_LNX.LA.3.5.2.1.04.04.02.060.148"
netfilter: nf_conntrack: decrement global counter after object release

nf_conntrack_free() decrements our counter (net->ct.count)
before releasing the conntrack object. That counter is used in the
nf_conntrack_cleanup_net_list path to check if it's time to
kmem_cache_destroy our cache of conntrack objects. I think we have
a race there that should be easier to trigger (although still hard)
with CONFIG_DEBUG_OBJECTS_FREE as object releases become slowier
according to the following splat:

[ 1136.321305] WARNING: CPU: 2 PID: 2483 at lib/debugobjects.c:260
debug_print_object+0x83/0xa0()
[ 1136.321311] ODEBUG: free active (active state 0) object type:
timer_list hint: delayed_work_timer_fn+0x0/0x20
...
[ 1136.321390] Call Trace:
[ 1136.321398]  [<ffffffff8160d4a2>] dump_stack+0x45/0x56
[ 1136.321405]  [<ffffffff810514e8>] warn_slowpath_common+0x78/0xa0
[ 1136.321410]  [<ffffffff81051557>] warn_slowpath_fmt+0x47/0x50
[ 1136.321414]  [<ffffffff812f8883>] debug_print_object+0x83/0xa0
[ 1136.321420]  [<ffffffff8106aa90>] ? execute_in_process_context+0x90/0x90
[ 1136.321424]  [<ffffffff812f99fb>] debug_check_no_obj_freed+0x20b/0x250
[ 1136.321429]  [<ffffffff8112e7f2>] ? kmem_cache_destroy+0x92/0x100
[ 1136.321433]  [<ffffffff8115d945>] kmem_cache_free+0x125/0x210
[ 1136.321436]  [<ffffffff8112e7f2>] kmem_cache_destroy+0x92/0x100
[ 1136.321443]  [<ffffffffa046b806>] nf_conntrack_cleanup_net_list+0x126/0x160 [nf_conntrack]
[ 1136.321449]  [<ffffffffa046c43d>] nf_conntrack_pernet_exit+0x6d/0x80 [nf_conntrack]
[ 1136.321453]  [<ffffffff81511cc3>] ops_exit_list.isra.3+0x53/0x60
[ 1136.321457]  [<ffffffff815124f0>] cleanup_net+0x100/0x1b0
[ 1136.321460]  [<ffffffff8106b31e>] process_one_work+0x18e/0x430
[ 1136.321463]  [<ffffffff8106bf49>] worker_thread+0x119/0x390
[ 1136.321467]  [<ffffffff8106be30>] ? manage_workers.isra.23+0x2a0/0x2a0
[ 1136.321470]  [<ffffffff8107210b>] kthread+0xbb/0xc0
[ 1136.321472]  [<ffffffff81072050>] ? kthread_create_on_node+0x110/0x110
[ 1136.321477]  [<ffffffff8161b8fc>] ret_from_fork+0x7c/0xb0
[ 1136.321479]  [<ffffffff81072050>] ? kthread_create_on_node+0x110/0x110
[ 1136.321481] ---[ end trace 25f53c192da70825 ]---

CRs-fixed: 717356
Change-Id: I5e4aff3390cadadbac9ffe8fcdb651c79e42c685
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Git-commit: 0c3c6c00c69649f4749642b3e5d82125fde1600c
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Update to AU_LINUX_ANDROID_LNX.LA.3.5.2.1.04.04.02.060.149

Change-Id: I849b3a7b72c7916939c48a9e558b135ed79a776a
Signed-off-by: Indrajeet Kumar <ikumar@codeaurora.org>
Merge "Update to AU_LINUX_ANDROID_LNX.LA.3.5.2.1.04.04.02.060.149"