diff options
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/ce2_gk20a.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c index 3fed937e..698211ec 100644 --- a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c | |||
@@ -342,6 +342,7 @@ static int gk20a_ce_prepare_submit(u64 src_buf, | |||
342 | int gk20a_init_ce_support(struct gk20a *g) | 342 | int gk20a_init_ce_support(struct gk20a *g) |
343 | { | 343 | { |
344 | struct gk20a_ce_app *ce_app = &g->ce_app; | 344 | struct gk20a_ce_app *ce_app = &g->ce_app; |
345 | int err; | ||
345 | 346 | ||
346 | if (ce_app->initialised) { | 347 | if (ce_app->initialised) { |
347 | /* assume this happen during poweron/poweroff GPU sequence */ | 348 | /* assume this happen during poweron/poweroff GPU sequence */ |
@@ -352,7 +353,10 @@ int gk20a_init_ce_support(struct gk20a *g) | |||
352 | 353 | ||
353 | gk20a_dbg(gpu_dbg_fn, "ce: init"); | 354 | gk20a_dbg(gpu_dbg_fn, "ce: init"); |
354 | 355 | ||
355 | nvgpu_mutex_init(&ce_app->app_mutex); | 356 | err = nvgpu_mutex_init(&ce_app->app_mutex); |
357 | if (err) | ||
358 | return err; | ||
359 | |||
356 | nvgpu_mutex_acquire(&ce_app->app_mutex); | 360 | nvgpu_mutex_acquire(&ce_app->app_mutex); |
357 | 361 | ||
358 | INIT_LIST_HEAD(&ce_app->allocated_contexts); | 362 | INIT_LIST_HEAD(&ce_app->allocated_contexts); |
@@ -390,6 +394,7 @@ void gk20a_ce_destroy(struct gk20a *g) | |||
390 | ce_app->next_ctx_id = 0; | 394 | ce_app->next_ctx_id = 0; |
391 | 395 | ||
392 | nvgpu_mutex_release(&ce_app->app_mutex); | 396 | nvgpu_mutex_release(&ce_app->app_mutex); |
397 | |||
393 | nvgpu_mutex_destroy(&ce_app->app_mutex); | 398 | nvgpu_mutex_destroy(&ce_app->app_mutex); |
394 | } | 399 | } |
395 | 400 | ||
@@ -427,7 +432,11 @@ u32 gk20a_ce_create_context_with_cb(struct device *dev, | |||
427 | if (!ce_ctx) | 432 | if (!ce_ctx) |
428 | return ctx_id; | 433 | return ctx_id; |
429 | 434 | ||
430 | nvgpu_mutex_init(&ce_ctx->gpu_ctx_mutex); | 435 | err = nvgpu_mutex_init(&ce_ctx->gpu_ctx_mutex); |
436 | if (err) { | ||
437 | kfree(ce_ctx); | ||
438 | return ctx_id; | ||
439 | } | ||
431 | 440 | ||
432 | ce_ctx->g = g; | 441 | ce_ctx->g = g; |
433 | ce_ctx->dev = g->dev; | 442 | ce_ctx->dev = g->dev; |