From 5c39da20d58711c29b9322cdb729a5ec38775b39 Mon Sep 17 00:00:00 2001 From: Mohit Ingale Date: Thu, 13 Mar 2025 22:57:20 +0000 Subject: [PATCH] media: camera: Reject channel setup for already configured stream id If channel is already opened for given stream id and virtual channel id, reject the request and error out. Bug 5048625 Change-Id: I57c87128ce41c116fb2c8ef276908ff395864a9b Signed-off-by: Mohit Ingale Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3319273 GVS: buildbot_gerritrpt Reviewed-by: Bhushan Rayrikar Reviewed-by: Vincent Chung Reviewed-by: Semi Malinen Reviewed-by: Jukka Kaartinen Reviewed-by: Frank Chen --- .../media/platform/tegra/camera/fusa-capture/capture-vi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/media/platform/tegra/camera/fusa-capture/capture-vi.c b/drivers/media/platform/tegra/camera/fusa-capture/capture-vi.c index 65854e43..e62712b8 100644 --- a/drivers/media/platform/tegra/camera/fusa-capture/capture-vi.c +++ b/drivers/media/platform/tegra/camera/fusa-capture/capture-vi.c @@ -712,6 +712,14 @@ int vi_capture_setup( return -EEXIST; } +#ifndef NV_IS_L4T + if (channels[setup->csi_stream_id][setup->virtual_channel_id] != NULL) { + dev_err(chan->dev, + "%s: channel already setup\n", __func__); + return -EEXIST; + } +#endif + dev_dbg(chan->dev, "chan flags %u\n", setup->channel_flags); dev_dbg(chan->dev, "chan mask %llx\n", setup->vi_channel_mask); dev_dbg(chan->dev, "queue depth %u\n", setup->queue_depth);