Camera: Rollback to stock camera driver & ION/IOMMU port

-Move to stock camera driver without dual camera, PIP
 changes.
-Changes to make this older stock camera driver compatible
 with newer ION interface & IOMMU.

Change-Id: Ic8aac872572989c7747b4a2b36190ac2da6617ee
Signed-off-by: Mansoor Aftab <maftab@codeaurora.org>
Merge "Camera: Rollback to stock camera driver & ION/IOMMU port"
Update copyright to The Linux Foundation

Change-Id: Ief75223cde79dff11782e69b5b2a6dcb1c0ad03d
Signed-off-by: Duy Truong <dtruong@codeaurora.org>
mmc: msm_sdcc: Hard reset controller on errors

For APQ8064 V2 (SDCC version = 0x06000018) doing a soft
reset on errors doesn't reset the state machine that
handles side-band signalling with SPS-BAM fully and can
lead to controller hang for the data transfers after
the reset.

Since there is no register interface to soft reset such
state machine inside the controller, we do hard reset of
the controller in case of errors. SDCC hard reset is
defined as assert and de-assert of asynchronous clock
reset line of the controller.

CRs-Fixed:
Change-Id: I366856e7508a3843688c8acead8a701e7b06fc19
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Merge "mmc: msm_sdcc: Hard reset controller on errors"
Merge "Update copyright to The Linux Foundation"
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>
Merge "Revert "ASoC: msm: Decrease the playback period size of PCM driver""
prima: release v3.2.1.11h

    git://codeaurora.org/external/wlan/prima.git

    b4798fe Merge branch 'jb-mr1-dev' of git.codeaurora.org:/external/wlan/prima into HEAD
    f9f6457 wlan: Release 3.2.1.11i
    d5b0e74 Post proper response to SME when reassoc is rejected
    e6c5a60 wlan: Release 3.2.1.11i
    bd2182f Post proper response to SME when reassoc is rejected

Change-Id: I10861693ea9cbb190577660d5ea7af8a50d5f915
Signed-off-by: Iliyan Malchev <malchev@google.com>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
mako: Adjust .drv value to 10mA

Fixes ULP timeout issues that causes USB enumeration failures.

b/7438555

Change-Id: I78cd3eb3fa2396d7b457852b13c1545f2ba025ce
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
vfs: dcache: fix deadlock in tree traversal

IBM reported a deadlock in select_parent().  This was found to be caused
by taking rename_lock when already locked when restarting the tree
traversal.

There are two cases when the traversal needs to be restarted:

 1) concurrent d_move(); this can only happen when not already locked,
    since taking rename_lock protects against concurrent d_move().

 2) racing with final d_put() on child just at the moment of ascending
    to parent; rename_lock doesn't protect against this rare race, so it
    can happen when already locked.

Because of case 2, we need to be able to handle restarting the traversal
when rename_lock is already held.  This patch fixes all three callers of
try_to_ascend().

IBM reported that the deadlock is gone with this patch.

[ I rewrote the patch to be smaller and just do the "goto again" if the
  lock was already held, but credit goes to Miklos for the real work.
   - Linus ]

Change-Id: I5b1aead6aa322a062bdb89770530195bb6784512
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
slub: fix a possible memory leak

Memory allocated by kstrdup should be freed,
when kmalloc(kmem_size, GFP_KERNEL) is failed.

Change-Id: Ic15409e7025cc5e69772f06d19dfa99aeae80a04
Acked-by: Christoph Lameter <cl@linux.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Joonsoo Kim <js1304@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
slub: fix a memory leak in get_partial_node()

In the case which is below,

1. acquire slab for cpu partial list
2. free object to it by remote cpu
3. page->freelist = t

then memory leak is occurred.

Change acquire_slab() not to zap freelist when it works for cpu partial list.
I think it is a sufficient solution for fixing a memory leak.

Below is output of 'slabinfo -r kmalloc-256'
when './perf stat -r 30 hackbench 50 process 4000 > /dev/null' is done.

***Vanilla***
Sizes (bytes)     Slabs              Debug                Memory
------------------------------------------------------------------------
Object :     256  Total  :     468   Sanity Checks : Off  Total: 3833856
SlabObj:     256  Full   :     111   Redzoning     : Off  Used : 2004992
SlabSiz:    8192  Partial:     302   Poisoning     : Off  Loss : 1828864
Loss   :       0  CpuSlab:      55   Tracking      : Off  Lalig:       0
Align  :       8  Objects:      32   Tracing       : Off  Lpadd:       0

***Patched***
Sizes (bytes)     Slabs              Debug                Memory
------------------------------------------------------------------------
Object :     256  Total  :     300   Sanity Checks : Off  Total: 2457600
SlabObj:     256  Full   :     204   Redzoning     : Off  Used : 2348800
SlabSiz:    8192  Partial:      33   Poisoning     : Off  Loss :  108800
Loss   :       0  CpuSlab:      63   Tracking      : Off  Lalig:       0
Align  :       8  Objects:      32   Tracing       : Off  Lpadd:       0

Total and loss number is the impact of this patch.

Change-Id: I02798e01b13f95eabe8958c2ffb5f35bb6cf769b
Cc: <stable@vger.kernel.org>
Acked-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Joonsoo Kim <js1304@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
PM: Allow runtime suspend again if prepare is failed

commit 8a5bdaf3 never allow the runtime suspend if prepare is failed.
The complete phase is invoked when calling __device_suspend.
It allows the runtime suspend again. But if prepare is failed,
__device_suspend won't be called and the complete phase won't also
called. Thus this runtime suspend will be blocked forever.

If prepare is failed, you should allow the runtime suspend again.

Change-Id: I57c7c04609299244a042f2524e1c65dbbdd91ae3
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
mako: add lcd turn-off sequence on shutdown

In the normal case, when the device is turned off, lcd off function doesn't
work.  However, we still need to turn off the panel and DSV convertor. This
patch adds an LCD turn-off function and calls it on device shut down.

Change-Id: I5526f0f08567190050527121d7e0890c05607a68
Signed-off-by: Iliyan Malchev <malchev@google.com>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
mm: Hold a file reference in madvise_remove

commit 9ab4233dd08036fe34a89c7dc6f47a8bf2eb29eb upstream.

Otherwise the code races with munmap (causing a use-after-free
of the vma) or with close (causing a use-after-free of the struct
file).

The bug was introduced by commit 90ed52ebe481 ("[PATCH] holepunch: fix
mmap_sem i_mutex deadlock")

Cc: Hugh Dickins <hugh@veritas.com>
Cc: Miklos Szeredi <mszeredi@suse.cz>
Cc: Badari Pulavarty <pbadari@us.ibm.com>
Cc: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[bwh: Backported to 3.2:
 - Adjust context
 - madvise_remove() calls vmtruncate_range(), not do_fallocate()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Change-Id: Ic06b53afe35bf02f3ac7774a76ca71d348547206
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
prima: release v3.2.1.13

    git://codeaurora.org/external/wlan/prima.git

    8cfd26d wlan: Release 3.2.1.13
    148c518 Update csrRoamInitGlobals() to support static linking
    fff59a1 Send EDCA Parameters After Reassoc
    c7f1b8f Populate Correct Scan Mode for Roam
    c9990e6 Fix driver hang in csrRoamRoamingStateDisassocRspProcessor
    d1ef85b Remove call to palStopTimer for preauth
    a31968f Insure that LFR BG scanning is not performed for any non-Infra association
    96a9106 Only flush non-P2P results from scan cache prior to LFR scan
    ac37d9d De-register lookup UP indication during pre-auth
    def1bff Improve convergence of LFR roam candidate scan algorithm
    3774f3b Dump neighbor state info when scan is not allowed
    524cf61 wlan: Release 3.2.1.12
    70e619c Conditionally invoke driver restart API
    556271d Notify the Kernel suspend to WCNSS
    8aef3d0 Update restart driver API to support statically linked WLAN driver
    f9f6457 wlan: Release 3.2.1.11i
    d5b0e74 Post proper response to SME when reassoc is rejected
    e6c5a60 wlan: Release 3.2.1.11i
    bd2182f Post proper response to SME when reassoc is rejected

Change-Id: I50c6f22941bc2374bf539f0b979f4a76a8c43909
Signed-off-by: Iliyan Malchev <malchev@google.com>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
mako: charger: disable hsic host and mdm driver in charger mode

In off-mode charging, hsic host driver never release wake_lock.
Due to this, system cannot enter the suspend during off-mode
charging. This patch disable the hsic host driver and mdm
driver in off-mode charging to reduce power consumption.

Change-Id: I8580af1d5a9d754982b198c9bd47a98e4b69c725
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
msm: kgsl: initialize kgsl_sync_timeline_ops properly

Change-Id: I823e273e9e906211645e52a42e88c4ce60858f65
Signed-off-by: Iliyan Malchev <malchev@google.com>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
Merge "prima: release v3.2.1.11h"