Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp76092imj; Fri, 8 Feb 2019 15:18:18 -0800 (PST) X-Google-Smtp-Source: AHgI3IYf/YTFJKaE+RlkS4PwL1avPFJmJ9mgKglnV///ZHiVxB1RzA3lI8dkDHNXATtDZS2Wz7ur X-Received: by 2002:a62:9683:: with SMTP id s3mr24730061pfk.60.1549667898003; Fri, 08 Feb 2019 15:18:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549667897; cv=none; d=google.com; s=arc-20160816; b=I7gFe4sS2TItSGdlxe0uznLI10pBQ8FO0xi2bNxY8YgBm/vflMCfb6Pl/kKSopMRVC OW4syBpFooyi7q9x5GgfhT7Lq1QvioByC4fB9D7gq/AOP8RKF7XOafeKBxiMb7GcpmBB XkUq7s/Yemx3fuK7uvFEYB6aonhzDGqlWQp/9bEL5fY2r9jT1bJZRDgiIOlDiTjU6VNc ydpLSScpRFTRreziEm7oAipAvAiW0OzXLKvinzGxLVYYbtCt61WlraBHsTZaysuYkFYS GpmphWQ4n2FoXI6dDazjoQUzPek6ubysmLEbPEHpOHdkYycQo50bgl2Z4xhwCqFqeEou 9gow== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=7aL4SIQfjeZiTO7vTaZ95qgovSNXid+b98xjLJiOht8=; b=bvjNpWUrmA4X1CjgGzI7y74o7mcaCenRvcvVFk0bhZLkyhdAARZOsnCJw6qSKKHvuD Z/4/SSMg4BfigJdHyk0jlWrAkomaDsUDcBNxZ/4psflf9W0+ZX5gaq4s3RnuLUjsWYLU lqPX6bznZsRyuFftmYdUimeCQCJAEArXo2Kjl8Xu6d/9K+FMAb7gbrDiGDGRSYOhtoxd wfxyJjD74L/aOlGMFAuvdy9vujegV3srq4kK2zw5SNlygO4LW/V+IhutSZx2YeGm7fUr 7QHF7zbzvuDmPlDxFCkA311DUcV01BavkUaEfdvZUqu3I86XR5tq3UIB8lssdiFnvx1t geQA== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k186si3648883pgc.576.2019.02.08.15.18.00; Fri, 08 Feb 2019 15:18:17 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726943AbfBHXR4 (ORCPT + 99 others); Fri, 8 Feb 2019 18:17:56 -0500 Received: from mga04.intel.com ([192.55.52.120]:55824 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726353AbfBHXRz (ORCPT ); Fri, 8 Feb 2019 18:17:55 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Feb 2019 15:17:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,348,1544515200"; d="scan'208";a="318829222" Received: from sshumihi-mobl.ccr.corp.intel.com (HELO mara.localdomain) ([10.252.20.76]) by fmsmga005.fm.intel.com with ESMTP; 08 Feb 2019 15:17:51 -0800 Received: from sailus by mara.localdomain with local (Exim 4.89) (envelope-from ) id 1gsFP2-0005a0-DG; Sat, 09 Feb 2019 01:17:49 +0200 Date: Sat, 9 Feb 2019 01:17:47 +0200 From: Sakari Ailus To: Maxime Ripard Cc: Hans Verkuil , Mauro Carvalho Chehab , Thomas Petazzoni , Laurent Pinchart , linux-media@vger.kernel.org, Andrzej Hajda , Chen-Yu Tsai , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Mark Rutland , Rob Herring , Frank Rowand Subject: Re: [PATCH v2 3/5] media: sunxi: Add A10 CSI driver Message-ID: <20190208231746.sjgb7im6xqsawhwz@mara.localdomain> References: <20190129123949.qdmqnfaym3y42dvj@paasikivi.fi.intel.com> <20190206211605.27cq2lxuv3gtyyux@flea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190206211605.27cq2lxuv3gtyyux@flea> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Maxime, On Wed, Feb 06, 2019 at 10:16:05PM +0100, Maxime Ripard wrote: > Hi Sakari, > > Thanks for your review, I have a few questions though, and the rest > will be addressed in the next version. > > On Tue, Jan 29, 2019 at 02:39:49PM +0200, Sakari Ailus wrote: > > > +static int csi_notify_complete(struct v4l2_async_notifier *notifier) > > > +{ > > > + struct sun4i_csi *csi = container_of(notifier, struct sun4i_csi, > > > + notifier); > > > + int ret; > > > + > > > + ret = v4l2_device_register_subdev_nodes(&csi->v4l); > > > + if (ret < 0) > > > + return ret; > > > + > > > + ret = sun4i_csi_v4l2_register(csi); > > > + if (ret < 0) > > > + return ret; > > > + > > > + return media_create_pad_link(&csi->src_subdev->entity, csi->src_pad, > > > + &csi->vdev.entity, 0, > > > + MEDIA_LNK_FL_ENABLED | > > > + MEDIA_LNK_FL_IMMUTABLE); > > > > This appears to create a link directly from the sensor entity to the video > > device entity. Is that intentional? I'd expect to see a CSI-2 receiver > > sub-device as well, which I don't see being created by the driver. > > > > This is indeed a novel proposal. I have some concerns though. > > > > The user doesn't have access to the configured media bus format (reflecting > > the format on the CSI-2 bus on receiver's side). It's thus difficult to > > figure out whether the V4L2 pixel format configured on the video node > > matches what the sensor outputs. Admittedly, we don't have a perfect > > solution to that whenever the DMA hardware supports multiple V4L2 pixel > > formats on a single media bus format. We might need to have a different > > solution for this one, should it be without that receiver sub-device. > > > > Could you add the CSI-2 receiver sub-device, please? > > Even though the name of the controller is *very* confusing, this isn't > a MIPI-CSI receiver, but a parallel one that supports RGB and BT656 > buses. Right. > > > > + csi->pad.flags = MEDIA_PAD_FL_SINK | MEDIA_PAD_FL_MUST_CONNECT; > > > > Could you make it IMMUTABLE and ENABLED? If there is no need to disable it, > > that is. > > The link is already created with those flags, and as far as I know it > doesn't exist for the pads Oops. And it wasn't even late when I reviewed the patch. :-P Please ignore the comment --- I agree on the pad flags and the link flags (some lines up) appear fine, too. > > > > +static int csi_release(struct file *file) > > > +{ > > > + struct sun4i_csi *csi = video_drvdata(file); > > > + int ret; > > > + > > > + mutex_lock(&csi->lock); > > > + > > > + ret = v4l2_fh_release(file); > > > > v4l2_fh_release() always returns 0. I guess it could be changed to return > > void. The reason it has int is that it could be used as the release > > callback as such. > > > > > + v4l2_pipeline_pm_use(&csi->vdev.entity, 0); > > > + pm_runtime_put(csi->dev); > > > + > > > + mutex_unlock(&csi->lock); > > > + > > > + return ret; > > > +} > > Do you want me to change the construct then? Please. -- Kind regards, Sakari Ailus sakari.ailus@linux.intel.com