[{"id":21778,"web_url":"https://patchwork.libcamera.org/comment/21778/","msgid":"<Ybixw0dIZyC6wQL4@paasikivi.fi.intel.com>","date":"2021-12-14T15:01:23","subject":"Re: [libcamera-devel] [PATCH 3/5] media: entity: Skip non-data\n\tlinks in graph iteration","submitter":{"id":37,"url":"https://patchwork.libcamera.org/api/people/37/","name":"Sakari Ailus","email":"sakari.ailus@linux.intel.com"},"content":"Hi Daniel,\n\nOn Mon, Dec 13, 2021 at 11:28:47PM +0000, Daniel Scally wrote:\n> When iterating over the media graph, don't follow links that are not\n> pad-to-pad links.\n> \n> Signed-off-by: Daniel Scally <djrscally@gmail.com>\n> ---\n> Changes since the rfc:\n> \n> \t- new patch\n> \n>  drivers/media/mc/mc-entity.c | 8 ++++++++\n>  1 file changed, 8 insertions(+)\n> \n> diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c\n> index d79eb88bc167..aeddc3f6310e 100644\n> --- a/drivers/media/mc/mc-entity.c\n> +++ b/drivers/media/mc/mc-entity.c\n> @@ -325,6 +325,14 @@ static void media_graph_walk_iter(struct media_graph *graph)\n>  \n>  \tlink = list_entry(link_top(graph), typeof(*link), list);\n>  \n> +\t/* If the link is not a pad-to-pad link, don't follow it */\n\nThis comment should mention data links, not pad-to-pad links.\n\nSeems fine apart from this.\n\n> +\tif ((link->flags & MEDIA_LNK_FL_LINK_TYPE) != MEDIA_LNK_FL_DATA_LINK) {\n> +\t\tlink_top(graph) = link_top(graph)->next;\n> +\t\tdev_dbg(entity->graph_obj.mdev->dev, \"walk: skipping %s link\\n\",\n> +\t\t\tlink_type(link));\n> +\t\treturn;\n> +\t}\n> +\n>  \t/* The link is not enabled so we do not follow. */\n>  \tif (!(link->flags & MEDIA_LNK_FL_ENABLED)) {\n>  \t\tlink_top(graph) = link_top(graph)->next;","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 8A4BBBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 14 Dec 2021 15:01:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AE731608A4;\n\tTue, 14 Dec 2021 16:01:32 +0100 (CET)","from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 948E560117\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Dec 2021 16:01:30 +0100 (CET)","from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; \n\t14 Dec 2021 07:01:28 -0800","from paasikivi.fi.intel.com ([10.237.72.42])\n\tby fmsmga002-auth.fm.intel.com with\n\tESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2021 07:01:25 -0800","from paasikivi.fi.intel.com (localhost [127.0.0.1])\n\tby paasikivi.fi.intel.com (Postfix) with SMTP id 5853D20462;\n\tTue, 14 Dec 2021 17:01:23 +0200 (EET)"],"X-IronPort-AV":["E=McAfee;i=\"6200,9189,10197\"; a=\"239215718\"","E=Sophos;i=\"5.88,205,1635231600\"; d=\"scan'208\";a=\"239215718\"","E=Sophos;i=\"5.88,205,1635231600\"; d=\"scan'208\";a=\"609890038\""],"Date":"Tue, 14 Dec 2021 17:01:23 +0200","From":"Sakari Ailus <sakari.ailus@linux.intel.com>","To":"Daniel Scally <djrscally@gmail.com>","Message-ID":"<Ybixw0dIZyC6wQL4@paasikivi.fi.intel.com>","References":"<20211213232849.40071-1-djrscally@gmail.com>\n\t<20211213232849.40071-4-djrscally@gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20211213232849.40071-4-djrscally@gmail.com>","Subject":"Re: [libcamera-devel] [PATCH 3/5] media: entity: Skip non-data\n\tlinks in graph iteration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org, linux-media@vger.kernel.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21779,"web_url":"https://patchwork.libcamera.org/comment/21779/","msgid":"<955c5e8e-d898-9987-4f21-f7dacb6b178e@gmail.com>","date":"2021-12-14T16:14:21","subject":"Re: [libcamera-devel] [PATCH 3/5] media: entity: Skip non-data\n\tlinks in graph iteration","submitter":{"id":90,"url":"https://patchwork.libcamera.org/api/people/90/","name":"Daniel Scally","email":"djrscally@gmail.com"},"content":"Hi Sakari\n\nOn 14/12/2021 15:01, Sakari Ailus wrote:\n> Hi Daniel,\n>\n> On Mon, Dec 13, 2021 at 11:28:47PM +0000, Daniel Scally wrote:\n>> When iterating over the media graph, don't follow links that are not\n>> pad-to-pad links.\n>>\n>> Signed-off-by: Daniel Scally <djrscally@gmail.com>\n>> ---\n>> Changes since the rfc:\n>>\n>> \t- new patch\n>>\n>>  drivers/media/mc/mc-entity.c | 8 ++++++++\n>>  1 file changed, 8 insertions(+)\n>>\n>> diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c\n>> index d79eb88bc167..aeddc3f6310e 100644\n>> --- a/drivers/media/mc/mc-entity.c\n>> +++ b/drivers/media/mc/mc-entity.c\n>> @@ -325,6 +325,14 @@ static void media_graph_walk_iter(struct media_graph *graph)\n>>  \n>>  \tlink = list_entry(link_top(graph), typeof(*link), list);\n>>  \n>> +\t/* If the link is not a pad-to-pad link, don't follow it */\n> This comment should mention data links, not pad-to-pad links.\n\n\nI wondered about the terminology of this actually...since we create\nthose links with media_create_pad_link(), and they're called pad-to-pad\nlinks in the documentation [1], but in other cases called data links. Do\nwe need to fix those other references too?\n\n\n\n[1] https://www.kernel.org/doc/html/v5.0/media/kapi/mc-core.html#links\n\n>\n> Seems fine apart from this.\n>\n>> +\tif ((link->flags & MEDIA_LNK_FL_LINK_TYPE) != MEDIA_LNK_FL_DATA_LINK) {\n>> +\t\tlink_top(graph) = link_top(graph)->next;\n>> +\t\tdev_dbg(entity->graph_obj.mdev->dev, \"walk: skipping %s link\\n\",\n>> +\t\t\tlink_type(link));\n>> +\t\treturn;\n>> +\t}\n>> +\n>>  \t/* The link is not enabled so we do not follow. */\n>>  \tif (!(link->flags & MEDIA_LNK_FL_ENABLED)) {\n>>  \t\tlink_top(graph) = link_top(graph)->next;","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 7570DBDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 14 Dec 2021 16:14:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 87604608E6;\n\tTue, 14 Dec 2021 17:14:25 +0100 (CET)","from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com\n\t[IPv6:2a00:1450:4864:20::32e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C5AC560117\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Dec 2021 17:14:23 +0100 (CET)","by mail-wm1-x32e.google.com with SMTP id\n\tbg2-20020a05600c3c8200b0034565c2be15so334040wmb.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Dec 2021 08:14:23 -0800 (PST)","from [192.168.0.14]\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161])\n\tby smtp.gmail.com with ESMTPSA id\n\tn14sm351421wrf.69.2021.12.14.08.14.22\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tTue, 14 Dec 2021 08:14:22 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"qZwY9nkf\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-transfer-encoding:content-language; \n\tbh=IupzqiTOprMwR2B3/yWJktKUpQNfnnD6emk0joRZoCk=;\n\tb=qZwY9nkfC+T+EfEBVLJsTP3wkCnISXFGxr//yaGCqvgNooaya2AopLqkoVWFZIDpwq\n\tb2ZB95f7j76tCq674XBO3LxlEOOjhhQJfHih1gOlhTg2oiFIYRqzav38mXG3H+7VCT5l\n\tTCqqeQCnWT3KS2JaUHTkjnAp7K2mXJq8j51nK/uyhqbObqUwlV0njgWoI5kE88TePGl1\n\tp+Y2wyVHTyQ9uhkPy5dA8N6SOaPgMgkKb9FtM6MWzafLBgB316H4mszgr1Afvxhp3HPo\n\tCnO1mcfRhG1jR3cUvvtbbzKyapDjh3Kflm6LKlENehdxl6xvg4GLSjyetN1jkWj/8X1R\n\tPwIA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:subject:to:cc:references:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-transfer-encoding\n\t:content-language;\n\tbh=IupzqiTOprMwR2B3/yWJktKUpQNfnnD6emk0joRZoCk=;\n\tb=qTbYef9dFMQoJi0ZI9NGtY1n31oJAGHjLrGNUHfYnaGHKJQITigF9yYDLb3+4PZDNR\n\tCz3o4cQXZzkwvRbGZMC8b9olm+mwo2+oiKerQ2VzVwnwmD5jdiW2Sl+sKXJZGFOK8ce9\n\tviYN1TcVnwKujBteIIBNOP/UBuCE60/qdgH2JZpnn3zIRYPU5d+1aZ2Es2sDjnwKZS0Q\n\t2kja6m/7tkttW9uGLiRlZZ29V7z5StbwLqHHsfGtwe5AhijvcnnonLMeSHxBksVjG3ik\n\tnzJh6mNwtM0GIpMOkVmyVeBhVixT658XhrClbkVq9vzhmA94e1JhJkLlYoeui20QcZvX\n\t+YPw==","X-Gm-Message-State":"AOAM5305n5wnDSy0qhYw5+HkUZIWIjof7Re0v4D+bZPHf1/oL4YkkRp6\n\tOxIDFwOpJlLU7nVLnFu4WKU=","X-Google-Smtp-Source":"ABdhPJyiotZJ5tCuGbuiSgy9mb+Mkg8NCKOSyqZ9tkSYWuzPTTZ0DKMQA8VE1y8z1Y2T0qshBLrV2Q==","X-Received":"by 2002:a7b:cf02:: with SMTP id l2mr48303608wmg.78.1639498463466;\n\tTue, 14 Dec 2021 08:14:23 -0800 (PST)","To":"Sakari Ailus <sakari.ailus@linux.intel.com>","References":"<20211213232849.40071-1-djrscally@gmail.com>\n\t<20211213232849.40071-4-djrscally@gmail.com>\n\t<Ybixw0dIZyC6wQL4@paasikivi.fi.intel.com>","From":"Daniel Scally <djrscally@gmail.com>","Message-ID":"<955c5e8e-d898-9987-4f21-f7dacb6b178e@gmail.com>","Date":"Tue, 14 Dec 2021 16:14:21 +0000","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.14.0","MIME-Version":"1.0","In-Reply-To":"<Ybixw0dIZyC6wQL4@paasikivi.fi.intel.com>","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"7bit","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [PATCH 3/5] media: entity: Skip non-data\n\tlinks in graph iteration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org, linux-media@vger.kernel.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21780,"web_url":"https://patchwork.libcamera.org/comment/21780/","msgid":"<YbkLBobSglC1sgsF@paasikivi.fi.intel.com>","date":"2021-12-14T21:22:14","subject":"Re: [libcamera-devel] [PATCH 3/5] media: entity: Skip non-data\n\tlinks in graph iteration","submitter":{"id":37,"url":"https://patchwork.libcamera.org/api/people/37/","name":"Sakari Ailus","email":"sakari.ailus@linux.intel.com"},"content":"Hi Daniel,\n\nOn Tue, Dec 14, 2021 at 04:14:21PM +0000, Daniel Scally wrote:\n> Hi Sakari\n> \n> On 14/12/2021 15:01, Sakari Ailus wrote:\n> > Hi Daniel,\n> >\n> > On Mon, Dec 13, 2021 at 11:28:47PM +0000, Daniel Scally wrote:\n> >> When iterating over the media graph, don't follow links that are not\n> >> pad-to-pad links.\n> >>\n> >> Signed-off-by: Daniel Scally <djrscally@gmail.com>\n> >> ---\n> >> Changes since the rfc:\n> >>\n> >> \t- new patch\n> >>\n> >>  drivers/media/mc/mc-entity.c | 8 ++++++++\n> >>  1 file changed, 8 insertions(+)\n> >>\n> >> diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c\n> >> index d79eb88bc167..aeddc3f6310e 100644\n> >> --- a/drivers/media/mc/mc-entity.c\n> >> +++ b/drivers/media/mc/mc-entity.c\n> >> @@ -325,6 +325,14 @@ static void media_graph_walk_iter(struct media_graph *graph)\n> >>  \n> >>  \tlink = list_entry(link_top(graph), typeof(*link), list);\n> >>  \n> >> +\t/* If the link is not a pad-to-pad link, don't follow it */\n> > This comment should mention data links, not pad-to-pad links.\n> \n> \n> I wondered about the terminology of this actually...since we create\n> those links with media_create_pad_link(), and they're called pad-to-pad\n> links in the documentation [1], but in other cases called data links. Do\n> we need to fix those other references too?\n> \n> \n> \n> [1] https://www.kernel.org/doc/html/v5.0/media/kapi/mc-core.html#links\n\nGood point.\n\nThere were only one type of links before the interface links were\nintroduced. Some of the documentation seems to discuss pad links whereas\nthe corresponding macro name is MEDIA_LNK_FL_DATA_LINK. What the links\nreally represent is flow of data.\n\nIt would be good to align this, although that should probably be done in a\ndifferent context from this patchset.","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 48A13BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 14 Dec 2021 21:22:27 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 76A85608E5;\n\tTue, 14 Dec 2021 22:22:26 +0100 (CET)","from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B6732605A7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Dec 2021 22:22:24 +0100 (CET)","from orsmga003.jf.intel.com ([10.7.209.27])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; \n\t14 Dec 2021 13:22:19 -0800","from paasikivi.fi.intel.com ([10.237.72.42])\n\tby orsmga003-auth.jf.intel.com with\n\tESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2021 13:22:17 -0800","from paasikivi.fi.intel.com (localhost [127.0.0.1])\n\tby paasikivi.fi.intel.com (Postfix) with SMTP id 023D4200D3;\n\tTue, 14 Dec 2021 23:22:15 +0200 (EET)"],"X-IronPort-AV":["E=McAfee;i=\"6200,9189,10197\"; a=\"219103173\"","E=Sophos;i=\"5.88,206,1635231600\"; d=\"scan'208\";a=\"219103173\"","E=Sophos;i=\"5.88,206,1635231600\"; d=\"scan'208\";a=\"463977346\""],"Date":"Tue, 14 Dec 2021 23:22:14 +0200","From":"Sakari Ailus <sakari.ailus@linux.intel.com>","To":"Daniel Scally <djrscally@gmail.com>","Message-ID":"<YbkLBobSglC1sgsF@paasikivi.fi.intel.com>","References":"<20211213232849.40071-1-djrscally@gmail.com>\n\t<20211213232849.40071-4-djrscally@gmail.com>\n\t<Ybixw0dIZyC6wQL4@paasikivi.fi.intel.com>\n\t<955c5e8e-d898-9987-4f21-f7dacb6b178e@gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<955c5e8e-d898-9987-4f21-f7dacb6b178e@gmail.com>","Subject":"Re: [libcamera-devel] [PATCH 3/5] media: entity: Skip non-data\n\tlinks in graph iteration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org, linux-media@vger.kernel.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21782,"web_url":"https://patchwork.libcamera.org/comment/21782/","msgid":"<e6d79347-0fc7-9e94-f968-e630ac87d451@gmail.com>","date":"2021-12-14T21:37:14","subject":"Re: [libcamera-devel] [PATCH 3/5] media: entity: Skip non-data\n\tlinks in graph iteration","submitter":{"id":90,"url":"https://patchwork.libcamera.org/api/people/90/","name":"Daniel Scally","email":"djrscally@gmail.com"},"content":"Hi Sakari\n\nOn 14/12/2021 21:22, Sakari Ailus wrote:\n> Hi Daniel,\n>\n> On Tue, Dec 14, 2021 at 04:14:21PM +0000, Daniel Scally wrote:\n>> Hi Sakari\n>>\n>> On 14/12/2021 15:01, Sakari Ailus wrote:\n>>> Hi Daniel,\n>>>\n>>> On Mon, Dec 13, 2021 at 11:28:47PM +0000, Daniel Scally wrote:\n>>>> When iterating over the media graph, don't follow links that are not\n>>>> pad-to-pad links.\n>>>>\n>>>> Signed-off-by: Daniel Scally <djrscally@gmail.com>\n>>>> ---\n>>>> Changes since the rfc:\n>>>>\n>>>> \t- new patch\n>>>>\n>>>>  drivers/media/mc/mc-entity.c | 8 ++++++++\n>>>>  1 file changed, 8 insertions(+)\n>>>>\n>>>> diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c\n>>>> index d79eb88bc167..aeddc3f6310e 100644\n>>>> --- a/drivers/media/mc/mc-entity.c\n>>>> +++ b/drivers/media/mc/mc-entity.c\n>>>> @@ -325,6 +325,14 @@ static void media_graph_walk_iter(struct media_graph *graph)\n>>>>  \n>>>>  \tlink = list_entry(link_top(graph), typeof(*link), list);\n>>>>  \n>>>> +\t/* If the link is not a pad-to-pad link, don't follow it */\n>>> This comment should mention data links, not pad-to-pad links.\n>>\n>> I wondered about the terminology of this actually...since we create\n>> those links with media_create_pad_link(), and they're called pad-to-pad\n>> links in the documentation [1], but in other cases called data links. Do\n>> we need to fix those other references too?\n>>\n>>\n>>\n>> [1] https://www.kernel.org/doc/html/v5.0/media/kapi/mc-core.html#links\n> Good point.\n>\n> There were only one type of links before the interface links were\n> introduced. Some of the documentation seems to discuss pad links whereas\n> the corresponding macro name is MEDIA_LNK_FL_DATA_LINK. What the links\n> really represent is flow of data.\n>\n> It would be good to align this, although that should probably be done in a\n> different context from this patchset.\n>\nAck; I'll fix the comment as you suggested for now","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 9CB90BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 14 Dec 2021 21:37:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DA8E9608E7;\n\tTue, 14 Dec 2021 22:37:17 +0100 (CET)","from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com\n\t[IPv6:2a00:1450:4864:20::32a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A83A7605A7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Dec 2021 22:37:16 +0100 (CET)","by mail-wm1-x32a.google.com with SMTP id o29so15285213wms.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Dec 2021 13:37:16 -0800 (PST)","from [192.168.0.14]\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161])\n\tby smtp.gmail.com with ESMTPSA id\n\tw17sm38587wmc.14.2021.12.14.13.37.15\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tTue, 14 Dec 2021 13:37:15 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"R71Hn32Z\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-transfer-encoding:content-language; \n\tbh=EzrwyP7c7S34aGSSRG8kXAIbMzVIltUuUNeJlobVF+M=;\n\tb=R71Hn32ZiC8+LOTsQB46bAiGRVFqzMiwVPRSpePOk9oXzTPQZg+jWUHLy7YVhs3kXf\n\tC02lG0SaMQ48z7pKLcAaKH+oGidTlOcps/jMnTIXtUbAYkyxIw5vDC6j+Zs7RE67wqNs\n\tXnh/djqbWCG+UjAotJaQth1luxshZZhv+xwvN99P/m4spkoVp1QX8CwKxJ1DIAVbNL43\n\tMcVQhVkO95pp5+IShIGoemA4iUenuyoxFgzJcP7HXJwv08ABgTapalBmjBtr2zLf3u4K\n\tl1nFPdRI8l3A87quvcdtWWIJEuJbHW+kXIMdXoPsmDiRoift9m1BYBaJ+jPfK8MffERi\n\tEL9Q==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:subject:to:cc:references:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-transfer-encoding\n\t:content-language;\n\tbh=EzrwyP7c7S34aGSSRG8kXAIbMzVIltUuUNeJlobVF+M=;\n\tb=DizSGGUCjJiqWgK8F4+HDVtdO3Y6IRYHWod3nkj34hlExgmZfOMmHgPwgl0bMhIqQ9\n\tHOwY5gBxj33S+3FIRj6Kf6hwfj0LMQZ7o3VjLxtmPAad5uZzEDjf2cbNF1bcbOmC2scK\n\thlA76RO1NOqG5dPVp9hnn5ihC+du2MlVAtBIhqUWSAWF4wKKRhd6Fd3usgAey3MJxvc0\n\teVB2adDbflP7NEk/sBQHtVEuGtrLc2lH09TyRJ7ELBT5oZ11AE6mj+xpGvtHamugpBuj\n\tZoy6JWA9mgimWRPt8N17s++PyEOYSPVz2wNEL4WQavh+ZxFYHB6sQY+RlAOBVv5kT8f/\n\txpJA==","X-Gm-Message-State":"AOAM532gS1p7RzX0riGh25lg1TQdLftFnAqEp+B8DCv4XLnIIXpuJNjz\n\t07eAUybEbSWTvOE/Pn8vnco=","X-Google-Smtp-Source":"ABdhPJzxmJVyRpOCKM/4hNLh2XV2KHNLkk/utBSjEE53KEGK4SH0OPXugMzR8UVhcumP11Rpz7dpvg==","X-Received":"by 2002:a05:600c:3c85:: with SMTP id\n\tbg5mr1792776wmb.58.1639517836347; \n\tTue, 14 Dec 2021 13:37:16 -0800 (PST)","To":"Sakari Ailus <sakari.ailus@linux.intel.com>","References":"<20211213232849.40071-1-djrscally@gmail.com>\n\t<20211213232849.40071-4-djrscally@gmail.com>\n\t<Ybixw0dIZyC6wQL4@paasikivi.fi.intel.com>\n\t<955c5e8e-d898-9987-4f21-f7dacb6b178e@gmail.com>\n\t<YbkLBobSglC1sgsF@paasikivi.fi.intel.com>","From":"Daniel Scally <djrscally@gmail.com>","Message-ID":"<e6d79347-0fc7-9e94-f968-e630ac87d451@gmail.com>","Date":"Tue, 14 Dec 2021 21:37:14 +0000","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.14.0","MIME-Version":"1.0","In-Reply-To":"<YbkLBobSglC1sgsF@paasikivi.fi.intel.com>","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"7bit","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [PATCH 3/5] media: entity: Skip non-data\n\tlinks in graph iteration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org, linux-media@vger.kernel.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21788,"web_url":"https://patchwork.libcamera.org/comment/21788/","msgid":"<YbkVIMLq+9xFT/la@pendragon.ideasonboard.com>","date":"2021-12-14T22:05:20","subject":"Re: [libcamera-devel] [PATCH 3/5] media: entity: Skip non-data\n\tlinks in graph iteration","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Tue, Dec 14, 2021 at 05:01:23PM +0200, Sakari Ailus wrote:\n> On Mon, Dec 13, 2021 at 11:28:47PM +0000, Daniel Scally wrote:\n> > When iterating over the media graph, don't follow links that are not\n> > pad-to-pad links.\n> > \n> > Signed-off-by: Daniel Scally <djrscally@gmail.com>\n> > ---\n> > Changes since the rfc:\n> > \n> > \t- new patch\n> > \n> >  drivers/media/mc/mc-entity.c | 8 ++++++++\n> >  1 file changed, 8 insertions(+)\n> > \n> > diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c\n> > index d79eb88bc167..aeddc3f6310e 100644\n> > --- a/drivers/media/mc/mc-entity.c\n> > +++ b/drivers/media/mc/mc-entity.c\n> > @@ -325,6 +325,14 @@ static void media_graph_walk_iter(struct media_graph *graph)\n> >  \n> >  \tlink = list_entry(link_top(graph), typeof(*link), list);\n> >  \n> > +\t/* If the link is not a pad-to-pad link, don't follow it */\n> \n> This comment should mention data links, not pad-to-pad links.\n> \n> Seems fine apart from this.\n> \n> > +\tif ((link->flags & MEDIA_LNK_FL_LINK_TYPE) != MEDIA_LNK_FL_DATA_LINK) {\n> > +\t\tlink_top(graph) = link_top(graph)->next;\n> > +\t\tdev_dbg(entity->graph_obj.mdev->dev, \"walk: skipping %s link\\n\",\n> > +\t\t\tlink_type(link));\n\nI would drop the debug message. The other messages in this function can\nbe useful to figure out why graph walk doesn't behave like expected\n(reporting, for instance, that a disabled link is not traversed), but I\ndon't think there's much value in indicating we're skipping non-data\nlinks.\n\nWith these issues addressed,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> > +\t\treturn;\n> > +\t}\n> > +\n> >  \t/* The link is not enabled so we do not follow. */\n> >  \tif (!(link->flags & MEDIA_LNK_FL_ENABLED)) {\n> >  \t\tlink_top(graph) = link_top(graph)->next;","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 82FF5BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 14 Dec 2021 22:05:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 88869608E6;\n\tTue, 14 Dec 2021 23:05:23 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 84E5560117\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Dec 2021 23:05:22 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D7C1F8C4;\n\tTue, 14 Dec 2021 23:05:21 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"WNd83bb5\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1639519522;\n\tbh=huTBinLTuS+od4bsWj55GHvrZU08eIXohhfzClTn9Bo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=WNd83bb5gxsh6w6/7dvAM2ODfOwsuQLMA33N9oLy63lXVNyeZbxrKyTQoSRxCVecf\n\tWMBI3g768TcYv5zz/J39O3lQh+Sh0uCLuwuPbvuArJ45KwGNWj70HI+KDjeTs55PT6\n\t2clxdfqmG+nQS8Rg2+6m6XymrG33gos/cPr5oToc=","Date":"Wed, 15 Dec 2021 00:05:20 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Sakari Ailus <sakari.ailus@linux.intel.com>","Message-ID":"<YbkVIMLq+9xFT/la@pendragon.ideasonboard.com>","References":"<20211213232849.40071-1-djrscally@gmail.com>\n\t<20211213232849.40071-4-djrscally@gmail.com>\n\t<Ybixw0dIZyC6wQL4@paasikivi.fi.intel.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<Ybixw0dIZyC6wQL4@paasikivi.fi.intel.com>","Subject":"Re: [libcamera-devel] [PATCH 3/5] media: entity: Skip non-data\n\tlinks in graph iteration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org, linux-media@vger.kernel.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]