msm: vidc: Delay firmware unload during session close

Video driver loads and unloads firmware at the start
and end of each session. Firmware download takes up
to 100 msec. When there are many b2b video sessions
e.g. thumbnail generation, this is an unnecessary
overhead. To overcome this problem, video driver will
unload the firmware 10 secs after the session is closed.
If a new session starts during this period, it will not
be required to download the firmware again.

Change-Id: Ia515c3ed89c75ea9e43852958d1cbb2d77fe4c51
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
msm: vidc: Unload firmware immediately after sys error

Currently the video driver delays unloading of firmware
by 10 sec. This was primarily done to avoid re-loading
the firmware if we had another video instance starting
immediately. However, if firmware goes in to bad state
and firmware unload is delayed, then any subsequent session
started within 10 sec will fail, as firmware is still in
bad state. We can avoid this by unloading firmware without
delay when video firmware goes in to bad state.

Change-Id: I747d6ce2fa61916cd8a24c180068879b371101a8
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
msm: vidc: Increase firmware unload delay

Using the same delay for power collapse and
firmware unload can trigger race conditions in
the power collapse and firmware unload sequences.
Increase the firmware unload delay from 10 seconds
to 15 seconds to avoid this.

Change-Id: I0fbde99e8c7fca93f7b227d351a73c580e244614
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Signed-off-by: Sivasri Kumar Vanka <sivasri@codeaurora.org>
HID: fix a couple of off-by-ones
ASoC: msm-lsm-client: handle close gracefully

The listen pcm device could get closed abruptly due to userspace
application crash. In such cases, the device close will be invoked
abruptly. Handle this scenario gracefully by properly cleaning up the
driver before close.

Change-Id: Ie841f300400d547260da92383712a9aa0689d7a7
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
msm:qdsp6v2: Check null pointer on userspace data argument in kernel

The null pointer check is required to ensure that userspace data
in kernalspace is not null.

Change-Id: I9e522c393ae643626a4bae03731a73f5d6db6458
CRs-Fixed: 563752
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
ASoC: msm: qdsp6v2: disable OCMEM by default

Disable OCMEM for Audio and Voice use-cases
by default. User can however enable OCMEM
if needed.

Change-Id: Idd52a8bcdcb6fc2ee893bf05486d8dbbc0f38f37
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
ASoc: msm: qdsp6v2: Fix for NULL check

- Required check added for NULL pointer

CRs-fixed: 583939
Change-Id: I8b079c42ef06af9a817dc830c5f2d3c785232aa7
Signed-off-by: Mingming Yin <mingming@codeaurora.org>
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
Revert "slab/mempolicy: always use local policy from interrupt context"

This reverts commit a67ab124a3b5b61951aa18fcea94e7ccd832451d.