msm:kgsl: Remove NORETRY flag in memory allocations

With NORETRY flag kernel will not try to reclaim memory
incase of memory allocation failures.With NORETRY flag
being removed, kernel makes mutliple attempts in order to make memory
allocation sucessfull, before returning failure.

Change-Id: I7d71954eba723ce6a8a79b63f54bea1e5b6618f1
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
msm: msm_bus: Fix the 64-bit division during interleaving

When interleaving flag is enabled, the bandwidth is divided
between ports. There was an error in the division as the
macro was not correctly updated with the right order of using
bandwidth and port number when 64-bit division function
was used by the bus driver.
Correcting this for fixing the token allocation issues
observed.

CRs-Fixed: 472791
Change-Id: Ie7c7f9557006cbb946eaa9eff4b50771cc60525e
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
dvb: mpq: Secure demux log level

Add secure demux API allowing to set log level verbosity.
Log level can be set from user-sapce via a debugfs entry.
Default is no logging.

Change-Id: I5cfa4533ade061dd2a0663252cea72779018f91d
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
Merge "msm: msm_bus: Fix the 64-bit division during interleaving"
msm: kgsl: Fault tolernace for context with pagefault

If pagefault happened in same global timestamp
as the hang do not attempt replay for fault tolerance.
This is an improvement from previous policy of not
attempting fault tolerance for the context
with pagefault.

CRs-Fixed: 469807
Change-Id: Idc9512b9fab3c9a2bf0b33a7e06f3070075427ba
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: kgsl: Allocate space in ringbuffer for EOF commands

When userspace passes end of frame (EOF) flag, ringbuffer is
inserted with EOF marker commands. Allocate ringbuffer space
for EOF marker commands.

CRs-Fixed: 469807
Change-Id: I7de8d1b81d358a8d8753ac84fbdceddad27bb17d
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: kgsl: Add barriers to GPU fault tolerance memory reads

In GPU fault tolerance When reading from memstore add
memory barriers. This ensures memstore reads are
completed and makes GPU fault tolerance code robust.

CRs-Fixed: 469807
Change-Id: Iefb950ae2647eb8ae16bfb9a8d7ee9885636d920
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: kgsl: Prevent fault tolerance memory free twice

There is a possibility of fault tolerance data to be freed twice
if fault tolerance fails. Do not free the data when the data allocation
fails, take the decision to free the data only at the end of
fault tolerance.

CRs-Fixed: 469807
Change-Id: Ifcc9a75e70440be6471b32d8413f4faa01a9ee47
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Merge "msm:kgsl: Remove NORETRY flag in memory allocations"
Merge "msm: kgsl: Fault tolernace for context with pagefault"
Merge "msm: kgsl: Allocate space in ringbuffer for EOF commands"
Merge "msm: kgsl: Add barriers to GPU fault tolerance memory reads"
Merge "msm: kgsl: Prevent fault tolerance memory free twice"
Merge "dvb: mpq: Secure demux log level"
Merge tag 'AU_LINUX_ANDROID_JB_2.5.04.02.02.040.252' of git://codeaurora.org/kernel/msm into cm-10.1

AU_LINUX_ANDROID_JB_2.5.04.02.02.040.252 based on quic/aosp/jb_2.5
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>