From: Guangshuo Li <lgs201920130244@gmail.com>
To: Minghsiu Tsai <minghsiu.tsai@mediatek.com>,
Houlong Wei <houlong.wei@mediatek.com>,
Andrew-CT Chen <andrew-ct.chen@mediatek.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Tiffany Lin <tiffany.lin@mediatek.com>,
Yunfei Dong <yunfei.dong@mediatek.com>,
Hans Verkuil <hverkuil+cisco@kernel.org>,
Nicolas Dufresne <nicolas.dufresne@collabora.com>,
Chen-Yu Tsai <wenst@chromium.org>, Fei Shao <fshao@chromium.org>,
Tomasz Figa <tfiga@chromium.org>,
Guangshuo Li <lgs201920130244@gmail.com>,
Haoxiang Li <haoxiang_li2024@163.com>,
Eizan Miyamoto <eizan@chromium.org>,
Enric Balletbo i Serra <eballetbo@kernel.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Subject: [PATCH v2 0/3] media: mediatek: unregister VPU watchdog handlers
Date: Mon, 20 Jul 2026 16:57:53 +0800 [thread overview]
Message-ID: <20260720085756.465667-1-lgs201920130244@gmail.com> (raw)
The Mediatek vcodec and MDP drivers register watchdog reset handlers
with the VPU driver and pass driver-owned objects as private data.
These handlers can remain registered after an initialization failure or
device removal. A later VPU watchdog reset can therefore invoke a
handler with stale private data and potentially dereference freed
memory.
This series adds a common helper for unregistering VPU watchdog
handlers, then uses it in the vcodec and MDP cleanup paths before their
VPU device references are released.
The series is organized as follows:
1. Add vpu_wdt_unreg_handler() to the VPU driver.
2. Unregister the vcodec watchdog handler during initialization
failure and firmware release.
3. Unregister the MDP watchdog handler during probe failure and
device removal.
v2:
- Split the changes into three patches as requested by Nicolas.
- Fix the extra blank line reported by checkpatch.
- Carry Nicolas' Reviewed-by tag on the MDP patch.
Guangshuo Li (3):
media: mediatek: vpu: add watchdog handler unregister helper
media: mediatek: vcodec: unregister VPU watchdog handler
media: mtk-mdp: unregister VPU watchdog handler
drivers/media/platform/mediatek/mdp/mtk_mdp_core.c | 2 ++
.../mediatek/vcodec/common/mtk_vcodec_fw_vpu.c | 6 ++++++
drivers/media/platform/mediatek/vpu/mtk_vpu.c | 14 ++++++++++++++
drivers/media/platform/mediatek/vpu/mtk_vpu.h | 2 ++
4 files changed, 24 insertions(+)
--
2.43.0
next reply other threads:[~2026-07-20 8:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 8:57 Guangshuo Li [this message]
2026-07-20 8:57 ` [PATCH v2 1/3] media: mediatek: vpu: add watchdog handler unregister helper Guangshuo Li
2026-07-20 8:57 ` [PATCH v2 2/3] media: mediatek: vcodec: unregister VPU watchdog handler Guangshuo Li
2026-07-20 8:57 ` [PATCH v2 3/3] media: mtk-mdp: " Guangshuo Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260720085756.465667-1-lgs201920130244@gmail.com \
--to=lgs201920130244@gmail.com \
--cc=andrew-ct.chen@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=eballetbo@kernel.org \
--cc=eizan@chromium.org \
--cc=fshao@chromium.org \
--cc=haoxiang_li2024@163.com \
--cc=houlong.wei@mediatek.com \
--cc=hverkuil+cisco@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=mchehab@kernel.org \
--cc=minghsiu.tsai@mediatek.com \
--cc=nicolas.dufresne@collabora.com \
--cc=tfiga@chromium.org \
--cc=tiffany.lin@mediatek.com \
--cc=wenst@chromium.org \
--cc=yunfei.dong@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox