Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795038607; b=1sKn6VQS9Km2JvCCyNwd/9VQlw9M6UzplfrcwR6XbYJPF6k/VXjLDeaDRA60a59QP7yn QykjstoV3jm6p/xe7aOJCWBrl3em1Ql0N6QGK7jcniwUlIUdjcLx14giRS8h30943ZT3u 5jEye+EBch4d2VVoc86WY8Iixqs0dg+OFARUihgu2ihUjPWMADUMBYtZRy5u2L9v0qxFv zqg6uuvjwVSJcz1W9OtMNpYaZ6T/xgCS4CengmwHQYfKmJthTuGNVa4T5g26SRtfNw0GV VB8Dok1CdDCw4nzXQPxAal4wkBgf7Mku6ckR3V5ZriD1kX4sKGS8VnWeCSW3rUbY8nA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795038607; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=6VtwGtGOk94rYU2c8V9zKEZLdhqVfjdeUXzw5MNLTHY=; b=aY+28Xzbtq3fQulvdKSXdd80gdb4MoVwkfWGA7rnkwlNqWpbVAIxhRr8xY6Ils9xbxm8 yfcrKdgVDC668/z72TilR8qYPQpXAqkZ6Tw8M7eZ37JAhnw1fnbwV/aVs0CtO80cG2bAU QYKgEPYO8Iyg5WDGjvMgTuTkOBDw4aFU1HiU9GaVaCW8qz0l89SFqx45h3oDO+0HPp2Tr PAAkDhHKyPsqu09Yy3tWpI49ulew5wtLYJI3Imq3xoQasAZZ0YVBY1vq8k84taIxqWZiD tedt5q+IME9iXVGVq3EqFMvXWtoiZPBivLw7pYQYgmqZScm+PstIDS2XSpov81UliIQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=yDz9yaR5; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 581D0606A336; Wed, 18 Nov 2026 21:50:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=yDz9yaR5 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 867361F000C4; Wed, 18 Nov 2026 21:50:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795038607; bh=6VtwGtGOk94rYU2c8V9zKEZLdhqVfjdeUXzw5MNLTHY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=yDz9yaR5JHzILTOSC5Lgo88ZPGKoW8FPEfFJL3wisPbacv8ribejzeBnv/e9JQkYX fizbPhpgoZZYhUAH97H64M4oggpAdu1UkJo1I1YYFIe1G1FsXK54jCTslhigbpvVo1 KfP10YHTCSweoN9YEQkwPkHYgHImo0PnisZqRxlE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bryan ODonoghue , Loic Poulain , Hitesh Patel , Bryan ODonoghue , Sasha Levin Subject: [PATCH 6.6 1803/3318] media: qcom: camss: vfe-17x: Fix write master selection for RDI lines Date: Wed, 18 Nov 2026 15:40:25 +0100 Message-ID: <20261118150415.945207105@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150313.527275416@linuxfoundation.org> References: <20261118150313.527275416@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hitesh Patel [ Upstream commit fc02156a3efb747b724a490cc50e1ad8c28a3b23 ] On the gen2 VFE bus there is no crossbar between the RDI paths and the bus write masters: RDI n is served by write master n. The common vfe_get_output_v2() reflects this by mapping line->id to write master line->id, and every gen2 VFE except 17x uses it. The 17x code kept its own vfe_get_output(), which reserves whichever write master is free first. That happens to be the right one as long as a single line streams and it is RDI0. As soon as two lines of the same VFE stream, for instance two virtual channels demultiplexed by the CSID to RDI0 and RDI1, the second line to start is given the write master of the other RDI. Both write masters are then programmed with the buffer address and frame size of the wrong line. The frames are truncated to the smaller of the two buffers and the SMMU faults on the larger one. Use vfe_get_output_v2() on 17x like the other gen2 VFEs and drop the duplicate. This also removes an error path that released output->wm_idx[0] before it had been assigned. The gen1 VFEs are not affected: they have a bus crossbar and any write master can serve any line, so vfe_reserve_wm() is correct there. Fixes: 7319cdf189bb ("media: camss: Add support for VFE hardware version Titan 170") Cc: stable@vger.kernel.org Reviewed-by: Bryan O'Donoghue Reviewed-by: Loic Poulain Signed-off-by: Hitesh Patel Signed-off-by: Bryan O'Donoghue [ sashal: applied the shared vfe_get_output_v2() implementation to the existing local vfe_get_output() helper ] Signed-off-by: Sasha Levin --- .../media/platform/qcom/camss/camss-vfe-170.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-vfe-170.c b/drivers/media/platform/qcom/camss/camss-vfe-170.c index b9a403921d7d4..f23ef724b4594 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe-170.c +++ b/drivers/media/platform/qcom/camss/camss-vfe-170.c @@ -402,7 +402,6 @@ static int vfe_get_output(struct vfe_line *line) struct vfe_device *vfe = to_vfe(line); struct vfe_output *output; unsigned long flags; - int wm_idx; spin_lock_irqsave(&vfe->output_lock, flags); @@ -414,12 +413,12 @@ static int vfe_get_output(struct vfe_line *line) output->wm_num = 1; - wm_idx = vfe_reserve_wm(vfe, line->id); - if (wm_idx < 0) { - dev_err(vfe->camss->dev, "Can not reserve wm\n"); - goto error_get_wm; - } - output->wm_idx[0] = wm_idx; + /* Correspondence between VFE line number and WM number. + * line 0 -> RDI 0, line 1 -> RDI1, line 2 -> RDI2, line 3 -> PIX/RDI3 + * Note this 1:1 mapping will not work for PIX streams. + */ + output->wm_idx[0] = line->id; + vfe->wm_output_map[line->id] = line->id; output->drop_update_idx = 0; @@ -427,11 +426,9 @@ static int vfe_get_output(struct vfe_line *line) return 0; -error_get_wm: - vfe_release_wm(vfe, output->wm_idx[0]); - output->state = VFE_OUTPUT_OFF; error: spin_unlock_irqrestore(&vfe->output_lock, flags); + output->state = VFE_OUTPUT_OFF; return -EINVAL; } -- 2.53.0