From cbc336a98433b40a417dd86dcbc5d58eaa8cc105 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Tue, 11 Nov 2014 11:23:56 +0200 Subject: gpu: nvgpu: flush update notifiers on suspend If any gk20a update callback work is pending, wait for them to finish before going to suspend. Bug 200052943 Change-Id: Ib469db6e29d13ae26aaca5fceb1ccd20f18bfc3c Signed-off-by: Konsta Holtta Reviewed-on: http://git-master/r/601034 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 7f179d14..0d9eb318 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -2093,13 +2093,18 @@ int gk20a_channel_suspend(struct gk20a *g) return err; for (chid = 0; chid < f->num_channels; chid++) { - if (f->channel[chid].in_use) { + struct channel_gk20a *ch = &f->channel[chid]; + if (ch->in_use) { gk20a_dbg_info("suspend channel %d", chid); /* disable channel */ - g->ops.fifo.disable_channel(&f->channel[chid]); + 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); channels_in_use = true; } -- cgit v1.2.2