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

Configure Feed

Select the types of activity you want to include in your feed.

media: venus: destroy hfi session after m2m_ctx release

This partially reverts commit that made hfi_session_destroy()
the first step of vdec/venc close(). The reason being is a
regression report when, supposedly, encode/decoder is closed
with still active streaming (no ->stop_streaming() call before
close()) and pending pkts, so isr_thread cannot find instance
and fails to process those pending pkts. This was the idea
behind the original patch - make it impossible to use instance
under destruction, because this is racy, but apparently there
are uses cases that depend on that unsafe pattern. Return to
the old (unsafe) behaviour for the time being (until a better
fix is found).

Fixes: 45b1a1b348ec ("media: venus: sync with threaded IRQ during inst destruction")
Cc: stable@vger.kernel.org
Reported-by: Nathan Hebert <nhebert@google.com>
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>

authored by

Sergey Senozhatsky and committed by
Hans Verkuil
df4ff474 ab2fd4a0

+2 -6
+2 -6
drivers/media/platform/qcom/venus/core.c
··· 506 506 void venus_close_common(struct venus_inst *inst) 507 507 { 508 508 /* 509 - * First, remove the inst from the ->instances list, so that 510 - * to_instance() will return NULL. 511 - */ 512 - hfi_session_destroy(inst); 513 - /* 514 - * Second, make sure we don't have IRQ/IRQ-thread currently running 509 + * Make sure we don't have IRQ/IRQ-thread currently running 515 510 * or pending execution, which would race with the inst destruction. 516 511 */ 517 512 synchronize_irq(inst->core->irq); 518 513 519 514 v4l2_m2m_ctx_release(inst->m2m_ctx); 520 515 v4l2_m2m_release(inst->m2m_dev); 516 + hfi_session_destroy(inst); 521 517 v4l2_fh_del(&inst->fh); 522 518 v4l2_fh_exit(&inst->fh); 523 519 v4l2_ctrl_handler_free(&inst->ctrl_handler);