Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp35343ybb; Tue, 7 Apr 2020 16:13:31 -0700 (PDT) X-Google-Smtp-Source: APiQypIfEYVOCdWdL5Y6/L/62coVZRwV9bNCUMiQhNWhXZKIbI8A7B2lL5nNXwhHGfeysOYQKHo0 X-Received: by 2002:a05:6820:122:: with SMTP id i2mr3813080ood.73.1586301211515; Tue, 07 Apr 2020 16:13:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586301211; cv=none; d=google.com; s=arc-20160816; b=j58F4jGsBN+9s7LOaIqzZIg0rfNPY+4aLCuwqkTTJ0nKEMJOe+b4Pc6r3QP+OXQ4fZ szXP0wryuAOwzAN0Bv6K9lHsAOWcoQqwV29EuxBLvIka8YgRutICILec/8P+IMp274cD OCpL+v6egk/rIOLYaC89NB7qB2+Nznoqvp8IliUjvKwTDUW5XNOKYnntVg4qx1mrXh3U XFd4gvzwt2J5o5fBWWIK/f87XZNqq72ei2dkLhdUp0malyqaXwzb9NJesmOuOpAwbTSc VoovhVcmpwqR5bT+zMQgEgKKksROA4deJIxzytqCdFEy8whPP90Ax5aojhu8H+Y2b1gO r3lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=RwBDvU/d/RuyuOicf+LMSeUuB7FpaSGPCFNY8uUMcT8=; b=WUjT8eQ5LKEeoRztoAUa6hHKxPqhyZrgur4pZTIgkRE75PVwC0Z0+W185f1Oz5QXYd xpBgoV3ywHzllgeh6WCTMrALFJg1GJdz6cffSyH+b941wpJ6UJ9sBLg0e1UaZfnYaYyv DSuOkR4uMdRW093HOJhis/8g/TYGa2Q8OOvq5UkkI7/3EnY5FmCTZfOTIZCJ9OjzhIOP gP7UH/IWcZR+HZdm25J0it4tL7Mszap9oeEa17XHC1F+boIXvdZbJsTbYkEoCDsbhBQR ERQnfZMlFb7w7Iw3b4WghEj/bo/OF2Hf/PetDxJHRO5sHWv+lebfHi/JfjOdUFdv6IZO yuAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ITb0PCiL; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k98si1827819otk.104.2020.04.07.16.13.16; Tue, 07 Apr 2020 16:13:31 -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=@gmail.com header.s=20161025 header.b=ITb0PCiL; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726444AbgDGXMc (ORCPT + 99 others); Tue, 7 Apr 2020 19:12:32 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:46583 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726380AbgDGXMc (ORCPT ); Tue, 7 Apr 2020 19:12:32 -0400 Received: by mail-lf1-f68.google.com with SMTP id m19so1677410lfq.13; Tue, 07 Apr 2020 16:12:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=RwBDvU/d/RuyuOicf+LMSeUuB7FpaSGPCFNY8uUMcT8=; b=ITb0PCiLvFvAVN7bpWpJlckTjQ8s/wjqbxLsbWXCFsj+XrR6vru92/JlT6lzOgpb0u GvSyCbY86jIPTEp7Rr6UG3CpHXhrlyN6C7QMfn9hGHT5V94hmDalVuuw6l9Uj+jhnEpL 0w+zGOx2K4nyKvpPS1itml53GKUo/T2CDvs+jNKP83LXgAiqyUEMkQukAExr3FGhUMK0 /q2xBHo/iw98t6r1GJ1gaaC8/QbQZmkYgHikswey901fj0KneeQkZ/8Oq6B4+5lXpTPy QCx3IlR4i1XwPUTGs2RiyEngHTxoZVbLXWuUTpGiGD93wuoUcU/BPwTEWWiry2rngf2P dYpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RwBDvU/d/RuyuOicf+LMSeUuB7FpaSGPCFNY8uUMcT8=; b=A8cj4Mm/6m7HBUghxwF8KyDY8QfJD5MoDA5jW8IJuOMEmFWCA6o3ihf2QRPynMe/9r Hy9a1L7ur3XRdLN21rzampW7+uxxC+jypwsQe49wK4ZYGXEkMsfN5g50G9qBk/D+O27r fT8j/ExA6jz8VSiE14WfNBACgYMY6471MnSbv+sRlU9aS1oP3wc6q7P4SgQNDCH39zEP tDwkVeK9THQ0iv9o3nY8euBNmGokrOGuGm1v994Ckn613Gc7vzyrq5wgwNzcllPGynZM qHhycVQ8jStsP3pay3g35A7mWT7LEJXZgSg1c2712EgsqlV3m7DTG/4hu3JhY7idIrCe vDYw== X-Gm-Message-State: AGi0PuatZMcSzG14cIesifDWQDDJG8I2gc48bLlbKibvskhFrwa7tQZI IyGILgnDNkiIXiD2dJRrKh4zTns6 X-Received: by 2002:ac2:5607:: with SMTP id v7mr2758744lfd.212.1586301148120; Tue, 07 Apr 2020 16:12:28 -0700 (PDT) Received: from [192.168.2.145] (ppp91-78-208-152.pppoe.mtu-net.ru. [91.78.208.152]) by smtp.googlemail.com with ESMTPSA id c2sm14650894lfb.43.2020.04.07.16.12.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Apr 2020 16:12:27 -0700 (PDT) Subject: Re: [RFC PATCH v6 6/9] media: tegra: Add Tegra210 Video input driver To: Sowjanya Komatineni , thierry.reding@gmail.com, jonathanh@nvidia.com, frankc@nvidia.com, hverkuil@xs4all.nl, sakari.ailus@iki.fi, helen.koike@collabora.com Cc: sboyd@kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org References: <1585963507-12610-1-git-send-email-skomatineni@nvidia.com> <1585963507-12610-7-git-send-email-skomatineni@nvidia.com> <200bb96e-2d07-764f-9e14-55538dc742fd@gmail.com> <23bfab09-b464-6e51-9843-06d13000e9b9@nvidia.com> <08cd31d5-e8b9-4d3a-fb0e-0e4462947d96@nvidia.com> <12a834ac-52b1-6dc0-7d3a-3e6a1fa85a2a@gmail.com> <760d071e-0cbc-b3eb-9231-fb9f9ecb44a6@nvidia.com> <9e317f65-8a02-3b15-cfec-8e0d8374130e@gmail.com> <97b35910-4c93-123a-43a0-eb14476ed0f3@nvidia.com> <84ad4e2d-6ac1-e1f4-1c55-5edaae850631@nvidia.com> <15a879b3-8fb9-6821-3cdc-104ba583ac12@gmail.com> <0c425505-347f-7418-af7e-d121fe0d06dc@nvidia.com> From: Dmitry Osipenko Message-ID: Date: Wed, 8 Apr 2020 02:12:26 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <0c425505-347f-7418-af7e-d121fe0d06dc@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 08.04.2020 01:22, Sowjanya Komatineni пишет: > > On 4/7/20 3:08 PM, Dmitry Osipenko wrote: >> External email: Use caution opening links or attachments >> >> >> 08.04.2020 00:08, Sowjanya Komatineni пишет: >> ... >>>>> I think you need a semaphore with resource count = 2. >>>> we hold on to issuing capture if more than 2 buffers are queued and it >>>> continues only after fifo has min 1 slot empty >>> >>> Just want to close on this part of feedback. Hope above explanation is >>> clear regarding triggering/issuing at max 2 frame capture to VI HW and >>> also regarding capture threads where they use wait_event_interruptible >>> to prevent blocking waiting for buffers to be available for captures. >>> >>> So no changes related to this part are needed in v7. >>  From what I see in the code, you "hold on" by making kthread to spin in >> a busy-loop while caps_inflight >= SYNCPT_FIFO_DEPTH. So some change >> should be needed to prevent this. >> >> The wait_event_interruptible seems should be okay. > > We don't want to prevent that as we already have buffers available for > capture so as soon as VI HW issuing single shot is done and when min 1 > slot is empty we should continue with issuing for another capture. > > As long as buffers are available, we should continue to capture and > should not hold > I suppose that taking a shot takes at least few milliseconds, which should be unacceptable to waste.