Skip to content

media: mediatek: unregister VPU watchdog handlers

Guangshuo Li linux-arm-kernel linux-media linux-mediatek lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 1 replyIn review
  2. v11 patch 1 replySuperseded

Changes in v2 from the cover letter

- 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.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3media: mediatek: vpu: add watchdog handler unregister helperdrivers/media/platform/mediatek/vpu/mtk_vpu.c drivers/media/platform/mediatek/vpu/mtk_vpu.h+16 -01 reply
2/3media: mediatek: vcodec: unregister VPU watchdog handlerdrivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_vpu.c+6 -00 replies
3/3media: mtk-mdp: unregister VPU watchdog handlerdrivers/media/platform/mediatek/mdp/mtk_mdp_core.c+2 -00 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchNicolas Dufresne
1/3
2/3
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] media: mediatek: unregister VPU watchdog handlers

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