summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDafna Hirschfeld <dafna.hirschfeld@collabora.com>2020-01-22 12:52:51 +0300
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-02-24 19:16:56 +0300
commit8b9f91751b6ff19449526d63a0675177ce10f9c7 (patch)
tree3ea7c79be663c03bd59ee0f732f29033699e9830
parent3eed7385bff6fc20edbe77edce3940b6cc3bf134 (diff)
downloadlinux-8b9f91751b6ff19449526d63a0675177ce10f9c7.tar.xz
media: vimc: streamer: if kthread_stop fails, ignore the error
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>
-rw-r--r--drivers/media/platform/vimc/vimc-streamer.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/platform/vimc/vimc-streamer.c b/drivers/media/platform/vimc/vimc-streamer.c
index 43e494df61d8..65feb3c596db 100644
--- a/drivers/media/platform/vimc/vimc-streamer.c
+++ b/drivers/media/platform/vimc/vimc-streamer.c
@@ -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;