Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
To: Vikash Garodia <vikash.garodia@oss.qualcomm.com>,
	Abhinav Kumar <abhinav.kumar@linux.dev>,
	Bryan O'Donoghue <bod@kernel.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil@kernel.org>,
	Stefan Schmidt <stefan.schmidt@linaro.org>,
	Hans Verkuil <hverkuil+cisco@kernel.org>,
	Wangao Wang <wangao.wang@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>,
	Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Subject: [PATCH v2 3/6] media: iris: gen1: Destroy internal buffers after FW releases
Date: Mon, 29 Dec 2025 12:01:22 +0530	[thread overview]
Message-ID: <20251229-iris-fixes-v2-3-6dce2063d782@oss.qualcomm.com> (raw)
In-Reply-To: <20251229-iris-fixes-v2-0-6dce2063d782@oss.qualcomm.com>

After the firmware releases internal buffers, the driver was not
destroying them. This left stale allocations that were no longer used,
especially across resolution changes where new buffers are allocated per
the updated requirements. As a result, memory was wasted until session
close.

Destroy internal buffers once the release response is received from the
firmware.

Fixes: 73702f45db81 ("media: iris: allocate, initialize and queue internal buffers")
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
---
 drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
index 5087e51daa842515e9d62730680fb237bf274efa..5ff71e25597b61587c674142feb99626e402c893 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
@@ -441,6 +441,8 @@ static int iris_hfi_gen1_session_unset_buffers(struct iris_inst *inst, struct ir
 		goto exit;
 
 	ret = iris_wait_for_session_response(inst, false);
+	if (!ret)
+		ret = iris_destroy_internal_buffer(inst, buf);
 
 exit:
 	kfree(pkt);

-- 
2.34.1


  parent reply	other threads:[~2025-12-29  6:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-29  6:31 [PATCH v2 0/6] media: iris: misc fixes for fluster, seek and concurrency issues Dikshita Agarwal
2025-12-29  6:31 ` [PATCH v2 1/6] media: iris: Add buffer to list only after successful allocation Dikshita Agarwal
2026-01-07 10:26   ` Vikash Garodia
2025-12-29  6:31 ` [PATCH v2 2/6] media: iris: Skip resolution set on first IPSC Dikshita Agarwal
2026-01-07 10:27   ` Vikash Garodia
2025-12-29  6:31 ` Dikshita Agarwal [this message]
2026-01-07 10:27   ` [PATCH v2 3/6] media: iris: gen1: Destroy internal buffers after FW releases Vikash Garodia
2025-12-29  6:31 ` [PATCH v2 4/6] Revert "media: iris: Add sanity check for stop streaming" Dikshita Agarwal
2025-12-30 10:25   ` Bryan O'Donoghue
2026-01-05  9:51     ` Dikshita Agarwal
2026-01-05 12:50       ` Bryan O'Donoghue
2026-01-06  5:47         ` Dikshita Agarwal
2026-01-07 10:29   ` Vikash Garodia
2025-12-29  6:31 ` [PATCH v2 5/6] media: iris: gen2: Add sanity check for session stop Dikshita Agarwal
2025-12-30 10:33   ` Bryan O'Donoghue
2026-01-07 10:06     ` Dikshita Agarwal
2026-01-12 11:09   ` Vikash Garodia
2025-12-29  6:31 ` [PATCH v2 6/6] media: iris: Prevent output buffer queuing before stream-on completes Dikshita Agarwal
2026-01-12 11:09   ` Vikash Garodia

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=20251229-iris-fixes-v2-3-6dce2063d782@oss.qualcomm.com \
    --to=dikshita.agarwal@oss.qualcomm.com \
    --cc=abhinav.kumar@linux.dev \
    --cc=bod@kernel.org \
    --cc=bryan.odonoghue@linaro.org \
    --cc=hverkuil+cisco@kernel.org \
    --cc=hverkuil@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=stefan.schmidt@linaro.org \
    --cc=vikash.garodia@oss.qualcomm.com \
    --cc=wangao.wang@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