diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index adb4b2765..34ad17712 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -648,7 +648,6 @@ int gr_gk20a_ctx_patch_write(struct gk20a *g, if (!ch_ctx->patch_ctx.mem.cpu_va) { int err; gk20a_dbg_info("per-write ctx patch begin?"); - /* yes, gr_gk20a_ctx_patch_smpc causes this one */ err = gr_gk20a_ctx_patch_write_begin(g, ch_ctx); if (err) return err; @@ -6759,6 +6758,9 @@ int gr_gk20a_exec_ctx_ops(struct channel_gk20a *ch, err = -ENOMEM; goto cleanup; } + err = gr_gk20a_ctx_patch_write_begin(g, ch_ctx); + if (err) + goto cleanup; g->ops.mm.l2_flush(g, true); @@ -6863,6 +6865,9 @@ int gr_gk20a_exec_ctx_ops(struct channel_gk20a *ch, if (offsets) kfree(offsets); + if (ch_ctx->patch_ctx.mem.cpu_va) + gr_gk20a_ctx_patch_write_end(g, ch_ctx); + if (ctx_ptr) vunmap(ctx_ptr);