Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4977777ybe; Mon, 9 Sep 2019 18:30:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1/7dl9JxX22vdETIF4SLPe5TicH9l+eQmc4htJimBCB0EwP38laGiZvA1j7+b/kzS35gK X-Received: by 2002:aa7:d5cf:: with SMTP id d15mr27816915eds.67.1568079006398; Mon, 09 Sep 2019 18:30:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568079006; cv=none; d=google.com; s=arc-20160816; b=M8uQWn00m6RgSH7TVVXFK/QB2OhKUsSEYYruX1sd8+6inTaVnb7Z3Drdb/t0VVBBKs P65snK5ZbwLvAeQjlOhLDXClCTzeVjQNog4D87wGP/6L4moZMd7CyKK0D0GjSwZDYJVj EnFVHzeR0ntLRY7nrqc5tRVBhqeFFUvsS+ff7et7qiCP84TAtCPiiZuKykjkb0LTNKja liAnsKaA7li0CLmfDKU/SCVDRn5cY6c6mx/lbz3BzGt0DXiIgcx+wGABKLhTtUmXxG2m xt3oNY0UuNSxDb3ckoCKLatWEkkbBBIxMvM40NitAliziLIA47CKgvLDrAez65nB1fPT bD4A== 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=QKUXtfVhBF4ppZVTJrhWxMx4Jmx1l6l9JZbWP1cZcVM=; b=OGY+CfWuFSK2OCvPGr4oDYIdIrZAm6P2KyiHmJgfKkbppHx2VpqENiDIQknaa/EPXh S/KGGYuXjeDRXAq/cWuUJKuuo6qQuReqGwEjTH80+/U64qATLWjuqWTKN4d2lI779Qqi kQcSLGZgzcEOlYVOVifChBJnXF6/zpHWWInVv20CITHeV8eNAbGG5sJyQitypUCkUVYF 5YULmn3PBW2WPquH9iCCH4NUp9j/B70Y4iDLMMJxLMisRGiQM7M3xFvuFVVCfSer4PVP PxuNaP5UJiNcabLm1sSNwvt8gwUUwQiKkWgnEfHE8bPBmKbGsoGbywVyG6w/NztRbe2/ JZww== 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 k23si8385455ejr.329.2019.09.09.18.29.32; Mon, 09 Sep 2019 18:30:06 -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 S2388418AbfIIHv6 (ORCPT + 99 others); Mon, 9 Sep 2019 03:51:58 -0400 Received: from retiisi.org.uk ([95.216.213.190]:40478 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727684AbfIIHv5 (ORCPT ); Mon, 9 Sep 2019 03:51:57 -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 79047634C87; Mon, 9 Sep 2019 10:51:52 +0300 (EEST) Received: from sailus by valkosipuli.localdomain with local (Exim 4.92) (envelope-from ) id 1i7ESn-0000Hc-8A; Mon, 09 Sep 2019 10:51:53 +0300 Date: Mon, 9 Sep 2019 10:51:53 +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: <20190909075153.GA843@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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1D1666FD-CFC6-4DE1-8A2E-1809D1BDEAAB@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 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. -- Sakari Ailus