msm: kgsl: Fix several possible problem spots in the dispatcher

Fix a few spots that the compiler warnings missed. Avoid
dereferencing a pointer that may have returned ERR_PTR() without
first checking to see that if it did return ERR_PTR() and correct
an egregious signed / unsigned mixup. Not sure why the compiler
didn't yell at me for that one.

Change-Id: Ic0dedbadf075b34e51a89ce625d2308c5171a58d
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: kgsl: when unmapping from the mmu flush the entire tlb

Flushes the entire tlb when calling mmu_unmap to make sure there
is no race condition between unmapping and freeing the pages.

Change-Id: I911f8479a3aef2006f9df40a3419284423937542
Signed-off-by: Shrenuj Bansal <shrenujb@codeaurora.org>
msm: kgsl: Prevent device start after it is already started

Check if device is already started in high priority workqueue thread,
this check prevents calling device start after it is already started,
thereby avoiding unpredictable behavior.

Change-Id: Iffcd065f8c02746d168c8e5779d10d4b0e2404a9
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: kgsl: Enhance GFT to avoid hang->recover->hang cycle

If GFT recovered more than X times in Y ms invalidate the context
and do not attempt recovery. this is to prevent the case where GFT keeps
recovering continuously.

Change-Id: I9326a4cf0c8d1b6b92497ae5cd086e4b8bb7e89f
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Revert "msm: kgsl: when unmapping from the mmu flush the entire tlb"

This reverts commit 4641bfa2f9b6aec61adfd754539bf400d02a7708.