From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>,
linux-media@vger.kernel.org,
Sylwester Nawrocki <s.nawrocki@samsung.com>,
Hans Verkuil <hverkuil@xs4all.nl>,
linux-sh@vger.kernel.org, Magnus Damm <magnus.damm@gmail.com>,
Sakari Ailus <sakari.ailus@iki.fi>,
Prabhakar Lad <prabhakar.lad@ti.com>,
Sascha Hauer <s.hauer@pengutronix.de>
Subject: Re: [PATCH v10 16/21] V4L2: support asynchronous subdevice registration
Date: Fri, 14 Jun 2013 15:03:10 +0200 [thread overview]
Message-ID: <1686962.DYieKKCbIi@avalon> (raw)
In-Reply-To: <Pine.LNX.4.64.1306140902170.6920@axis700.grange>
Hi Guennadi,
On Friday 14 June 2013 09:14:48 Guennadi Liakhovetski wrote:
> On Thu, 13 Jun 2013, Sylwester Nawrocki wrote:
> > Hi Guennadi,
> >
> > Overall it looks quite neat at this v10. :)
>
> Thanks :)
>
> > On 06/11/2013 10:23 AM, Guennadi Liakhovetski wrote:
> > > Currently bridge device drivers register devices for all subdevices
> > > synchronously, tupically, during their probing. E.g. if an I2C CMOS
> > > sensor
> >
> > s/tupically/typically
> >
> > > is attached to a video bridge device, the bridge driver will create an
> > > I2C
> > >
> > > +/**
> > > + * v4l2_async_subdev_list - provided by subdevices
> > > + * @list: links struct v4l2_async_subdev_list objects to a global list
> > > + * before probing, and onto notifier->done after probing
> > > + * @asd: pointer to respective struct v4l2_async_subdev
> > > + * @notifier: pointer to managing notifier
> > > + */
> > > +struct v4l2_async_subdev_list {
> > > + struct list_head list;
> > > + struct v4l2_async_subdev *asd;
> > > + struct v4l2_async_notifier *notifier;
> > > +};
> >
> > I have a patch for this patch, which embeds members of this struct
> > directly into struct v4l2_subdev. My felling is that the code is simpler
> > and easier to follow this way, I might be missing some important details
> > though.
>
> Thanks, saw it. In principle I have nothing against it. I think, it's just
> principle approach to this work, which seems to differ slightly from how
> others see it. I tried to as little intrusive as possible, touching
> current APIs only if absolutely necessary, keeping the async stuff largely
> separated from the rest. If however the common feeling is, that we should
> inject it directly in V4L2 core, I have nothing against it either. Still,
> I would prefer to keep the .c and .h files separate for now at least to
> reduce merge conflicts etc.
>
> > > +/**
> > > + * v4l2_async_notifier - v4l2_device notifier data
> > > + * @subdev_num: number of subdevices
> > > + * @subdev: array of pointers to subdevices
> >
> > How about changing this to:
> > @subdevs: array of pointers to the subdevice descriptors
>
> I'm sure every single line of comments and code in these (and all other)
> patches can be improved :)
>
> > I think it would be more immediately clear this is the actual subdevs
> > array pointer, and perhaps we could have subdev_num renamed to num_subdevs
> > ?
>
> Sure, why not :)
>
> > > + * @v4l2_dev: pointer to struct v4l2_device
> > > + * @waiting: list of struct v4l2_async_subdev, waiting for their
> > > drivers
> > > + * @done: list of struct v4l2_async_subdev_list, already probed
> > > + * @list: member in a global list of notifiers
> > > + * @bound: a subdevice driver has successfully probed one of subdevices
> > > + * @complete: all subdevices have been probed successfully
> > > + * @unbind: a subdevice is leaving
> > > + */
> > > +struct v4l2_async_notifier {
> > > + unsigned int subdev_num;
> > > + struct v4l2_async_subdev **subdev;
> > > + struct v4l2_device *v4l2_dev;
> > > + struct list_head waiting;
> > > + struct list_head done;
> > > + struct list_head list;
> > > + int (*bound)(struct v4l2_async_notifier *notifier,
> > > + struct v4l2_subdev *subdev,
> > > + struct v4l2_async_subdev *asd);
> > > + int (*complete)(struct v4l2_async_notifier *notifier);
> > > + void (*unbind)(struct v4l2_async_notifier *notifier,
> > > + struct v4l2_subdev *subdev,
> > > + struct v4l2_async_subdev *asd);
> > > +};
> > > +
> > > +int v4l2_async_notifier_register(struct v4l2_device *v4l2_dev,
> > > + struct v4l2_async_notifier *notifier);
> > > +void v4l2_async_notifier_unregister(struct v4l2_async_notifier
> > > *notifier);
> > > +int v4l2_async_register_subdev(struct v4l2_subdev *sd);
> > > +void v4l2_async_unregister_subdev(struct v4l2_subdev *sd);
> >
> > I still think "async_" in this public API is unnecessary, since we
> > register/ unregister a subdev with the core and notifiers are
> > intrinsically asynchronous.
> > But your preference seems be otherwise, what could I do... :) At most it
> > just means one less happy user of this interface.
>
> See above :) And another point - this is your opinion, which I certainly
> respect and take into account. I think, Laurent somehow softly inclined in
> the same direction. But I didn't hear any other opinions, so, in the end I
> have to make a decision - is everyone more likely to like what has been
> proposed by this specific reviewer, or would everyone object :) There are
> obvious things - fixes etc., and there are less obvious ones - naming,
> formulating and such. So, here again - I just would prefer all methods,
> comprising this API to share the same namespace. To make it clearer, that
> if you register subdevices asynchronously, you also need notifiers on the
> host and the other way round. To make it easier to authors to match these
> methods. Just my 2p :)
>
> > So except this bikeshedding I don't really have other comments, I'm going
> > to test this series with the s3c-camif/ov9650 drivers and will report
> > back soon.
> >
> > It would have been a shame to not have this series in 3.11. I guess three
> > kernel cycles, since the initial implementation, time frame is sufficient
> > for having finally working camera devices on a device tree enabled system
> > in mainline.
>
> Great! So, let's get 1 or 2 opinions more, then I can make a v11 with just
> a couple of cosmetic changes and kindly ask Mauro to pull this in :)
I have no further comment than those already posted by Hans and Sylwester on
v10. I'll ack v11 (possibly with comments on the documentation though ;-)).
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2013-06-14 13:02 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-11 8:23 [PATCH v10 00/21] V4L2 clock and asynchronous probing Guennadi Liakhovetski
2013-06-11 8:23 ` [PATCH v10 01/21] soc-camera: move common code to soc_camera.c Guennadi Liakhovetski
2013-06-11 8:23 ` [PATCH v10 02/21] soc-camera: add host clock callbacks to start and stop the master clock Guennadi Liakhovetski
2013-06-11 8:23 ` [PATCH v10 03/21] pxa-camera: move interface activation and deactivation to clock callbacks Guennadi Liakhovetski
2013-06-11 8:23 ` [PATCH v10 04/21] omap1-camera: " Guennadi Liakhovetski
2013-06-11 8:23 ` [PATCH v10 05/21] atmel-isi: " Guennadi Liakhovetski
2013-06-11 8:23 ` [PATCH v10 06/21] mx3-camera: " Guennadi Liakhovetski
2013-06-11 8:23 ` [PATCH v10 07/21] mx2-camera: " Guennadi Liakhovetski
2013-06-11 8:23 ` [PATCH v10 08/21] mx1-camera: " Guennadi Liakhovetski
2013-06-11 8:23 ` [PATCH v10 09/21] sh-mobile-ceu-camera: " Guennadi Liakhovetski
2013-06-11 8:23 ` [PATCH v10 10/21] soc-camera: make .clock_{start,stop} compulsory, .add / .remove optional Guennadi Liakhovetski
2013-06-11 8:23 ` [PATCH v10 11/21] soc-camera: don't attach the client to the host during probing Guennadi Liakhovetski
2013-06-11 8:23 ` [PATCH v10 12/21] sh-mobile-ceu-camera: add primitive OF support Guennadi Liakhovetski
2013-06-11 8:23 ` [PATCH v10 13/21] sh-mobile-ceu-driver: support max width and height in DT Guennadi Liakhovetski
2013-06-11 8:23 ` [PATCH v10 14/21] V4L2: add temporary clock helpers Guennadi Liakhovetski
2013-06-11 8:23 ` [PATCH v10 15/21] V4L2: add a device pointer to struct v4l2_subdev Guennadi Liakhovetski
2013-06-12 17:16 ` Prabhakar Lad
2013-06-13 10:32 ` Hans Verkuil
2013-06-11 8:23 ` [PATCH v10 16/21] V4L2: support asynchronous subdevice registration Guennadi Liakhovetski
2013-06-12 17:18 ` Prabhakar Lad
2013-06-13 21:37 ` Sylwester Nawrocki
2013-06-14 7:14 ` Guennadi Liakhovetski
2013-06-14 9:07 ` Hans Verkuil
2013-06-14 9:14 ` Guennadi Liakhovetski
2013-06-14 9:40 ` Sylwester Nawrocki
2013-06-14 9:44 ` Guennadi Liakhovetski
2013-06-14 12:58 ` Laurent Pinchart
2013-06-14 13:03 ` Laurent Pinchart [this message]
2013-06-13 21:39 ` [PATCH] V4L2: Merge struct v4l2_async_subdev_list with struct v4l2_subdev Sylwester Nawrocki
2013-06-11 8:23 ` [PATCH v10 17/21] soc-camera: switch I2C subdevice drivers to use v4l2-clk Guennadi Liakhovetski
2013-06-11 8:23 ` [PATCH v10 18/21] soc-camera: add V4L2-async support Guennadi Liakhovetski
2013-06-11 8:23 ` [PATCH v10 19/21] sh_mobile_ceu_camera: add asynchronous subdevice probing support Guennadi Liakhovetski
2013-06-11 8:23 ` [PATCH v10 20/21] imx074: support asynchronous probing Guennadi Liakhovetski
2013-06-11 8:23 ` [PATCH v10 21/21] ARM: shmobile: convert ap4evb to asynchronously register camera subdevices Guennadi Liakhovetski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1686962.DYieKKCbIi@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=g.liakhovetski@gmx.de \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=prabhakar.lad@ti.com \
--cc=s.hauer@pengutronix.de \
--cc=s.nawrocki@samsung.com \
--cc=sakari.ailus@iki.fi \
--cc=sylvester.nawrocki@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox