arm: mm: Add VM_ARM_EMPTY_MAPPING flag to mark the PMD gaps

ioremap optimization to return the addresses from the static mapping
if already present added the feature to add the pmd empty gaps into
the VM area but don't map such gaps in this commit "19b52abe3c5d".

This introduces the problem when the pfn is 0x0 and ends up into the
empty section gap found by the fill_pmd_gaps. If the driver calls
the ioremap(0, PAGE_SIZE) then it will return the address which is never
mapped, and access to that address will result in the crash.

To resolve this mark the empty PMD gaps with new flag VM_ARM_EMPTY_MAPPING
instead of the VM_ARM_STATIC_MAPPING, so that ioremap only checks
the VM_ARM_STATIC_MAPPING flag and skips over the VM_ARM_EMPTY_MAPPING
sections.

CRs-Fixed: 385828
Change-Id: I71e053f05abd2f611a6f17e7c86635404c31751e
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
ARM: gic: Refactor code for gic_configure_and_raise

Currently the offset and bit calculation in the function was
hardcoded for IPC1 interrupt. To support other secondary cores
we have to refactor the code to calculate the offset and bits
as per the cpu and interrupt number.

Change-Id: I33de8f185c219fb6a8e9d7f9676e958f27d54a12
Signed-off-by: Taniya Das <tdas@codeaurora.org>
ARM: gic: save/restore distributor ISR register values

Before going into power collapse we have to save/restore the ISR
registers in case we configure GIC to handle FIQ on apps side.
Otherwise we will end up in wrong ISR configurations after PC.

Change-Id: Ib58b701fc462c10ec88576feab3c8a9eb3027009
Signed-off-by: Taniya Das <tdas@codeaurora.org>
android: lowmemorykiller: add lmk parameters tunning code.

There are cases that LMK doesn't run, even when it must run.
It is due to LMK shrinker not considering memory status per zone.
So add LMK parameters(other_free, other_file) tunnig code to
consider target zone of LMK shrinker.

Change-Id: I6f1f8660d5da920a0e3af45a160499965032081d
Git-commit: 22d990a58fc17b3f0155e15eb2dc3efa037bea1c
Git-repo: https://android.googlesource.com/kernel/common/
[ohaugan@codeaurora.org: Fix compilation issues]
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
android/lowmemorykiller: Selectively count free CMA pages

In certain memory configurations there can be a large number of
CMA pages which are not suitable to satisfy certain memory
requests.

This large number of unsuitable pages can cause the
lowmemorykiller to not kill any tasks because the
lowmemorykiller counts all free pages.
In order to ensure the lowmemorykiller properly evaluates the
free memory only count the free CMA pages if they are suitable
for satisfying the memory request.

Change-Id: I7f06d53e2d8cfe7439e5561fe6e5209ce73b1c90
CRs-fixed: 437016
Signed-off-by: Liam Mark <lmark@codeaurora.org>
mmc: msm_sdcc: Check for unclocked register access in IRQ handler

After SDCC has been suspended and clocks turned off, an asynchronous
interrupt from an SDIO device will result in a call to the IRQ handler.
Since SDCC hardware registers are unclocked, a read of the status
register will result in an exception. Verify that clock to SDCC is on
before access in the IRQ handler.

CRs-Fixed: 424960
Change-Id: I81afd2dd5c5fa4785f11f2eec03e5b454b8f5dbe
Signed-off-by: Oluwafemi Adeyemi <aadeyemi@codeaurora.org>
msm: camera: Fix locking in msm_close

Change-Id: Id832a967f5f790a93102b7761285012d5231de7a
sec_debug: Forward-port SEC_DEBUG feature from Samsung

 * Forward port, fix warnings, fix ifdefs.
 * Very useful for debugging hard problems, no impact when disabled.
 * Also required to get correct ramdumps.

Change-Id: I375e0dcce83b717e5f1228925d7269c5197b2016
M2: sound: fix static on speaker enable/disable

Rapid speaker enable/disable is causing a loud static POP.
Can be replicated by enabling "Touch Sounds" and playing music through Apollo.

Speaker enable/disable delay sequence as in msm8960.c

Change-Id: If1772a80da8ac2d06bb39ad4766bf92089081338