From patchwork Mon Jan 13 18:59:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 11330771 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5BFB992A for ; Mon, 13 Jan 2020 19:00:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 43FEE21569 for ; Mon, 13 Jan 2020 19:00:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728633AbgAMTAr (ORCPT ); Mon, 13 Jan 2020 14:00:47 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:51256 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726878AbgAMTAr (ORCPT ); Mon, 13 Jan 2020 14:00:47 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dafna) with ESMTPSA id 214A828E055 From: Dafna Hirschfeld To: linux-media@vger.kernel.org Cc: dafna.hirschfeld@collabora.com, helen.koike@collabora.com, ezequiel@collabora.com, skhan@linuxfoundation.org, hverkuil@xs4all.nl, kernel@collabora.com, dafna3@gmail.com Subject: [PATCH] media: vimc: streamer: if kthread_stop fails, ignore the error Date: Mon, 13 Jan 2020 20:59:34 +0200 Message-Id: <20200113185934.15722-2-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200113185934.15722-1-dafna.hirschfeld@collabora.com> References: <20200113185934.15722-1-dafna.hirschfeld@collabora.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 ran. This can happen if userspace calls streamon and streamoff right after. Signed-off-by: Dafna Hirschfeld --- drivers/media/platform/vimc/vimc-streamer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/platform/vimc/vimc-streamer.c b/drivers/media/platform/vimc/vimc-streamer.c index cd6b55433c9e..5c5d3c068398 100644 --- a/drivers/media/platform/vimc/vimc-streamer.c +++ b/drivers/media/platform/vimc/vimc-streamer.c @@ -216,8 +216,7 @@ int vimc_streamer_s_stream(struct vimc_stream *stream, ret = kthread_stop(stream->kthread); if (ret) - return ret; - + dev_warn(ved->dev, "kthread_stop returned '%d'\n", ret); stream->kthread = NULL; vimc_streamer_pipeline_terminate(stream);