diff --git a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c index e61996a16..4a3cf0759 100644 --- a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c @@ -523,13 +523,6 @@ int vgpu_gr_alloc_obj_ctx(struct channel_gk20a *c, u32 class_num, u32 flags) goto out; } - /* commit gr ctx buffer */ - err = g->ops.gr.commit_inst(c, gr_ctx->mem.gpu_va); - if (err) { - nvgpu_err(g, "fail to commit gr ctx buffer"); - goto out; - } - /* allocate patch buffer */ err = vgpu_gr_alloc_channel_patch_ctx(g, c); if (err) { @@ -550,6 +543,13 @@ int vgpu_gr_alloc_obj_ctx(struct channel_gk20a *c, u32 class_num, u32 flags) goto out; } + /* commit gr ctx buffer */ + err = g->ops.gr.commit_inst(c, gr_ctx->mem.gpu_va); + if (err) { + nvgpu_err(g, "fail to commit gr ctx buffer"); + goto out; + } + /* load golden image */ err = gr_gk20a_elpg_protected_call(g, vgpu_gr_load_golden_ctx_image(g, c));