sched: Fix reference to stale task_struct in try_to_wake_up()

try_to_wake_up() currently drops p->pi_lock and later checks for need
to notify cpufreq governor on task migrations or wakeups. However the
woken task could exit between the time p->pi_lock is released and the
time the test for notification is run. As a result, the test for
notification could refer to an exited task. task_notify_on_migrate(p)
could thus lead to invalid memory reference.

Fix this by running the test for notification with task's pi_lock
held.

Change-Id: I1c7a337473d2d8e79342a015a179174ce00702e1
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
msm: kgsl: Ignore signals for ringbuffer timestamp waits

Ignore signals when waiting for ringbuffer timestamp since
the wait needs to complete regardless of whether the process
got a signal. Also, increase the wait timeout for context
detachment to 30s instead of 10s. Large IB's can take longer
than 10s to retire and if a hang happens then recovering from
the hang and completing the long IB's will take much longer
than 10s, bump this timer to 30s which should be sufficient
for the context's commands to retire even if hang happens.

Conflicts:
	drivers/gpu/msm/adreno_drawctxt.c
	drivers/gpu/msm/adreno_ringbuffer.c

CRs-Fixed: 718284

Change-Id: I54589c9ec48da3f87ccc60c85451daac7e9a22bd
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Anupam Sakargayan <asakarga@codeaurora.org>
msm: kgsl: Device mutex lock for kgsl_cancel_event

kgsl_cancel_event must be called with device->mutex
otherwise it will cause a BUG_ON in kgsl_cancel_event

CRs-fixed: 761881

Change-Id: I904f3321edaa07505077fe53d82e09f9200e3781
Signed-off-by: Anupam Sakargayan <asakarga@codeaurora.org>
Revert to old lock