All of lore.kernel.org
 help / color / mirror / Atom feed
From: Helen Koike <helen.koike@collabora.com>
To: linux-media@vger.kernel.org
Cc: linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
	heiko@sntech.de, kernel@collabora.com, hverkuil-cisco@xs4all.nl,
	dafna.hirschfeld@collabora.com, zhengsq@rock-chips.com,
	laurent.pinchart@ideasonboard.com, niklas.soderlund@ragnatech.se,
	mchehab@kernel.org, tfiga@chromium.org, ribalda@google.com
Subject: [PATCH] media: staging: rkisp1: cap: fix timeout when stopping the stream
Date: Fri,  6 Nov 2020 20:02:36 -0300	[thread overview]
Message-ID: <20201106230236.1884387-1-helen.koike@collabora.com> (raw)

The dma engine should be stopped first.
The driver waits for an interrupt to stop the stream in a known state
after a frame.
If rkisp1_cap_stream_disable() is called after stopping the rest of the
pipeline, then most likely the interrupt won't arrive, we'll get a
timeout and debugfs variables mp_stop_timeout or sp_stop_timeout will
be incremented.

Fixes: 37db540bb9d1f ("media: staging: rkisp1: cap: refactor enable/disable stream to allow multistreaming")
Signed-off-by: Helen Koike <helen.koike@collabora.com>
---
 drivers/staging/media/rkisp1/rkisp1-capture.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/rkisp1/rkisp1-capture.c b/drivers/staging/media/rkisp1/rkisp1-capture.c
index 6d2fd27970f28..b81235afd0534 100644
--- a/drivers/staging/media/rkisp1/rkisp1-capture.c
+++ b/drivers/staging/media/rkisp1/rkisp1-capture.c
@@ -895,6 +895,8 @@ static void rkisp1_pipeline_stream_disable(struct rkisp1_capture *cap)
 {
 	struct rkisp1_device *rkisp1 = cap->rkisp1;
 
+	rkisp1_cap_stream_disable(cap);
+
 	/*
 	 * If the other capture is streaming, isp and sensor nodes shouldn't
 	 * be disabled, skip them.
@@ -907,8 +909,6 @@ static void rkisp1_pipeline_stream_disable(struct rkisp1_capture *cap)
 
 	v4l2_subdev_call(&rkisp1->resizer_devs[cap->id].sd, video, s_stream,
 			 false);
-
-	rkisp1_cap_stream_disable(cap);
 }
 
 /*
-- 
2.29.2


WARNING: multiple messages have this Message-ID (diff)
From: Helen Koike <helen.koike@collabora.com>
To: linux-media@vger.kernel.org
Cc: mchehab@kernel.org, dafna.hirschfeld@collabora.com,
	heiko@sntech.de, niklas.soderlund@ragnatech.se,
	linux-kernel@vger.kernel.org, tfiga@chromium.org,
	linux-rockchip@lists.infradead.org,
	laurent.pinchart@ideasonboard.com, hverkuil-cisco@xs4all.nl,
	kernel@collabora.com, zhengsq@rock-chips.com, ribalda@google.com
Subject: [PATCH] media: staging: rkisp1: cap: fix timeout when stopping the stream
Date: Fri,  6 Nov 2020 20:02:36 -0300	[thread overview]
Message-ID: <20201106230236.1884387-1-helen.koike@collabora.com> (raw)

The dma engine should be stopped first.
The driver waits for an interrupt to stop the stream in a known state
after a frame.
If rkisp1_cap_stream_disable() is called after stopping the rest of the
pipeline, then most likely the interrupt won't arrive, we'll get a
timeout and debugfs variables mp_stop_timeout or sp_stop_timeout will
be incremented.

Fixes: 37db540bb9d1f ("media: staging: rkisp1: cap: refactor enable/disable stream to allow multistreaming")
Signed-off-by: Helen Koike <helen.koike@collabora.com>
---
 drivers/staging/media/rkisp1/rkisp1-capture.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/rkisp1/rkisp1-capture.c b/drivers/staging/media/rkisp1/rkisp1-capture.c
index 6d2fd27970f28..b81235afd0534 100644
--- a/drivers/staging/media/rkisp1/rkisp1-capture.c
+++ b/drivers/staging/media/rkisp1/rkisp1-capture.c
@@ -895,6 +895,8 @@ static void rkisp1_pipeline_stream_disable(struct rkisp1_capture *cap)
 {
 	struct rkisp1_device *rkisp1 = cap->rkisp1;
 
+	rkisp1_cap_stream_disable(cap);
+
 	/*
 	 * If the other capture is streaming, isp and sensor nodes shouldn't
 	 * be disabled, skip them.
@@ -907,8 +909,6 @@ static void rkisp1_pipeline_stream_disable(struct rkisp1_capture *cap)
 
 	v4l2_subdev_call(&rkisp1->resizer_devs[cap->id].sd, video, s_stream,
 			 false);
-
-	rkisp1_cap_stream_disable(cap);
 }
 
 /*
-- 
2.29.2


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

             reply	other threads:[~2020-11-06 23:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-06 23:02 Helen Koike [this message]
2020-11-06 23:02 ` [PATCH] media: staging: rkisp1: cap: fix timeout when stopping the stream Helen Koike

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=20201106230236.1884387-1-helen.koike@collabora.com \
    --to=helen.koike@collabora.com \
    --cc=dafna.hirschfeld@collabora.com \
    --cc=heiko@sntech.de \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=kernel@collabora.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mchehab@kernel.org \
    --cc=niklas.soderlund@ragnatech.se \
    --cc=ribalda@google.com \
    --cc=tfiga@chromium.org \
    --cc=zhengsq@rock-chips.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.