aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/vimc/vimc-streamer.c
diff options
context:
space:
mode:
authorHelen Fornazier <helen.koike@collabora.com>2019-03-06 17:42:38 -0500
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-03-19 15:27:22 -0400
commit2978a505aaa981b279ef359f74ba93d25098e0a0 (patch)
tree8a6dbce7956bb9fcfc7cedf8a4483ccd603096ed /drivers/media/platform/vimc/vimc-streamer.c
parent85ab1aa1fac17bcd79d6d08f835957b46870d0d0 (diff)
media: vimc: stream: fix thread state before sleep
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> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform/vimc/vimc-streamer.c')
-rw-r--r--drivers/media/platform/vimc/vimc-streamer.c2
1 files changed, 1 insertions, 1 deletions
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)
120 int i; 120 int i;
121 121
122 set_freezable(); 122 set_freezable();
123 set_current_state(TASK_UNINTERRUPTIBLE);
124 123
125 for (;;) { 124 for (;;) {
126 try_to_freeze(); 125 try_to_freeze();
@@ -137,6 +136,7 @@ static int vimc_streamer_thread(void *data)
137 break; 136 break;
138 } 137 }
139 //wait for 60hz 138 //wait for 60hz
139 set_current_state(TASK_UNINTERRUPTIBLE);
140 schedule_timeout(HZ / 60); 140 schedule_timeout(HZ / 60);
141 } 141 }
142 142