Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3699173ybb; Mon, 6 Apr 2020 13:54:32 -0700 (PDT) X-Google-Smtp-Source: APiQypIBtxtoS5RIy3vfM9qslPmPO83lu8hLwWBkh3ensnxhty9jpDfCP+xt87qd0q+gyDj7lhUG X-Received: by 2002:aca:eb4c:: with SMTP id j73mr894147oih.145.1586206471908; Mon, 06 Apr 2020 13:54:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586206471; cv=none; d=google.com; s=arc-20160816; b=BtvNzezI6yAv0u0uWnS1CbVfmoat0FvadWqOsgSCfXd1DhvoRjPiPnSRX1fKf5gLnG oBwwK5kxZIjVaYSzTpBGO5cZ+DB1VMgW86of2uymOoj42tJqk6uCMVG4e9l1WMICfwg6 utrwiPUn/IlWxc8/wI8QtGF1d7olVI+lxU2yd3UjuFt5KuFQdp2dEFAT8INEVIT9/p+Z aCm9R3QHVUPfuJ4da82q7zEGJxbfcr38hx1U2J0ALuuOGYyAFRZCoXcyaoFYkH8rMkUd 6AP3xY11VI8bBI29GflEFe54530VWmICmBgBo75L4gxRepSgRDqPNDy8bFyzCjI5Fnzb wUWQ== 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=NsnlQPkOu0I9hxPUVqMcoqIuvbuxd6yL4BRh38XbG/s=; b=HIPTS4EHRgNIYzzclaFFH0LS1QvJB/UZJ2JBuH9mmnKgTPu03xVp3u/6+eVzfNu8PP lpR7l2tS4w/vdRECJnIcQBMzviRGrFfWX7Wk7Qbr5YQoQlj1OX9VWrF/tAs9tld3gJph UhZ6uGP3pgUmh71z0l9+Qw7UzHPg71OWkFbWIKNwlRIwFMo5W9pzJfNYYk9XlYomNTcu RHV75ISnx6Jv+aD2mtCoIHG/4Wy9hEMIlMasXdZZ3cxT9jHZ3QOU21Qwd6kKZWg4/dtN aMdY4awuWRQaCJazMo1Um6Vlzhr6JYkhMF1ACIhevkNKLXAnTvdxOUcNfLKAmffA5QH0 bhyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=exuIaN4C; 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 b5si8328354oif.104.2020.04.06.13.54.19; Mon, 06 Apr 2020 13:54: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=exuIaN4C; 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 S1726393AbgDFUxj (ORCPT + 99 others); Mon, 6 Apr 2020 16:53:39 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:37874 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725957AbgDFUxj (ORCPT ); Mon, 6 Apr 2020 16:53:39 -0400 Received: by mail-lj1-f194.google.com with SMTP id r24so1274451ljd.4; Mon, 06 Apr 2020 13:53:35 -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=NsnlQPkOu0I9hxPUVqMcoqIuvbuxd6yL4BRh38XbG/s=; b=exuIaN4CzcXYvGtI8SZcV7mmo8ozQ+K00h75JyOXe9IfkfzMPonwlG0KLd/sPWwt8R wNgEmxKMSudk8By3FVl9UliCmuoVHgnZv8QhX079kjEP8G7iPRmZaz92WCzIHqEAx+GG gYnRMTKfWVrK5aH5RcYtTLGDj2zUE7gSyi6FBMQ/fsoKcfHE3R+xBbjdW6smHp32nvS6 +joVAshhF4T0DuruVsNs7dJRe2ICjo1o+CbBI5jo3f8HHpXdzoq6ttrlL4Lvc+DSj7Ku mkB/gDKk1Mkn9Imi7iPhbrGszqK/4TMguQ0rgsYiK50RhtX90CqkRvlDCJEm5TQQBLs6 tL6Q== 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=NsnlQPkOu0I9hxPUVqMcoqIuvbuxd6yL4BRh38XbG/s=; b=d9PFifXLSgjkTJNgnqAzhpi9ARxHcPDOBy/UWGR5HNJIl85qzbRIICmYSz6Px/Jw4V Zfob7Emhidys9kwwXGg6QllL2FM0iiE3ZkAmNRLoWqIG/jPp/tsWdo0DvYYHXuLxqCSe Py2safoakuP1D1DBef2z/+p44Hz/DCX0hQn6JfVUiaE2w/18fzvgcD7w7EY/RMLWfNhT 1XbP3cEWoFNx9yiOpqvAfWRsr/HKBhBAqmWCZkieJIqpeKB9cEF9+zv91dGAyhDHKhJo 02QbsX/+mOD5lTKhyRJTXQz5NYqPNRuXamZZjZb7FeeqpOBNQANiHBsrACvod6uZp9nY TZvw== X-Gm-Message-State: AGi0PuZKFzkoNjUSUT4qygN7nyL8jwpM756HKg1UYpkmPtRDxPLiLdEY y7aAbIFlNh4dHDcmnMj3Yxsk7S75 X-Received: by 2002:a2e:868b:: with SMTP id l11mr687737lji.247.1586206414049; Mon, 06 Apr 2020 13:53:34 -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 n17sm10795873ljc.76.2020.04.06.13.53.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Apr 2020 13:53:33 -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> From: Dmitry Osipenko Message-ID: Date: Mon, 6 Apr 2020 23:53:31 +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: <23bfab09-b464-6e51-9843-06d13000e9b9@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 06.04.2020 23:50, Sowjanya Komatineni пишет: > > On 4/6/20 1:45 PM, Dmitry Osipenko wrote: >> External email: Use caution opening links or attachments >> >> >> 04.04.2020 04:25, Sowjanya Komatineni пишет: >>> +static int chan_capture_kthread_start(void *data) >>> +{ >>> +     struct tegra_vi_channel *chan = data; >>> +     struct tegra_channel_buffer *buf; >>> +     int err = 0; >>> +     int caps_inflight; >>> + >>> +     set_freezable(); >>> + >>> +     while (1) { >>> +             try_to_freeze(); >>> + >>> +             wait_event_interruptible(chan->start_wait, >>> +                                      !list_empty(&chan->capture) || >>> +                                      kthread_should_stop()); >>> +             /* >>> +              * Frame start and MW_ACK_DONE syncpoint condition >>> FIFOs are >>> +              * of max depth 2. So make sure max 2 capture requests are >>> +              * in process by the hardware at a time. >>> +              */ >>> +             while (!(kthread_should_stop() || >>> list_empty(&chan->capture))) { >>> +                     caps_inflight = chan->capture_reqs - >>> chan->sequence; >>> +                     /* >>> +                      * Source is not streaming if error is non-zero. >>> +                      * So, do not dequeue buffers on capture error >>> or when >>> +                      * syncpoint requests in FIFO are full. >>> +                      */ >>> +                     if (err || caps_inflight >= SYNCPT_FIFO_DEPTH) >>> +                             break; >> Am I understanding correctly that this thread will take 100% CPU, >> spinning here, if more than 2 frame-captures queued? > on more than 2 frames captures, it breaks thread and on next wakeup it > continues The wait_event() won't wait if condition is true.