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 <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/601034
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
Konsta Holtta
2014-11-11 11:23:56 +02:00
committed by Dan Willemsen
parent 59339b4fd9
commit cbc336a984

View File

@@ -2093,13 +2093,18 @@ int gk20a_channel_suspend(struct gk20a *g)
return err; return err;
for (chid = 0; chid < f->num_channels; chid++) { 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); gk20a_dbg_info("suspend channel %d", chid);
/* disable channel */ /* disable channel */
g->ops.fifo.disable_channel(&f->channel[chid]); g->ops.fifo.disable_channel(ch);
/* preempt the channel */ /* preempt the channel */
g->ops.fifo.preempt_channel(g, chid); 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; channels_in_use = true;
} }