Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp953485imu; Sat, 15 Dec 2018 10:39:59 -0800 (PST) X-Google-Smtp-Source: AFSGD/UhqxADgmLNb/iM6cZ68MyGoEPSVZVJI8dyH5UD/GXHPJ1wpOGzY/JkM+3o8DOiwTe8YBMm X-Received: by 2002:a17:902:b90b:: with SMTP id bf11mr7147565plb.284.1544899199108; Sat, 15 Dec 2018 10:39:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544899199; cv=none; d=google.com; s=arc-20160816; b=iEOyxB87FaZD6PBuKMO5xTK8QtwbzDr011XzXTaV+seN1i9e0F+MN5Q1pP2+pbCc4y vKWHBCAdShsfgdOZtan0mMCTtMz6rKLP8lieIdE2ny5aM2701t8vxVj43zWWhTwKm+Hp ZSzlmmrDgbDYf7bbiJGJQKayNrFd0Eon8dg92BRGrFvBnDs8A4LRa4cOfuXWXRS6zA3q nVkBxptPBxrHFHF23ZnvpKLakyQY2aoIk/VbbVSanurFIiwUHWiYcZG4FqU+89e2rkEz pGJ/O0N/1JP2onCBVJ/bWfcSf0OnbTS2jB3w5iPlbziAXIOd6jMS6PDLqoyo4UDFI3Jo bVqg== 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:autocrypt:openpgp:from:references:cc:to:subject; bh=j9soD9m3HCE/l1jUWOfRwKgZD1Waev4CMcqiQNVePN8=; b=kt3/XHaGuq+4KZZpQLcyr/1Swcnxb4t0bOo5MTsYCuenLg1UZyIlvGoh6W2a72odFX o1N3Yy2b1B2eSwVhAEXWfly55pA2sjD/G/bGNNlqr87qAUX5DrKv1kFUdC7lq44al8hZ HWNTO5NLMcXUClsJX2uFexwEV4hSU4p2StnLutfbRoetYPFyqcn0YfEpkt2E+hXgRIKn VmtjbnOQP+zuUN7rcK1KejwdmjytVJuuqxvYaQdL81yKlDD+Dga+v00UTSZB5L8OE1KY 5cZLxZOQnm2WtvEpQq/+LA+3975n6d+RHyefvLJbIEzAlTIcqExQgQHEZzWKXqUnuYZc l3zw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j14si7519125pfd.113.2018.12.15.10.39.43; Sat, 15 Dec 2018 10:39:59 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729017AbeLOSiv (ORCPT + 99 others); Sat, 15 Dec 2018 13:38:51 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:38016 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726520AbeLOSiv (ORCPT ); Sat, 15 Dec 2018 13:38:51 -0500 Received: from [IPv6:2804:431:9719:f68f:53a6:20b4:af17:1a54] (unknown [IPv6:2804:431:9719:f68f:53a6:20b4:af17:1a54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: koike) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 955FA260891; Sat, 15 Dec 2018 18:38:45 +0000 (GMT) Subject: Re: [Lkcamp][PATCH] media: vimc: Add vimc-streamer for stream control To: Mauro Carvalho Chehab , =?UTF-8?Q?Lucas_A=2e_M=2e_Magalh=c3=a3es?= Cc: linux-media@vger.kernel.org, hverkuil@xs4all.nl, lkcamp@lists.libreplanetbr.org, linux-kernel@vger.kernel.org References: <20181215164631.8623-1-lucmaga@gmail.com> <20181215160110.1a353219@coco.lan> From: Helen Koike Openpgp: preference=signencrypt Autocrypt: addr=helen.koike@collabora.com; keydata= mQINBFmOMD4BEADb2nC8Oeyvklh+ataw2u/3mrl+hIHL4WSWtii4VxCapl9+zILuxFDrxw1p XgF3cfx7g9taWBrmLE9VEPwJA6MxaVnQuDL3GXxTxO/gqnOFgT3jT+skAt6qMvoWnhgurMGH wRaA3dO4cFrDlLsZIdDywTYcy7V2bou81ItR5Ed6c5UVX7uTTzeiD/tUi8oIf0XN4takyFuV Rf09nOhi24bn9fFN5xWHJooFaFf/k2Y+5UTkofANUp8nn4jhBUrIr6glOtmE0VT4pZMMLT63 hyRB+/s7b1zkOofUGW5LxUg+wqJXZcOAvjocqSq3VVHcgyxdm+Nv0g9Hdqo8bQHC2KBK86VK vB+R7tfv7NxVhG1sTW3CQ4gZb0ZugIWS32Mnr+V+0pxci7QpV3jrtVp5W2GA5HlXkOyC6C7H Ao7YhogtvFehnlUdG8NrkC3HhCTF8+nb08yGMVI4mMZ9v/KoIXKC6vT0Ykz434ed9Oc9pDow VUqaKi3ey96QczfE4NI029bmtCY4b5fucaB/aVqWYRH98Jh8oIQVwbt+pY7cL5PxS7dQ/Zuz 6yheqDsUGLev1O3E4R8RZ8jPcfCermL0txvoXXIA56t4ZjuHVcWEe2ERhLHFGq5Zw7KC6u12 kJoiZ6WDBYo4Dp+Gd7a81/WsA33Po0j3tk/8BWoiJCrjXzhtRwARAQABtCdIZWxlbiBLb2lr ZSA8aGVsZW4ua29pa2VAY29sbGFib3JhLmNvbT6JAlQEEwEKAD4WIQSofQA6zrItXEgHWTzA fqwo9yFiXQUCWY4wgwIbAQUJAsSzFAULCQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRDAfqwo 9yFiXZ+ID/9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lX36jk7S2WTT60ip8P0Vbe5G6Ua3M+WuOaF9cdpMGAQWv/ xnDQvnYgIn0en5259JRXOaKKffRNEgmtBeFfz2IepskXKmB/Ibp7UxS7wUmJxv7QWAHrtQ== Message-ID: Date: Sat, 15 Dec 2018 16:38:41 -0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <20181215160110.1a353219@coco.lan> 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 Hi Mauro, On 12/15/18 4:01 PM, Mauro Carvalho Chehab wrote: > Hi Lucas, > > > Em Sat, 15 Dec 2018 14:46:31 -0200 > Lucas A. M. Magalhães escreveu: > >> The previous code pipeline used the stack to walk on the graph and >> process a frame. Basically the vimc-sensor entity starts a thread that >> generates the frames and calls the propagate_process function to send >> this frame to each entity linked with a sink pad. The propagate_process >> will call the process_frame of the entities which will call the >> propagate_frame for each one of it's sink pad. This cycle will continue >> until it reaches a vimc-capture entity that will finally return and >> unstack. > > I didn't review the code yet, but I have a few comments about the > way you're describing this patch. > > When you mention about a "previous code pipeline". Well, by adding it > at the main body of the patch description, reviewers should expect > that you're mentioning an implementation that already reached upstream. > > I suspect that this is not the case here, as I don't think we merged > any recursive algorithm using the stack, as this is something that > we shouldn't do at Kernelspace, as a 4K stack is usually not OK > with recursive algorithms. > > So, it seems that this entire patch description (as-is) is bogus[1]. > > [1] if this is not the case and a recursive approach was indeed > sneaked into the Kernel, this is a bug. So, you should really > use the "Fixes:" meta-tag indicating what changeset this patch is > fixing, and a "Cc: stable@vger.kernel.org", in order to hint > stable maintainers that this require backports. Just fyi, this is not the case, the current implementation in mainline is bogus indeed (implemented by me when I was starting kernel development, sorry about that and thanks Lucas for sending a fix). Not only when propagating the frame [1] but also when activating the pipeline [2]. But in any case this should be better written in the commit message. [1] Every entity calls vimc_propagate_frame() https://git.linuxtv.org/media_tree.git/tree/drivers/media/platform/vimc/vimc-debayer.c#n506 That calls the process_frame() of each entity directly connected, that calls vimc_propagate_frame() again: https://git.linuxtv.org/media_tree.git/tree/drivers/media/platform/vimc/vimc-common.c#n237 [2] .s_stream is calling the .s_stream of the subdevices directly connected https://git.linuxtv.org/media_tree.git/tree/drivers/media/platform/vimc/vimc-debayer.c#n355 I was actually wondering if this is worthy in sending this to stable, as this implementation is not a real problem, because the topology in vimc is hardcoded and limited, and according to: https://www.kernel.org/doc/Documentation/process/stable-kernel-rules.rst "It must fix a real bug that bothers people" So as the topology is fixed (in the current implementation), the max number of nested calls is 4 (in the sensor->debayer->scaler->capture path), this doesn't triggers any bug to users. But this will be a problem once we have the configfs API in vimc. You could say that if your memory is low, this can be a problem in the current implementation, but then your system won't have memory for any 4 nested function calls anyway (which I think the kernel wouldn't work at all). Mauro, with that said, do you still think we should send this to stable? Thanks Helen > > Please notice that the patch description will be stored forever > at the git tree. Mentioning something that were never merged > (and that, years from now people will hardly remember, and will > have lots of trouble to seek as you didn't even mentioned any > ML archive with the past solution) shouldn't be done. > > So, you should rewrite the entire patch description explaining > what the current approach took by this patch does. Then, in order > to make easier for reviewers to compare with a previous implementation, > you can add a "---" line and then a description about why this approach > is better than the first version, e. g. something like: > > [PATCH v2] media: vimc: Add vimc-streamer for stream control > > Add a logic that will create a linear pipeline walking > backwards on the graph. When the stream starts it will simply > loop through the pipeline calling the respective process_frame > function for each entity on the pipeline. > > Signed-off-by: Your Name > > --- > > v2: The previous approach were to use a recursive function that > it was using the stack to walk on the graph and > process a frame. Basically the vimc-sensor entity starts a thread that > generates the frames and calls the propagate_process function to send > this frame to each entity linked with a sink pad. The propagate_process > will call the process_frame of the entities which will call the > propagate_frame for each one of it's sink pad. This cycle will continue > until it reaches a vimc-capture entity that will finally return and > unstack. > ... > > If the past approach was written by somebody else (or if you sent it > a long time ago), please add an URL (if possible using > https://lore.kernel.org/linux-media/ archive) pointing to the previous > approach, in order to help us to check what you're referring to. > > Regards, > Mauro > > Thanks, > Mauro >