From: Gourav Kumar <gourav.kumar@oss.qualcomm.com>
To: Vikash Garodia <vikash.garodia@oss.qualcomm.com>,
Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>,
Abhinav Kumar <abhinav.kumar@linux.dev>,
Bryan O'Donoghue <bod@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Stefan Schmidt <stefan.schmidt@linaro.org>,
Hans Verkuil <hverkuil@kernel.org>,
Vedang Nagar <quic_vnagar@quicinc.com>,
Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org,
Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
Gourav Kumar <gourav.kumar@oss.qualcomm.com>,
stable@vger.kernel.org
Subject: [PATCH 1/4] media: iris: Tear the core down when the firmware does not become ready
Date: Thu, 03 Dec 2026 15:52:05 +0530 [thread overview]
Message-ID: <20261203-iris-core-open-error-fixes-v1-1-c932ddcee73a@oss.qualcomm.com> (raw)
In-Reply-To: <20261203-iris-core-open-error-fixes-v1-0-c932ddcee73a@oss.qualcomm.com>
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@vger.kernel.org
Fixes: fb583a214337 ("media: iris: introduce host firmware interface with necessary hooks")
Signed-off-by: Gourav Kumar <gourav.kumar@oss.qualcomm.com>
---
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
next prev parent reply other threads:[~2026-12-03 10:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 10:22 [PATCH 0/4] media: iris: Fix core init failure recovery and iris_open error handling Gourav Kumar
2026-12-03 10:22 ` Gourav Kumar [this message]
2026-12-03 10:22 ` [PATCH 2/4] media: iris: Fix NULL dereference and leaks in the " Gourav Kumar
2026-12-03 10:22 ` [PATCH 3/4] media: iris: Return the real error when the m2m setup in iris_open fails Gourav Kumar
2026-12-03 10:22 ` [PATCH 4/4] media: iris: Drop duplicate defines Gourav Kumar
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=20261203-iris-core-open-error-fixes-v1-1-c932ddcee73a@oss.qualcomm.com \
--to=gourav.kumar@oss.qualcomm.com \
--cc=abhinav.kumar@linux.dev \
--cc=bod@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=dikshita.agarwal@oss.qualcomm.com \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=hverkuil@kernel.org \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=quic_vnagar@quicinc.com \
--cc=stable@vger.kernel.org \
--cc=stefan.schmidt@linaro.org \
--cc=vikash.garodia@oss.qualcomm.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
all inboxes | Powered by JetHome®