linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Helen Koike <helen.koike@collabora.com>
To: linux-media@vger.kernel.org
Cc: lucmaga@gmail.com, linux-kernel@vger.kernel.org,
	lkcamp@lists.libreplanetbr.org, andrealmeid@collabora.com,
	Hans Verkuil <hverkuil@xs4all.nl>,
	kernel@collabora.com
Subject: [PATCH 2/8] media: vimc: stream: fix thread state before sleep
Date: Wed,  6 Mar 2019 19:42:38 -0300	[thread overview]
Message-ID: <20190306224244.21070-3-helen.koike@collabora.com> (raw)
In-Reply-To: <20190306224244.21070-1-helen.koike@collabora.com>

The state TASK_UNINTERRUPTIBLE should be set just before
schedule_timeout() call, so it knows the sleep mode it should enter.
There is no point in setting TASK_UNINTERRUPTIBLE at the initialization
of the thread as schedule_timeout() will set the state back to
TASK_RUNNING.

This fixes a warning in __might_sleep() call, as it's expecting the
task to be in TASK_RUNNING state just before changing the state to
a sleeping state.

Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
---

 drivers/media/platform/vimc/vimc-streamer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/vimc/vimc-streamer.c b/drivers/media/platform/vimc/vimc-streamer.c
index fcc897fb247b..392754c18046 100644
--- a/drivers/media/platform/vimc/vimc-streamer.c
+++ b/drivers/media/platform/vimc/vimc-streamer.c
@@ -120,7 +120,6 @@ static int vimc_streamer_thread(void *data)
 	int i;
 
 	set_freezable();
-	set_current_state(TASK_UNINTERRUPTIBLE);
 
 	for (;;) {
 		try_to_freeze();
@@ -137,6 +136,7 @@ static int vimc_streamer_thread(void *data)
 				break;
 		}
 		//wait for 60hz
+		set_current_state(TASK_UNINTERRUPTIBLE);
 		schedule_timeout(HZ / 60);
 	}
 
-- 
2.20.1


  parent reply	other threads:[~2019-03-06 22:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-06 22:42 [PATCH 0/8] media: vimc: remove media bus code limitation Helen Koike
2019-03-06 22:42 ` [PATCH 1/8] media: vimc: deb: fix default sink bayer format Helen Koike
2019-03-06 22:42 ` Helen Koike [this message]
2019-03-06 22:42 ` [PATCH 3/8] media: vimc: cap: fix step width/height in enum framesize Helen Koike
2019-03-06 22:42 ` [PATCH 4/8] media: v4l2-common: add bayer formats in v4l2_format_info Helen Koike
2019-03-06 22:42 ` [PATCH 5/8] media: vimc: stream: cleanup frame field from struct vimc_stream Helen Koike
2019-03-07 20:19   ` André Almeida
2019-03-06 22:42 ` [PATCH 6/8] media: vimc: stream: add docs to " Helen Koike
2019-03-06 22:42 ` [PATCH 7/8] media: vimc: stream: init/terminate the first entity Helen Koike
2019-03-07 20:21   ` André Almeida
2019-03-06 22:42 ` [PATCH 8/8] media: vimc: propagate pixel format in the stream Helen Koike
2019-03-07 20:23   ` André Almeida
2019-03-08 13:43   ` Hans Verkuil

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=20190306224244.21070-3-helen.koike@collabora.com \
    --to=helen.koike@collabora.com \
    --cc=andrealmeid@collabora.com \
    --cc=hverkuil@xs4all.nl \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=lkcamp@lists.libreplanetbr.org \
    --cc=lucmaga@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).