From 71beac3de01997d20f3adb2ce38a4e6f7a9cff65 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Tue, 5 Apr 2016 20:02:22 +0530 Subject: gpu: nvgpu: cancel clean up before update_fn_work In gk20a_channel_suspend(), we first cancel worker thread update_fn_work and then cancel job clean up worker But it is possible that we re-schedule update_fn_work from job cleanup worker after it was cancelled And in that case worker update_fn_work might run after we poweroff GPU Fix this by first cancelling job clean up worker and then update_fn_work worker Bug 200187905 Change-Id: Ia192c515702f14becf60d92c6471d8c0e892551e Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1120426 (cherry picked from commit b132b6c5aa9ab88c6733f36906f1b874114ec72d) Reviewed-on: http://git-master/r/1134888 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index d94e12a2..9e023e16 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -2778,11 +2778,10 @@ int gk20a_channel_suspend(struct gk20a *g) g->ops.fifo.disable_channel(ch); /* preempt the channel */ g->ops.fifo.preempt_channel(g, chid); - /* wait for channel update notifiers */ - if (ch->update_fn && - work_pending(&ch->update_fn_work)) - flush_work(&ch->update_fn_work); gk20a_channel_cancel_job_clean_up(ch, true); + /* wait for channel update notifiers */ + if (ch->update_fn) + cancel_work_sync(&ch->update_fn_work); channels_in_use = true; -- cgit v1.2.2