Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit acf41fb8 authored by Helen Fornazier's avatar Helen Fornazier Committed by Greg Kroah-Hartman
Browse files

media: vimc: stream: fix thread state before sleep



[ Upstream commit 2978a505aaa981b279ef359f74ba93d25098e0a0 ]

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: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarHelen Koike <helen.koike@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent aeea8786
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -120,7 +120,6 @@ static int vimc_streamer_thread(void *data)
	int i;
	int i;


	set_freezable();
	set_freezable();
	set_current_state(TASK_UNINTERRUPTIBLE);


	for (;;) {
	for (;;) {
		try_to_freeze();
		try_to_freeze();
@@ -137,6 +136,7 @@ static int vimc_streamer_thread(void *data)
				break;
				break;
		}
		}
		//wait for 60hz
		//wait for 60hz
		set_current_state(TASK_UNINTERRUPTIBLE);
		schedule_timeout(HZ / 60);
		schedule_timeout(HZ / 60);
	}
	}