[PATCH 1/4] media: iris: Tear the core down when the firmware does not become ready
From: Gourav Kumar
Date: Thu Dec 03 2026 - 05:22:42 EST
If the firmware does not report ready in time, core init returns an
error but leaves the core powered, with the firmware loaded and the
queues allocated, and the state set to error. The next open only resets
the state, and the one after that repeats the whole initialisation on
top of the old one. The queue DMA buffers are leaked, clocks and power
domains are enabled twice, and the firmware is loaded again while it is
still running.
Deinitialise the core when the wait fails, so that the next open starts
from a clean state.
Cc: stable@xxxxxxxxxxxxxxx
Fixes: fb583a214337 ("media: iris: introduce host firmware interface with necessary hooks")
Signed-off-by: Gourav Kumar <gourav.kumar@xxxxxxxxxxxxxxxx>
---
drivers/media/platform/qcom/iris/iris_core.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/qcom/iris/iris_core.c b/drivers/media/platform/qcom/iris/iris_core.c
index d558475986ff0..e9b2c11f255ff 100644
--- a/drivers/media/platform/qcom/iris/iris_core.c
+++ b/drivers/media/platform/qcom/iris/iris_core.c
@@ -98,7 +98,11 @@ int iris_core_init(struct iris_core *core)
mutex_unlock(&core->lock);
- return iris_wait_for_system_response(core);
+ ret = iris_wait_for_system_response(core);
+ if (ret)
+ iris_core_deinit(core);
+
+ return ret;
error_unload_fw:
iris_fw_unload(core);
--
2.34.1