From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF83EC3F2CD for ; Fri, 28 Feb 2020 22:29:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 97B5C222C4 for ; Fri, 28 Feb 2020 22:29:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ah04VYDA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 97B5C222C4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=K7ktxkgpM4iPPtktXZ6bXEv8q3T5ScfGS0P68M0Mw8A=; b=ah04VYDAVep1Ey ZmfBiyn5xMDI0OEHqNz/dApWaHqStwa/i5K+0o2yduq2MaqmyrM80YWXC/6yOO4HjBebHHntaLLmJ ujzHhAwTIsKqbKf3+NEerF1InXvyuYRnvy65oP1CAv1kLsE+iZTPqgBsW9kHQcJ8759WNheCicBqD fYhilmcLCT6lX8dH+8Rdm2xtp8HAgJwVDIiRCLqTxT7bvu9ggGiTrbEsh4++kTompmz9uN6y/nPjY /fdCjlC1fTuS1mfHpxe1WeukboTu3zZB0KE+BWzSeKVAOceOr6FI8B2LJ2a6IJw/DVoCSohac8NuS jdHn95o7xwB2w8+yAuag==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j7o8N-0007Lj-Ot; Fri, 28 Feb 2020 22:29:27 +0000 Received: from mga01.intel.com ([192.55.52.88]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j7o8K-0007HN-DH for linux-arm-kernel@lists.infradead.org; Fri, 28 Feb 2020 22:29:25 +0000 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Feb 2020 14:27:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,497,1574150400"; d="scan'208";a="227683345" Received: from jkalwas-mobl.ger.corp.intel.com (HELO mara.localdomain) ([10.249.154.47]) by orsmga007.jf.intel.com with ESMTP; 28 Feb 2020 14:27:16 -0800 Received: from sailus by mara.localdomain with local (Exim 4.92) (envelope-from ) id 1j7o6B-0000Ha-Ij; Sat, 29 Feb 2020 00:27:13 +0200 Date: Sat, 29 Feb 2020 00:27:10 +0200 From: Sakari Ailus To: Steve Longerbeam Subject: Re: [RESEND PATCH v3 02/17] media: v4l2-fwnode: Pass notifier to v4l2_async_register_fwnode_subdev() Message-ID: <20200228222710.GA1068@mara.localdomain> References: <20200215194136.10131-1-slongerbeam@gmail.com> <20200215194136.10131-3-slongerbeam@gmail.com> <20200225150721.GO5379@paasikivi.fi.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200228_142924_462127_C2C477D5 X-CRM114-Status: GOOD ( 23.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:STAGING SUBSYSTEM" , Fabio Estevam , Pengutronix Kernel Team , Greg Kroah-Hartman , Sascha Hauer , open list , Rui Miguel Silva , NXP Linux Team , Philipp Zabel , Hans Verkuil , Thomas Gleixner , Mauro Carvalho Chehab , Shawn Guo , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , linux-media@vger.kernel.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Steve, Btw. I think probably a smaller list of recipients would be just fine on the next version. On Fri, Feb 28, 2020 at 10:16:06AM -0800, Steve Longerbeam wrote: > Hi Sakari, > = > On 2/25/20 7:07 AM, Sakari Ailus wrote: > > Hi Steve, > > = > > On Sat, Feb 15, 2020 at 11:41:21AM -0800, Steve Longerbeam wrote: > > > Instead of allocating a notifier in v4l2_async_register_fwnode_subdev= (), > > > have the caller provide one. This allows the caller to implement > > > notifier ops (bind, unbind). > > > = > > > The caller is now responsible for first initializing its notifier wit= h a > > > call to v4l2_async_notifier_init(). > > > = > > > Signed-off-by: Steve Longerbeam > > Instead of improving v4l2_async_register_fwnode_subdev(), could you con= vert > > the users (IMX driver in this case) to call the preferred APIs instead?= As > > the lines below show, v4l2_async_register_fwnode_subdev() has only two > > users left --- the other one of which is the IMX driver. After converti= ng > > these two, we could just remove this API. > > = > > See e.g. drivers/media/pci/intel/ipu3/ipu3-cio2.c and > > drivers/media/platform/omap3isp/isp.c for examples. > = > Shouldn't v4l2_async_notifier_add_fwnode_remote_subdev() check for the > availability of the remote before adding it to the notifier's asd list, as > in: > = > diff --git a/drivers/media/v4l2-core/v4l2-async.c > b/drivers/media/v4l2-core/v4l2-async.c > index 8bde33c21ce4..b48ed68c6c6c 100644 > --- a/drivers/media/v4l2-core/v4l2-async.c > +++ b/drivers/media/v4l2-core/v4l2-async.c > @@ -615,7 +615,7 @@ v4l2_async_notifier_add_fwnode_remote_subdev(struct > v4l2_async_notifier *notif, > =A0=A0=A0=A0=A0=A0=A0 int ret; > = > =A0=A0=A0=A0=A0=A0=A0 remote =3D fwnode_graph_get_remote_port_parent(endp= oint); > -=A0=A0=A0=A0=A0=A0 if (!remote) > +=A0=A0=A0=A0=A0=A0 if (!remote || !fwnode_device_is_available(remote)) > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return -ENOTCONN; > = > =A0=A0=A0=A0=A0=A0=A0 asd->match_type =3D V4L2_ASYNC_MATCH_FWNODE; > = > = > Otherwise we are back to the problem that the notifier will never complete > because the remote's driver is not probed. fwnode_graph_get_endpoint_by_id() only gives you endpoints that belong to an enabled device (unless requested otherwise). So the there's need to check the same in v4l2-fwnode.c. -- = Regards, Sakari Ailus sakari.ailus@linux.intel.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel