From: sakari.ailus@linux.intel.com (Sakari Ailus)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 2/2] [media] media-device: split media initialization and registration
Date: Tue, 15 Sep 2015 14:01:54 +0300 [thread overview]
Message-ID: <55F7FAA2.2090605@linux.intel.com> (raw)
In-Reply-To: <1442313147-24566-3-git-send-email-javier@osg.samsung.com>
Hi Javier,
Javier Martinez Canillas wrote:
> The media device node is registered and so made visible to user-space
> before entities are registered and links created which means that the
> media graph obtained by user-space could be only partially enumerated
> if that happens too early before all the graph has been created.
>
> To avoid this race condition, split the media init and registration
> in separate functions and only register the media device node when
> all the pending subdevices have been registered, either explicitly
> by the driver or asynchronously using v4l2_async_register_subdev().
>
> The media_device_register() had a check for drivers not filling dev
> and model fields but all drivers in mainline set them and not doing
> it will be a driver bug so change the function return to void and
> add a BUG_ON() for dev being NULL instead.
>
> Also, add a media_device_cleanup() function that will destroy the
> graph_mutex that is initialized in media_device_init().
>
> Suggested-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Thanks!
For drivers/media/media-device.c, drivers/media/platform/omap3isp/isp.c
and include/media/media-device.h:
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Laurent, could you ack these if you're fine with them?
They depend on Mauro's patches so they should be applied after them.
--
Kind regards,
Sakari Ailus
sakari.ailus at linux.intel.com
prev parent reply other threads:[~2015-09-15 11:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-15 10:32 [PATCH v4 0/2] [media] Fix race between graph enumeration and entities registration Javier Martinez Canillas
2015-09-15 10:32 ` [PATCH v4 2/2] [media] media-device: split media initialization and registration Javier Martinez Canillas
2015-09-15 11:01 ` Sakari Ailus [this message]
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=55F7FAA2.2090605@linux.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).