Skip to content

Commit

Permalink
media: vimc: streamer: if kthread_stop fails, ignore the error
Browse files Browse the repository at this point in the history
Ignore errors returned from kthread_stop since the
vimc subdevices should still be notified that
streaming stopped so they can release the memory for
the streaming, and also kthread should be set to NULL.
kthread_stop can return -EINTR in case the thread
did not yet run. This can happen if userspace calls
streamon and streamoff right after.

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  • Loading branch information
Dafna Hirschfeld authored and Mauro Carvalho Chehab committed Feb 24, 2020
1 parent 3eed738 commit 8b9f917
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/media/platform/vimc/vimc-streamer.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,14 @@ int vimc_streamer_s_stream(struct vimc_stream *stream,
return 0;

ret = kthread_stop(stream->kthread);
/*
* kthread_stop returns -EINTR in cases when streamon was
* immediately followed by streamoff, and the thread didn't had
* a chance to run. Ignore errors to stop the stream in the
* pipeline.
*/
if (ret)
return ret;
dev_dbg(ved->dev, "kthread_stop returned '%d'\n", ret);

stream->kthread = NULL;

Expand Down

0 comments on commit 8b9f917

Please sign in to comment.