From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D5AC6430B90; Sun, 1 Mar 2026 01:15:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772327736; cv=none; b=KcbhnjGrPVWAKbSiMrEWysvxlnnWqHUr0Ijk7911SZ70SZTDjao6IvB95AAgqmac4vVmPkIOOoj3GZP8wKy9oFIwRGIxYBp4BKNkwuxKsDIaLJXp7OFTJiO20t3aVresGCPjDirWgHQHcnFxy5MtHZwymIoR/o069WXHUEi5gD8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772327736; c=relaxed/simple; bh=k/Q2SdSDuVQ9xEzNdBSgHjkvZMDM40Qn7IT7bDtZEx8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=BmT2OLONOO0ylPOoWGS9jLuzdOlwq0pU7rqJrs0mTHbkBMysMpkGVUGrRXKlrD6ssoCl5bLPid/Y3sUuTC3CtRg21z+71r1Z71SfNynMrITgS9BqKEeXXNOwd0PZNe4LsA03F/liomz0qGWzIOrVe2X7qLheq058XcrOnpEYj2U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hDSiwTRW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hDSiwTRW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06120C19421; Sun, 1 Mar 2026 01:15:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772327736; bh=k/Q2SdSDuVQ9xEzNdBSgHjkvZMDM40Qn7IT7bDtZEx8=; h=From:To:Cc:Subject:Date:From; b=hDSiwTRW58DXiC0ueNTBWBhZLZCmZxxfa0wZtF0TMQVY4WwV+JxYgmawqY37yYp5C aMt1qMgSkhtQx8fdPl0ydRNnb2X+uqQ5aCl7nOovVMef0nuNWdPgPRo9RQj48CfLO/ CkvAmnq8GG/+Yy5GbyshQIEuO1ZE1fOBwR2GBcERSkawBHsyjVE84jFrheytzgvW+9 BJWegTS/ywJ4Q49Vg/2WUTraa55kvjSwM+Awke9aBM1imJEO96euuy0rXfPYszm+tZ y0KdWCo0tu0x6UHzcnwZxo6oqX87TojpmeuP+FlEMTtTEmUyyD7HgEzuhYcmtAQ9SI /wr7zwqc3Vehg== From: Sasha Levin To: stable@vger.kernel.org, dikshita.agarwal@oss.qualcomm.com Cc: Vikash Garodia , Bryan O'Donoghue , Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: FAILED: Patch "media: iris: remove v4l2_m2m_ioctl_{de,en}coder_cmd API usage during STOP handling" failed to apply to 6.18-stable tree Date: Sat, 28 Feb 2026 20:15:34 -0500 Message-ID: <20260301011534.1669032-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Hint: ignore X-stable: review Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.18-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . Thanks, Sasha ------------------ original commit in Linus's tree ------------------ >From 8fc707d13df517222db12b465af4aa9df05c99e1 Mon Sep 17 00:00:00 2001 From: Dikshita Agarwal Date: Sun, 2 Nov 2025 09:10:19 +0530 Subject: [PATCH] media: iris: remove v4l2_m2m_ioctl_{de,en}coder_cmd API usage during STOP handling Currently v4l2_m2m_ioctl_{de,enc}coder_cmd is being invoked during STOP command handling. However, this is not required as the iris driver has its own drain and stop handling mechanism in place. Using the m2m command API in this context leads to incorrect behavior, where the LAST flag is prematurely attached to a capture buffer, when there are no buffers in m2m source queue. But, in this scenario even though the source buffers are returned to client, hardware might still need to process the pending capture buffers. Attaching LAST flag prematurely can result in the capture buffer being removed from the destination queue before the hardware has finished processing it, causing issues when the buffer is eventually returned by the hardware. To prevent this, remove the m2m API usage in stop handling. Fixes: d09100763bed ("media: iris: add support for drain sequence") Fixes: 75db90ae067d ("media: iris: Add support for drain sequence in encoder video device") Signed-off-by: Dikshita Agarwal Reviewed-by: Vikash Garodia Cc: stable@vger.kernel.org Signed-off-by: Bryan O'Donoghue Signed-off-by: Hans Verkuil --- drivers/media/platform/qcom/iris/iris_vidc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_vidc.c b/drivers/media/platform/qcom/iris/iris_vidc.c index dfd94f4a84a94..bd38d84c9cc79 100644 --- a/drivers/media/platform/qcom/iris/iris_vidc.c +++ b/drivers/media/platform/qcom/iris/iris_vidc.c @@ -573,9 +573,10 @@ static int iris_dec_cmd(struct file *filp, void *fh, mutex_lock(&inst->lock); - ret = v4l2_m2m_ioctl_decoder_cmd(filp, fh, dec); - if (ret) + if (dec->cmd != V4L2_DEC_CMD_STOP && dec->cmd != V4L2_DEC_CMD_START) { + ret = -EINVAL; goto unlock; + } if (inst->state == IRIS_INST_DEINIT) goto unlock; @@ -606,9 +607,10 @@ static int iris_enc_cmd(struct file *filp, void *fh, mutex_lock(&inst->lock); - ret = v4l2_m2m_ioctl_encoder_cmd(filp, fh, enc); - if (ret) + if (enc->cmd != V4L2_ENC_CMD_STOP && enc->cmd != V4L2_ENC_CMD_START) { + ret = -EINVAL; goto unlock; + } if (inst->state == IRIS_INST_DEINIT) goto unlock; -- 2.51.0