Message ID | 20230727054255.1183255-1-sakari.ailus@linux.intel.com |
---|---|
Headers | show |
Series | Separate links and async sub-devices | expand |
Em Thu, 27 Jul 2023 08:42:43 +0300 Sakari Ailus <sakari.ailus@linux.intel.com> escreveu: > When an async sub-device is registered, it used to be that the first one > of its connections were matched when found. Continue looking for matches > until a notifier no longer has any. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > Tested-by: Philipp Zabel <p.zabel@pengutronix.de> # imx6qp > Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> # rcar + adv746x > Tested-by: Aishwarya Kothari <aishwarya.kothari@toradex.com> # Apalis i.MX6Q with TC358743 > Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # Renesas RZ/G2L SMARC > --- > drivers/media/v4l2-core/v4l2-async.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c > index 44f72aa75c19..6b3c02d27ebf 100644 > --- a/drivers/media/v4l2-core/v4l2-async.c > +++ b/drivers/media/v4l2-core/v4l2-async.c > @@ -789,6 +789,7 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd) > if (!v4l2_dev) > continue; > > +again: > asc = v4l2_async_find_match(notifier, sd); > if (!asc) > continue; > @@ -801,13 +802,12 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd) > if (ret) > goto err_unbind; > > - goto out_unlock; > + goto again; > } Using a goto here instead of a do {} while is not nice. I'll merge it as-is, but please send a followup patch using a proper loop. Regards Thanks, Mauro
Em Thu, 27 Jul 2023 08:42:55 +0300 Sakari Ailus <sakari.ailus@linux.intel.com> escreveu: > Document that sub-device notifiers are now registered using > v4l2_async_subdev_nf_init(). No documentation is changed as it seems that > sub-device notifiers were not documented apart from kernel-doc comments. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> > Tested-by: Philipp Zabel <p.zabel@pengutronix.de> # imx6qp > Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> # rcar + adv746x > Tested-by: Aishwarya Kothari <aishwarya.kothari@toradex.com> # Apalis i.MX6Q with TC358743 > Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # Renesas RZ/G2L SMARC > --- > Documentation/driver-api/media/v4l2-subdev.rst | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/Documentation/driver-api/media/v4l2-subdev.rst b/Documentation/driver-api/media/v4l2-subdev.rst > index eba5e4468282..e56b50b3f203 100644 > --- a/Documentation/driver-api/media/v4l2-subdev.rst > +++ b/Documentation/driver-api/media/v4l2-subdev.rst > @@ -218,6 +218,17 @@ available. There may be one or more async connections to a given sub-device but > this is not known at the time of adding the connections to the notifier. Async > connections are bound as matching async sub-devices are found, one by one. > > +Asynchronous sub-device notifier for sub-devices > +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > + > +A driver that registers an asynchronous sub-device may also register an > +asynchronous notifier. This is called an asynchronous sub-device notifier andthe > +process is similar to that of a bridge driver apart from that the notifier is > +initialised using :c:func:`v4l2_async_subdev_nf_init` instead. A sub-device > +notifier may complete only after the V4L2 device becomes available, i.e. there's > +a path via async sub-devices and notifiers to a notifier that is not an > +asynchronous sub-device notifier. > + > Asynchronous sub-device registration helper for camera sensor drivers > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Hmm... you did a lot of reorder at the code for async devices. IMO, you should be pointing at the documentation what's the expected order of kAPI usage: what comes first? V4L2 register? async notifiers? etc. Regards Thanks, Mauro