PM / Sleep: Do not check wakeup too often in try_to_freeze_tasks()

Use the observation that it is more efficient to check the wakeup
variable once before the loop reporting tasks that were not
frozen in try_to_freeze_tasks() than to do that in every step of that
loop.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

Conflicts:

	kernel/power/process.c

Change-Id: I0bd9e71b638e565773f4861899ca175f82f2a4cc
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Signed-off-by: Darescu Ionut <johnny@esi.ro>
Board-shooter & board-shooter_u: remap memory for an extra 79MB of RAM

Defconfig changes:
*Disabled CONFIG_FB_MSM_HDMI_MSM_PANEL in order to use a smaller framebuffer (HDMI doesn't work on AOSP Jellybean anyway)

Board-shooter.c/board-shooter_u.c changes:
*Removed mem_size_mb variable
*Don't add 0x10000000 to the audio, surfaceflinger, and userspace allocations (the new memory map is much more precise now and this could mess it up)
*Removed ADSP2 allocation (it does nothing)
*Set all addresses in the range of 0x40000000 to 0x80000000 to use MEMTYPE_EBI1 (0x80000000 is the last memory address on the device)

Board-shooter.h changes:
*Completely remapped memory (different base addresses for many allocations now)
*Shrunk the framebuffer to 0x6F0000
*Removed the MSM_PMEM_KERNEL_EBI1 allocation (this wasn't even being referenced by anything so it is junk)
*Shrunk ADSP allocation to 0x1500000
*Shrunk SF allocation to 0x23A0000
*Removed the ADSP2 allocation
*There are no longer any allocations that are mapped after the userspace allocation
*Converted MSM_OVERLAY_BLT_SIZE to hex (looks better)
*Shrunk the SMI region by the size of the ADSP allocation
*Moved the ADSP allocation to the SMI region
*Added 0x10000000 to the userspace allocation to offset the removal of the mem_size_mb function
*Increased the userspace allocation to 1MB less than the maximum possible allowed by the physical base address and the end of the usable address space [(0x80000000 - 0x48000000) - 0x100000]
The userspace allocation is 1MB less than the maximum amount possible because the device misbehaves (reboots/lags) when the userspace allocation goes all the way to the end of the usable address space.

This memory remap gives 79MB of more RAM to userspace.

Signed-off-by: Sultanxda <sultanxda@gmail.com>
Board-shooter: minor memory map revision

*Increased framebuffer size to the same size used when HDMI is enabled (Android 4.2+ probably needs more framebuffer memory)
*Removed HDMI ifdef as the framebuffer size is now the largest size that the ifdef had
*Increased surfaceflinger size (on Android 4.2+, 0x23A0000 may be too small)
*Left a gap between the framebuffer and userspace allocation (gap is 0x1A000)
*Reduced userspace allocation size by 9MB
*Added memory remap history

This revision reduces the size of the userspace allocation by 9MB in exchange for vastly improved stability.

Signed-off-by: Sultanxda <sultanxda@gmail.com>
Board-shooter & board-shooter_u: use MEMTYPE_EBI1 for ADSP

*The size of ADSP has been reduced to 0x1300000 as 720P video capture only requires 0x950000
*ADSP now uses MEMTYPE_EBI1 (should fix the random reboots once and for all)
*Added a 1MB gap between the ADSP and SMI allocations (you can never be too safe)
*Moved ADSP to what was previously the bottom of the SMI allocation

Signed-off-by: Sultanxda <sultanxda@gmail.com>
board-shooter & board-shooter_u: move ADSP out from the SMI region

Something somewhere only wants SMI memory in the SMI region, so move out ADSP from the SMI region. Shrink ADSP to the necessary amount of RAM for 720P video capture and reduce the sizes of surfaceflinger and framebuffer in order to make them fit before the userspace allocation. Allocate ADSP after the userspace allocation.

This leaves userspace with 861MB of RAM.

Signed-off-by: Sultanxda <sultanxda@gmail.com>
board-shooter: Final memory map revision, based on HTC logic

*Memory sizes are now values that are known to be stable
*Memory allocation location logic is now extremely similar to HTC

This should leave the amount of userspace RAM in the 850's of MB without risking any stability.

Signed-off-by: Sultanxda <sultanxda@gmail.com>
msm: audio: qdsp6v3: Add size safety check to ACDB driver

Check that the size sent by userspace is not larger
then the internal amount allowed. This protects
against overflowing the stack due to an invalid size.
power: fbearlysuspend: add sleep hack for CRT-off animation

HTC panels don't seem to work correctly with the Android
CRT-off animation. Add a short sleep period to let userspace
finish drawing the animation.

credit: kushdeck<kushdeck@gmail.com>
ARM: entry: avoid enabling interrupts in prefetch/data	abort handlers

Avoid enabling interrupts if the parent context had interrupts enabled
in the abort handler assembly code, and move this into the breakpoint/
page/alignment fault handlers instead.

This gets rid of some special-casing for the breakpoint fault handlers
from the low level abort handler path.

Signed-off-by: Russell King <rmk+kernel <at> arm.linux.org.uk>