Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3605262pxu; Tue, 8 Dec 2020 17:06:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxlS1f+EO5twFAJnZeph3UoMbKoYf/oW3x7qje9aYMaTvwarGNUVdAaVC0BcVET7yjqRk/6 X-Received: by 2002:a17:906:c04d:: with SMTP id bm13mr21196ejb.519.1607475991927; Tue, 08 Dec 2020 17:06:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607475991; cv=none; d=google.com; s=arc-20160816; b=K4VcSVqhSS50L1pBARWLXdmwct/ayI4wrhMIygqcqwPxKfq97EBjQE78stCarYNVlA wafpjSWuqXCkFin8/x26VxuhPF/n0vcuKjBJsWH2vo3qT1/gFZG7VNzTJFFArgFedAf/ F+Xu5U3qksNaf9XltnbIO+8Pco5Yi8OUTy8Vhcm16N7W+LhZ2lXj0m1UWVJh24hD2APV E4OGwRF9+niKDr9Y2Qx//NQoiYT6B3TCxq/yHmfwZNJCWgGABzD3xGL9ZXm4SWNWeH1i Sx4mZbeY6LRlG9YFmK19VTrf2MRQurmkAzHlCGcO+THDj5J+QZw3RYbCxJhYhRuuxBGq TvNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=my6mHMeId5eBIa3M87zbP7eVWAhbwXMRklb0QbcngwE=; b=NjvDqKGD5LjkVxSU3C/hjamc8oHP/BiMZ8GkGGbxfQcfA0NbcNkwGPnDEE5Cd1t5E3 +guDi9uSodRLDQu4zBhJ8VheWK6FVDs/9UgFUjISPI8bHbq6/PEpeEP5v3tWjIXE9uDj JtacFMIp8nqz9KLPlctqulk+vInZu/HxLZ2Q/lFo6wcv4wOP4XrrvVzdMaaFQwLpgKRh cK7l9feyTCPhzXNZJjz6R4bgoPSCvkoTYKfjdx+LI3OnXh+bjg8qLiwD3I4LnzyVmD8W IPj/4p8NoIavywekm0UKNHJo6BDQ2j0G3t35iACLTocuroQOepLRd8dxAzp3gFMhMBht 4J+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l18si100661eje.178.2020.12.08.17.06.09; Tue, 08 Dec 2020 17:06:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731277AbgLHUQJ (ORCPT + 99 others); Tue, 8 Dec 2020 15:16:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731138AbgLHUPD (ORCPT ); Tue, 8 Dec 2020 15:15:03 -0500 Received: from hillosipuli.retiisi.eu (unknown [IPv6:2a01:4f9:c010:4572::e8:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9777CC0613CF; Tue, 8 Dec 2020 12:13:28 -0800 (PST) Received: from valkosipuli.localdomain (unknown [IPv6:fd35:1bc8:1a6:d3d5::80:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hillosipuli.retiisi.eu (Postfix) with ESMTPS id 1B531634C87; Tue, 8 Dec 2020 21:59:49 +0200 (EET) Received: from sailus by valkosipuli.localdomain with local (Exim 4.92) (envelope-from ) id 1kmj9J-0000XJ-8G; Tue, 08 Dec 2020 21:59:49 +0200 Date: Tue, 8 Dec 2020 21:59:49 +0200 From: Sakari Ailus To: Hans Verkuil Cc: Sowjanya Komatineni , thierry.reding@gmail.com, jonathanh@nvidia.com, robh+dt@kernel.org, bparrot@ti.com, mchehab@kernel.org, linux-media@vger.kernel.org, linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Laurent Pinchart Subject: Re: [PATCH v3 10/13] media: v4l2-fwnode: Update V4L2_FWNODE_CSI2_MAX_DATA_LANES to 8 Message-ID: <20201208195949.GB1167@valkosipuli.retiisi.org.uk> References: <1607022002-26575-1-git-send-email-skomatineni@nvidia.com> <1607022002-26575-11-git-send-email-skomatineni@nvidia.com> <845dfd4a-fa11-625c-78a3-cc8adc68bfc7@xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <845dfd4a-fa11-625c-78a3-cc8adc68bfc7@xs4all.nl> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Hans, On Mon, Dec 07, 2020 at 11:47:38AM +0100, Hans Verkuil wrote: > On 03/12/2020 19:59, Sowjanya Komatineni wrote: > > Some CSI2 receivers support 8 data lanes. > > > > So, this patch updates CSI2 maximum data lanes to be 8. > > > > Signed-off-by: Sowjanya Komatineni > > --- > > drivers/media/platform/ti-vpe/cal-camerarx.c | 2 +- > > include/media/v4l2-fwnode.h | 2 +- > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/media/platform/ti-vpe/cal-camerarx.c b/drivers/media/platform/ti-vpe/cal-camerarx.c > > index 806cbf1..47e2143 100644 > > --- a/drivers/media/platform/ti-vpe/cal-camerarx.c > > +++ b/drivers/media/platform/ti-vpe/cal-camerarx.c > > @@ -534,7 +534,7 @@ static int cal_camerarx_parse_dt(struct cal_camerarx *phy) > > { > > struct v4l2_fwnode_endpoint *endpoint = &phy->endpoint; > > struct device_node *ep_node; > > - char data_lanes[V4L2_FWNODE_CSI2_MAX_DATA_LANES * 2]; > > + char data_lanes[V4L2_FWNODE_CSI2_MAX_DATA_LANES]; > > unsigned int i; > > int ret; > > > > I'm not so sure about this change: it relies on the implicit knowledge that > this cal driver can handle only 4 lanes max, so that doubling > V4L2_FWNODE_CSI2_MAX_DATA_LANES is the same as the old 'V4L2_FWNODE_CSI2_MAX_DATA_LANES * 2'. > > I think we should either keep the existing code (which means data_lanes > is now larger than needed, so stack usage increases by 8 bytes), or perhaps > create a new define for this driver like CAL_MAX_DATA_LANES and use that. > > In my opinion the original code should just be kept, but I've CC-ed Laurent > on this to hear what he thinks. I further looked at the code there and it does *depend* on a particular value of V4L2_FWNODE_CSI2_MAX_DATA_LANES. That needs to be fixed. This part can (or should) be dropped from the patch though. -- Regards, Sakari Ailus