[PATCH v5 0/2] media: amphion: fix VPU core lifetime during teardown
From: Myeonghun Pak
Date: Thu Oct 01 2026 - 14:00:52 EST
vpu_core_unregister() releases the message FIFO buffer and VPU reference
before draining queued message work. An open video instance can also keep
a pointer to devm-allocated core state while sysfs unbind removes the core
or its parent.
The first patch drains message work before releasing core state. The
second prevents manual unbind on both platform drivers and warns if core
removal encounters a live instance.
Build-tested the Amphion driver for arm64 with LLVM 22 and W=1.
Both patches pass checkpatch in strict mode.
Changes in v5:
- Rebase on the latest media-committers/next.
- Add Ming Qian's Reviewed-by tags to both patches.
No functional changes.
Changes in v4:
- Resend through git send-email after the v3 Gmail submission altered
diff headers and whitespace in transit. No code changes.
Changes in v3:
- Resend with intact diff headers after the v2 mail submission wrapped
the diff --git lines. No code changes.
Changes in v2:
- Move vpu_core_put_vpu() after the work drain.
- Keep runtime PM and mailbox teardown unchanged.
- Address sysfs unbind in a separate patch.
Myeonghun Pak (2):
media: amphion: drain message work before releasing core state
media: amphion: prevent unbind while video instances are open
drivers/media/platform/amphion/vpu_core.c | 18 +++++++++++-------
drivers/media/platform/amphion/vpu_drv.c | 1 +
2 files changed, 12 insertions(+), 7 deletions(-)
base-commit: 4a069a763e8a86821edac4159f7c59a20015631b
--
2.53.0