msm: kgsl: Clean-up gpuaddr allocated from kgsl gen_pool

All GPU Mapping which are done using kgsl_mmu_map_global
API, allocates gpu address from kgsl gen_pool. Only calling
kgsl_mmu_unmap for such mappings doesn't free up the gpuaddr
assigned from KGSL gen_pool. This results in Kernel bug when
KGSL gen_pool is destroyed. This changes makes sure that
all KGSL gen_pool GPU address are freed before destroying
kgsl gen_pool.

Change-Id: Iba46f18e7fe4fba661f5fe142f3470f61a31baa0
Signed-off-by: Anshuman Dani <adani@codeaurora.org>
gpu: ion: Do not write buffer size if IOMMU map fails

Return error when IOMMU map fails and prevent buffer
size from being over written.

Conflicts:
	drivers/gpu/ion/ion.c

Change-Id: Ib01770ba521bc29ef209e2d998b7aa21bb7d58d8
Signed-off-by: Susheel Khiani <skhiani@codeaurora.org>
msm: kgsl: Change an overflow check to be "smart" compiler proof

In its infinite wisdom, GCC will optimize out this overflow check:

   if ((gpuaddr + size) < gpuaddr)

Which might totally make sense for the compiler but it doesn't do us
a bit of good. Replace the existing overflow check with something
that GCC can't ignore.

CRs-fixed: 544025
Change-Id: Ic0dedbad921545a01d5fe80a20c3f2f4f86ef641
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: kgsl: Fix overflow check in mmap_range_valid

A eager compiler might optimize out the overflow check in
mmap_range_valid.  Add a check against ULONG_MAX to ensure
that the check is performed.

CRs-fixed: 546373
Change-Id: Ic0dedbad478cc3bd65a00a7b31d2039095c005d6
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>