lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sat, 29 Feb 2020 00:27:10 +0200
From:   Sakari Ailus <sakari.ailus@...ux.intel.com>
To:     Steve Longerbeam <slongerbeam@...il.com>
Cc:     linux-media@...r.kernel.org,
        Philipp Zabel <p.zabel@...gutronix.de>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Shawn Guo <shawnguo@...nel.org>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        Pengutronix Kernel Team <kernel@...gutronix.de>,
        Fabio Estevam <festevam@...il.com>,
        NXP Linux Team <linux-imx@....com>,
        Rui Miguel Silva <rmfrfs@...il.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Hans Verkuil <hverkuil-cisco@...all.nl>,
        open list <linux-kernel@...r.kernel.org>,
        "open list:STAGING SUBSYSTEM" <devel@...verdev.osuosl.org>,
        "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" 
        <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [RESEND PATCH v3 02/17] media: v4l2-fwnode: Pass notifier to
 v4l2_async_register_fwnode_subdev()

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 with a
> > > call to v4l2_async_notifier_init().
> > > 
> > > Signed-off-by: Steve Longerbeam <slongerbeam@...il.com>
> > Instead of improving v4l2_async_register_fwnode_subdev(), could you convert
> > 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 converting
> > 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,
>         int ret;
> 
>         remote = fwnode_graph_get_remote_port_parent(endpoint);
> -       if (!remote)
> +       if (!remote || !fwnode_device_is_available(remote))
>                 return -ENOTCONN;
> 
>         asd->match_type = 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@...ux.intel.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ