Give JPU peripheral chance to finish current job. Don't switch off clock until context release.
Unified · Split
| @@ -1300,17 +1300,17 @@ static int jpu_release(struct file *file) · 1299 unmodified lines | ||
| 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); |
| 1313 | 1308 | |
| 1309 | + mutex_lock(&jpu->mutex); | |
| 1310 | + if (--jpu->ref_count == 0) | |
| 1311 | + clk_disable_unprepare(jpu->clk); | |
| 1312 | + mutex_unlock(&jpu->mutex); | |
| 1313 | + | |
| 1314 | 1314 | return 0; |
| 1315 | 1315 | } |
| 1316 | 1316 | |