gpu: ion: Fix possible null pointer dereference

The kbuild test robot reported:

drivers/staging/android/ion/ion_system_heap.c:122 alloc_largest_available() error: potential null dereference 'info'.  (kmalloc returns null)

Where the pointer returned from kmalloc goes unchecked for failure.

This patch checks the return for NULL, and reworks the logic, as
suggested by Colin, so we allocate the page_info structure first.

Acked-by: Colin Cross <ccross@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 60e11dfc002962181fe4f0db54b33c65fee02c52
Git-repo: http://android.googlesource.com/kernel/common/
[mitchelh@codeaurora.org: some context differences since we were already
 checking for a NULL return value]
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
gpu: ion: Reduce allocation time from system heap

If we are under heavy memory pressure the shrinker might be running on
the system heap. This causes contention with the page pool lock when we
try to allocate from system heap. To ensure that allocations aren't
slowed down by having to wait for the page pool mutex we will just try
to get the mutex. If we are unsuccessful we just bypass the pool
altogether.

Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Bluetooth: Cancel power_on and power_off work

* This is not exact upstream patch but replica
  functions that will do similar function.
* Thanks to Dorimanx.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
avtimer: Update avtimer driver to parse driver tree data

LPASS exposes registers from which timestamp can be
read by clients for audio & video synchronization.
Change adds to retrieve the register address of AV
timer in LPASS passing from driver tree data.

CRs-fixed: 677082
Change-Id: Id7cf3455e22ddc27f5350a7a37c3b40d44eb0873
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
avtimer: Update avtimer driver to support Qdsp6v2

AVtimer in Qdsp6 provides the timer ticks for synchronization
of audio and video streams for capture and playback use cases.
Qdsp6 AVtimer interface has been updated for v2 version.
Update avtimer driver to support Qdsp6v2.

CRs-fixed: 677082
Change-Id: Ia68b04421edf13a96685654761bb71b866a5327b
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
avtimer: fix uninitialized variable compilation warning

Fix the following compilation warning in the avtimer driver:

kernel/drivers/platform/msm/avtimer.c:
	In function 'dev_avtimer_probe':
kernel/drivers/platform/msm/avtimer.c:316:
	warning: 'result' may be used uninitialized in this function
error, forbidden warning: avtimer.c:316
make[5]: *** [drivers/platform/msm/avtimer.o] Error 1

CRs-fixed: 677082
Change-Id: Ia760ba174e36bbcd63ed1c18cfcdce4308c825e1
Signed-off-by: David Collins <collinsd@codeaurora.org>
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ARM: dt: msm8974: Add AV timer specific data

LPASS exposes registers from which timestamp can be
read by clients for audio & video synchronization.
Change adds the register address of AV timer in LPASS.

CRs-fixed: 677082
Change-Id: Idee2aeb3cb73fcbca37976629c798abeae544774
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Conflicts:
	arch/arm/boot/dts/msm8974.dtsi