From f77e44ff86e0bd539d6b5daa9e639fc0a1dd7994 Mon Sep 17 00:00:00 2001 From: Ian Kaszubski Date: Thu, 15 Jun 2017 15:43:38 -0700 Subject: [PATCH] media:platform:tegra Stop duplicate singleshot Issue: When a capture session is complete an extra singleshot is sometimes issued causing syncpt timeouts in subsequent sessions. Fix: When a capture is complete do not issue a single shot if there is already an active one. Bug 200291915 Change-Id: I0616978b2144a0539980087fd356d8c30299bcd0 Signed-off-by: Ian Kaszubski Reviewed-on: http://git-master/r/1503374 GVS: Gerrit_Virtual_Submit Reviewed-by: Jaspreet Kaur Reviewed-by: Bhanu Murthy V Reviewed-by: Jihoon Bang --- drivers/media/platform/tegra/camera/vi/vi2_fops.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/tegra/camera/vi/vi2_fops.c b/drivers/media/platform/tegra/camera/vi/vi2_fops.c index 8008c1991e9a..9ef56fb77143 100644 --- a/drivers/media/platform/tegra/camera/vi/vi2_fops.c +++ b/drivers/media/platform/tegra/camera/vi/vi2_fops.c @@ -443,8 +443,13 @@ static void tegra_channel_capture_done(struct tegra_channel *chan) val = VI_CFG_VI_INCR_SYNCPT_COND(mw_ack_done) | chan->syncpt[index][0]; tegra_channel_write(chan, TEGRA_VI_CFG_VI_INCR_SYNCPT, val); - csi_write(chan, index, - TEGRA_VI_CSI_SINGLE_SHOT, SINGLE_SHOT_CAPTURE); + if (!csi_read(chan, index, TEGRA_VI_CSI_SINGLE_SHOT)) { + csi_write(chan, index, + TEGRA_VI_CSI_SINGLE_SHOT, SINGLE_SHOT_CAPTURE); + } else { + dev_dbg(&chan->video.dev, + "Syncpoint already enabled at capture done!%d\n", index); + } } for (index = 0; index < chan->valid_ports; index++) { -- 2.39.2