Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4374162ybe; Mon, 9 Sep 2019 08:23:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzS8KYQ3huM48b7ehToUPeXnmgIeYM8cJHFZHHeS54orAan6E6LXKV1EWGdkPWtS82Sw5XN X-Received: by 2002:a50:8ad1:: with SMTP id k17mr2254395edk.243.1568042628043; Mon, 09 Sep 2019 08:23:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568042628; cv=none; d=google.com; s=arc-20160816; b=LYb05io2hZkHLJP/W06ZDzL5BV2I6ol3dE/8jSZ4mnVzMVdW6QrEpOkC/SXwiQzIS1 B4MGN06y/HhgC9kFXEBJmBUMBRXGRXgz6hNawsJl6l4LlVbKsSyf+5CdeGnXZPAX2uoK zd2h7sqjUzGf9X30n3WchOHRAX7W2Br8wqMfmEpiWBl9zIcCEpc///MuPabBBimb2ow1 8tJZIXU6AO8Ki02ocfmV0aO1lXcXL06mNgv1r2mKwSN1te+waNYN0Fsr5BX3PEsdBIJD hHpoaJ2uvsv8BirX2KqU2dPcdJGedTBwy2KMhrBLLOrZvSrl+1XANx42W56bxUZ3wsxk pTuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=n8Rcx63WceAsTjJK3D9aA8V1ict+57avyyTWA5jmAh8=; b=d3zyyMthwJDor1ErKWk0NCufcIzg/Az5U7/Ohij0ULybRY8rZhNHvfIi3kZfp9aGZJ ftalYB756VhQredMIWqfMaf17v8FCCJjkMLNZPqTC/KscD4HE3fZYP+qx5EPrIiIacIG YrCPVAfECtWn2mrFPGtuooRMMAqiLDycYYEqFYXbTY7SzpZ0pOFRTSv6nam2sBR6SpC2 sI2QKlsG82YgczHv5+Ip5EEFvGbSV7LpG+aPHrvWnT+eoRwTOtu0kuTuiOLDpy7EjUsy /O8tmIzZRf6nVl4NHAJ6DvNS2ndj2xZ+3f40QXDLnunkHJt/7UT+CTolKwxYAxZqCuXC V19A== 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=iki.fi Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u23si1135545ejm.26.2019.09.09.08.23.22; Mon, 09 Sep 2019 08:23:48 -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; 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=iki.fi Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388411AbfIIJky (ORCPT + 99 others); Mon, 9 Sep 2019 05:40:54 -0400 Received: from retiisi.org.uk ([95.216.213.190]:41274 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725818AbfIIJkx (ORCPT ); Mon, 9 Sep 2019 05:40:53 -0400 Received: from valkosipuli.localdomain (valkosipuli.retiisi.org.uk [IPv6:2a01:4f9:c010:4572::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.org.uk (Postfix) with ESMTPS id 6984C634C88; Mon, 9 Sep 2019 12:40:48 +0300 (EEST) Received: from sailus by valkosipuli.localdomain with local (Exim 4.92) (envelope-from ) id 1i7GAD-0000IP-8Q; Mon, 09 Sep 2019 12:40:49 +0300 Date: Mon, 9 Sep 2019 12:40:49 +0300 From: Sakari Ailus To: Jan Kotas Cc: Maxime Ripard , "mchehab@kernel.org" , Rob Herring , Mark Rutland , Rafal Ciepiela , linux-media , linux-devicetree , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 2/3] media: Add lane checks for Cadence CSI2RX Message-ID: <20190909094049.GB843@valkosipuli.retiisi.org.uk> References: <20190905105601.27034-1-jank@cadence.com> <20190905105601.27034-3-jank@cadence.com> <20190906075413.GE1586@valkosipuli.retiisi.org.uk> <1D1666FD-CFC6-4DE1-8A2E-1809D1BDEAAB@global.cadence.com> <20190909075153.GA843@valkosipuli.retiisi.org.uk> <6F0DAE9B-BD7F-44D6-8D5B-92B3B3099CF2@global.cadence.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6F0DAE9B-BD7F-44D6-8D5B-92B3B3099CF2@global.cadence.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 09, 2019 at 08:12:54AM +0000, Jan Kotas wrote: > > > > On 9 Sep 2019, at 09:51, Sakari Ailus wrote: > > > > > > On Mon, Sep 09, 2019 at 07:41:21AM +0000, Jan Kotas wrote: > >> > >> > >> Hello Sakari, > >> > >> Thanks for your reply. > >>> On 6 Sep 2019, at 09:54, Sakari Ailus wrote: > >>> > >>> Hi Jan, > >>> > >>> Thanks for the patchset. > >>> > >>> On Thu, Sep 05, 2019 at 11:56:00AM +0100, Jan Kotas wrote: > >>>> /* > >>>> * Driver for Cadence MIPI-CSI2 RX Controller v1.3 > >>>> * > >>>> - * Copyright (C) 2017 Cadence Design Systems Inc. > >>>> + * Copyright (C) 2017-2019 Cadence Design Systems Inc. > >>>> */ > >>>> > >>>> + for (i = 0; i < csi2rx->num_lanes; i++) { > >>>> + if (csi2rx->lanes[i] < 1) { > >>> > >>> Do you need this? v4l2_fwnode_parse_endpoint() already has a more thorough > >>> check for the lane numbers. > >> > >> I looked at the source code of v4l2_fwnode_endpoint_parse_csi2_bus > >> and this particular case doesn’t seem to be checked. > > > > Not specifically, since 0 is a valid lane number. > > > > However, the driver only appears to be using the information on how many > > lanes there are. If the hardware doesn't support lane routing, then this is > > all you need. Otherwise additional checks should be added in case there are > > limitations how the lanes can be routed. > > The CSI2RX v1.3 does support that (CSI2RX_STATIC_CFG_REG) > and assumes the first data lane has number 1. Oh. I missed this. Thanks for pointing it out. If the first data lane must be 1, then your check is still different: it requires all the data lanes are greater than 1. Are there requireents for the clock lane position? Looking at the driver, it seems it does not care about the clock lane, and an educated guess gives 0 for the clock lane. The DT binding documentation actually omits documenting the data-lanes altogether. Please add it in a separate patch. I don't think "clock-lanes" is needed _if_ zero is all you need, so please remove it also from the examples. It's actually nice to have more users for this feature. :-) -- Kind regards, Sakari Ailus