linux/drivers/media/platform/amd/isp4
Yifei Gao ef46d80a70 media: amd: isp4: fix self-deadlock in isp4sd_pwron_and_init() error path
isp4sd_pwron_and_init() holds ops_mutex via guard(mutex) and, on any
init failure, jumps to err_deinit and calls isp4sd_pwroff_and_deinit().
That helper takes the same ops_mutex, re-acquiring a non-recursive mutex
already held by the current thread, so any init failure deadlocks.

Unwind the error path in stages instead, releasing only what each
failure point acquired. This also avoids the issues that an
unconditional teardown would hit at the earlier failures, such as a
runtime-PM underflow from pm_runtime_resume_and_get() and MMIO access
while the device is unpowered.

Fixes: 4e5e7a7ddb ("media: platform: amd: isp4 subdev and firmware loading handling added")
Assisted-by: Claude:claude-opus-4-8 smatch
Signed-off-by: Yifei Gao <gyf161023@gmail.com>
Reviewed-by: Bin Du <bin.du@amd.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2026-08-10 11:48:54 +03:00
..
isp4_debug.c media: platform: amd: isp4 debug fs logging and more descriptive errors 2026-05-06 13:48:09 +03:00
isp4_debug.h media: platform: amd: isp4 debug fs logging and more descriptive errors 2026-05-06 13:48:09 +03:00
isp4_fw_cmd_resp.h media: platform: amd: Add isp4 fw and hw interface 2026-05-06 13:48:09 +03:00
isp4_hw_reg.h
isp4_interface.c media: amd: isp4: release partial allocations in isp4if_alloc_fw_gpumem() 2026-08-10 11:48:54 +03:00
isp4_interface.h media: platform: amd: use refcount_t instead of atomic_t 2026-07-10 14:17:56 +02:00
isp4_subdev.c media: amd: isp4: fix self-deadlock in isp4sd_pwron_and_init() error path 2026-08-10 11:48:54 +03:00
isp4_subdev.h media: platform: amd: isp4 debug fs logging and more descriptive errors 2026-05-06 13:48:09 +03:00
isp4_video.c media: platform: amd: isp4 video node and buffers handling added 2026-05-06 13:48:09 +03:00
isp4_video.h media: platform: amd: isp4 video node and buffers handling added 2026-05-06 13:48:09 +03:00
isp4.c media: platform: amd: isp4 debug fs logging and more descriptive errors 2026-05-06 13:48:09 +03:00
isp4.h media: platform: amd: isp4 subdev and firmware loading handling added 2026-05-06 13:48:09 +03:00
Kconfig media: platform: amd: fix unmet dependency for VIDEO_V4L2_SUBDEV_API 2026-07-15 11:13:55 +03:00
Makefile media: platform: amd: isp4 debug fs logging and more descriptive errors 2026-05-06 13:48:09 +03:00