Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3689362ybb; Mon, 6 Apr 2020 13:38:54 -0700 (PDT) X-Google-Smtp-Source: APiQypIkid5lR4jHh5HAELnZVF/yniD/0IdxGLJiNeE4iYf6r2cEePnnOsn0RcPKPU2jBi8IA03e X-Received: by 2002:a9d:63c9:: with SMTP id e9mr19442882otl.65.1586205534145; Mon, 06 Apr 2020 13:38:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586205534; cv=none; d=google.com; s=arc-20160816; b=yTe+yDRP/k4dyvBCOSFSpvqzP79D+vWueRr53ad6pto0v3OkYre/sfn6j8sppi9bnS eAG0S4BSkzBgWCzewW7JQm39uLiLC0cwUesknFDasVtV5JoN1EuuqPknaSILtEa7MLlh Ey/eBJepaMDjeXCbAnh8MYjUvUh8KS8Bc/czJc+HdELJF/LXlIgH/jtcXv/IyqJOhJ8Z hJisA+XuhIyOJNpl/67Rop4rdiAHEUBDz3CYQpqqh28MInQ73B0TRMT2wBc8MzKSwGxY zHL/pPch3kXMh7IjAVMCxrQamFjliMAIf/aenyV9Ym9Osom6NWC0yWZ6FVuXc70VwTDL J6OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=lkHfY3zspspc2eHw8nwYrvXSBPiE5Lx1JNgdOY2Uq6Q=; b=UxpCXFbWV/RWgAOKmr+2Q9FcHqRtOuoRBg7AOIfL4ElMCgj5WoKIgDAR1gEA1CBgKl 1Ikz0QhLZIz1nhCl6Ws7EbPSTlrjdUAe2A16Zyku2qmcQ/1OwMbAt8sepAiD2uTLnSxv hzDUS/f+fj6PsPQMkkqCUK37le2ddx6CsSz1svfvFcWeHCTRAIOgYpqb7c4p6NiMnqu8 mLZTQiI0nPwBz40Uz4RicjFesixHeDgpwTfPZW9qeVwRkiPOPJuy4FU8VmW/gBXCYrM0 pEXAE+JuHWh7g23jA/TdDXoLHxrKECfgo5J7D1E5ausqf5bS3pgZCvLcE3Tosfanw/Oo dPgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=JwVwR+1V; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s63si7697865oig.69.2020.04.06.13.38.41; Mon, 06 Apr 2020 13:38:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=JwVwR+1V; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726329AbgDFUiO (ORCPT + 99 others); Mon, 6 Apr 2020 16:38:14 -0400 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:3774 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725933AbgDFUiO (ORCPT ); Mon, 6 Apr 2020 16:38:14 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 06 Apr 2020 13:38:00 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 06 Apr 2020 13:38:13 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 06 Apr 2020 13:38:13 -0700 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 6 Apr 2020 20:38:13 +0000 Received: from [10.2.164.193] (10.124.1.5) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 6 Apr 2020 20:38:12 +0000 Subject: Re: [RFC PATCH v6 6/9] media: tegra: Add Tegra210 Video input driver To: Dmitry Osipenko , , , , , , CC: , , , , , References: <1585963507-12610-1-git-send-email-skomatineni@nvidia.com> <1585963507-12610-7-git-send-email-skomatineni@nvidia.com> <782c8c4e-f5c2-d75e-0410-757172dd3090@gmail.com> <86bbcd55-fa13-5a35-e38b-c23745eafb87@gmail.com> From: Sowjanya Komatineni Message-ID: <2839b1ee-dedc-d0ee-e484-32729a82a6ea@nvidia.com> Date: Mon, 6 Apr 2020 13:38:11 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <86bbcd55-fa13-5a35-e38b-c23745eafb87@gmail.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To DRHQMAIL107.nvidia.com (10.27.9.16) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1586205480; bh=lkHfY3zspspc2eHw8nwYrvXSBPiE5Lx1JNgdOY2Uq6Q=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Transfer-Encoding: Content-Language; b=JwVwR+1VxcBTUmqrtaLkPdFNMarZpOFFcf1RZDkXMF/gFZv08x7oYPNAqQTAI7N5m YoEXdpE/XoXAuwxVNm6EcsGCzmeU9nLfL5HXBpv+ZfabyJYkufgzaHmuauN59OKl2o AkZBLUKkXezBMglqNDNpyz2NDWYY7+Yi0gYLlMOmXMlRuyS5A/Gwm6W5Dcb6vq7xYX m1d/Y77VaMcngxTYY0LDlO/JZRKsQhAzZ/+cCrkaI0fhJCrsoVV98WC9cDu9I4NnFA ZhW4nQq2J2yygXTFS2mZ0bfKFT0VonR4Gh0W/73pDarO0JqLUp1R7WTS/ayK9iT5tm NufrSE8lwfYcw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/6/20 1:37 PM, Dmitry Osipenko wrote: > External email: Use caution opening links or attachments > > > 06.04.2020 23:20, Sowjanya Komatineni =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >> On 4/6/20 1:02 PM, Dmitry Osipenko wrote: >>> External email: Use caution opening links or attachments >>> >>> >>> 04.04.2020 04:25, Sowjanya Komatineni =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >>> ... >>>> +static int chan_capture_kthread_start(void *data) >>>> +{ >>>> + struct tegra_vi_channel *chan =3D data; >>>> + struct tegra_channel_buffer *buf; >>>> + int err =3D 0; >>>> + int caps_inflight; >>>> + >>>> + set_freezable(); >>>> + >>>> + while (1) { >>>> + try_to_freeze(); >>>> + >>>> + wait_event_interruptible(chan->start_wait, >>>> + !list_empty(&chan->capture) || >>>> + kthread_should_stop()); >>> Is it really okay that list_empty() isn't protected with a lock? >>> >>> Why wait_event is "interruptible"? >> To allow it to sleep until wakeup on thread it to avoid constant >> checking for condition even when no buffers are ready, basically to >> prevent blocking. > So the "interrupt" is for getting event about kthread_should_stop(), > correct? also to prevent blocking and to let is sleep and wakeup based on wait=20 queue to evaluate condition to proceed with the task >