base: genlock: Check for instances where handle is NULL

Check for the possibility of NULL handles passed into the
in-kernel API functions and return error where appropriate.
There is a non-zero chance that the private_data will be
cleared while the FD is still active, so check in the ioctl()
function as well.

(cherry picked from commit a73ed097420c53451e843ae61d9aadc8fefabc94)

Change-Id: If481b98a6a2ab01ab788c23bffe9df7ab8bc6aee
CRs-fixed: 332835
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>

Conflicts:

	drivers/base/genlock.c
base: genlock: Remove genlock_release_lock and associated ioctl

Allowing a lock to be asynchronously released while a handle
was still active turned out to be too dangerous to use in a
multi-threaded environment and it served no pratical
purpose anyway.  Handles now hold an attached lock until they
are destroyed.

CRs-fixed: 333141
Change-Id: Ic0dedbad8050ff01927ddb165c65a939bf297c10
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
update new kgsl driver from CAF, Work in progress
pmem: respect PMEM_DEBUG config
msm_fb: fix framebuffer console (CAF)
msm: kgsl: Make sure kmemleak tool does not report incorrect mem leak.

Certain memory allocations are not properly tracked by kmemleak tool,
which makes it to incorrectly detect memory leak. Notify the tool by using
kmemleak_not_leak() to ignore the memory allocation so that incorrect leaks
report are avoided.

CRs-Fixed: 334294
Signed-off-by: Anshuman Dani <adani@codeaurora.org>
(cherry picked from commit eecd52061a50325db02d2396bfd455b306a04f34)

Change-Id: If2c955f95c650a73a04aca01977dc7ac13319878
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
msm: kgsl: Do not BUG in GPU recovery if a valid context can't be found

Don't BUG() if we can't find a valid context to recover to; just fail and
go into a zombie state. This usually happens after a first hang goes bad
and the system keeps hanging while trying to find its way. The problem with
a BUG() in this case is that the system goes down and we can't recover the
snapshot or other debug information.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
(cherry picked from commit a400d8da2d5464a47b3fe19b96a3bb04af82114e)

Change-Id: I68581017f6e78a866a6d91033f980ecd06d96360
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
base: genlock: Use a signed long for the result from wait_timeout
arm: Allow saving of stacktraces from other processes

Currently, a process is only able to save its own stacktrace
due to concerns about other processes going away while the
saving is occuring. Realistaically though, hititng this
case is very unlikely and the debugging benefit outweighs
the risk. Enable saving of other stacktraces for access
through systems such as procfs.

Change-Id: I584388f6edb48431bfec8d11d217f0fdc116f73e
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
USB: f_mtp: Remove existing duplicate code

autoconfig of out endpoint is being done twice for mtp driver.
Hence, removing the duplicate code of autoconfig of out endpoint.

CRs-Fixed: 339985
Change-Id: I677462999d0bcc1387aafe4c068e09fda5df15f6
Signed-off-by: Chiranjeevi Velempati <cvelempa@codeaurora.org>
(cherry picked from commit 5e27b7675695c82b8fd61565950863567e5c0628)
ASoC: core: Fix the suspend/resume failure

The suspend/resume schedule work fails because of the
uninsantiated sound card. The fix is to skip the
schedule work for the uninsantiated sound card.

CRs-fixed: 339411
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
(cherry picked from commit 5ab054fb0655bb0ab6820a18e931fabf69053ea9)

Change-Id: Icf303ffef9d7019c936510dc676ba83eeec84f1c
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
mm: Avoid livelocking of WB_SYNC_ALL writeback (bananacakes)
ksm: amend struct anon_vma