public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-media@vger.kernel.org,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	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: Thu, 13 Jun 2013 23:37:30 +0200	[thread overview]
Message-ID: <51BA3B9A.5090206@gmail.com> (raw)
In-Reply-To: <1370939028-8352-17-git-send-email-g.liakhovetski@gmx.de>

Hi Guennadi,

Overall it looks quite neat at this v10. :)

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.

> +/**
> + * 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 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 ?

> + * @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.

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.

Thanks for the idea and patience during reviews! :)


Regards,
Sylwester

  parent reply	other threads:[~2013-06-13 21:37 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 [this message]
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
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=51BA3B9A.5090206@gmail.com \
    --to=sylvester.nawrocki@gmail.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --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 \
    /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