Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] V4L2: platform: rcar_jpu: switch off clock on release later

Give JPU peripheral chance to finish current job.
Don't switch off clock until context release.

Signed-off-by: Mikhail Ulyanov <mikhail.ulyanov@cogentembedded.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Mikhail Ulyanov and committed by
Mauro Carvalho Chehab
886aa71b 69ca0333

+5 -5
+5 -5
drivers/media/platform/rcar_jpu.c
··· 1300 1300 struct jpu *jpu = video_drvdata(file); 1301 1301 struct jpu_ctx *ctx = fh_to_ctx(file->private_data); 1302 1302 1303 - mutex_lock(&jpu->mutex); 1304 - if (--jpu->ref_count == 0) 1305 - clk_disable_unprepare(jpu->clk); 1306 - mutex_unlock(&jpu->mutex); 1307 - 1308 1303 v4l2_m2m_ctx_release(ctx->fh.m2m_ctx); 1309 1304 v4l2_ctrl_handler_free(&ctx->ctrl_handler); 1310 1305 v4l2_fh_del(&ctx->fh); 1311 1306 v4l2_fh_exit(&ctx->fh); 1312 1307 kfree(ctx); 1308 + 1309 + mutex_lock(&jpu->mutex); 1310 + if (--jpu->ref_count == 0) 1311 + clk_disable_unprepare(jpu->clk); 1312 + mutex_unlock(&jpu->mutex); 1313 1313 1314 1314 return 0; 1315 1315 }