From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Javier Martinez Canillas <javier@osg.samsung.com>,
linux-kernel@vger.kernel.org
Cc: "Luis de Bethencourt" <luis@debethencourt.com>,
linux-sh@vger.kernel.org,
"Sylwester Nawrocki" <s.nawrocki@samsung.com>,
"Sören Brinkmann" <soren.brinkmann@xilinx.com>,
linux-samsung-soc@vger.kernel.org,
"Hyun Kwon" <hyun.kwon@xilinx.com>,
"Matthias Schwarzott" <zzam@gentoo.org>,
"Kyungmin Park" <kyungmin.park@samsung.com>,
"Tommi Rantala" <tt.rantala@gmail.com>,
"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
"Hans Verkuil" <hans.verkuil@cisco.com>,
linux-media@vger.kernel.org, "Kukjin Kim" <kgene@kernel.org>,
"Krzysztof Kozlowski" <k.kozlowski@samsung.com>,
"Mauro Carvalho Chehab" <mchehab@osg.samsung.com>,
"Michal Simek" <michal.simek@xilinx.com>,
"Olli Salonen" <olli.salonen@iki.fi>,
linux-arm-kernel@lists.infradead.org,
"Stefan Richter" <stefanr@s5r6.in-berlin.de>,
"Antti Palosaari" <crope@iki.fi>,
"Shuah Khan" <shuahkh@osg.samsung.com>
Subject: Re: [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@linux.intel.com
WARNING: multiple messages have this Message-ID (diff)
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v4 2/2] [media] media-device: split media initialization and registration
Date: Tue, 15 Sep 2015 11:01:54 +0000 [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@linux.intel.com
WARNING: multiple messages have this Message-ID (diff)
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
WARNING: multiple messages have this Message-ID (diff)
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Javier Martinez Canillas <javier@osg.samsung.com>,
linux-kernel@vger.kernel.org
Cc: "Luis de Bethencourt" <luis@debethencourt.com>,
linux-sh@vger.kernel.org,
"Sylwester Nawrocki" <s.nawrocki@samsung.com>,
"Sören Brinkmann" <soren.brinkmann@xilinx.com>,
linux-samsung-soc@vger.kernel.org,
"Hyun Kwon" <hyun.kwon@xilinx.com>,
"Matthias Schwarzott" <zzam@gentoo.org>,
"Kyungmin Park" <kyungmin.park@samsung.com>,
"Tommi Rantala" <tt.rantala@gmail.com>,
"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
"Hans Verkuil" <hans.verkuil@cisco.com>,
linux-media@vger.kernel.org, "Kukjin Kim" <kgene@kernel.org>,
"Krzysztof Kozlowski" <k.kozlowski@samsung.com>,
"Mauro Carvalho Chehab" <mchehab@osg.samsung.com>,
"Michal Simek" <michal.simek@xilinx.com>,
"Olli Salonen" <olli.salonen@iki.fi>,
linux-arm-kernel@lists.infradead.org,
"Stefan Richter" <stefanr@s5r6.in-berlin.de>,
"Antti Palosaari" <crope@iki.fi>,
"Shuah Khan" <shuahkh@osg.samsung.com>,
"Rafael Lourenço de Lima Chehab" <chehabrafael@gmail.com>
Subject: Re: [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@linux.intel.com
next prev parent reply other threads:[~2015-09-15 11:01 UTC|newest]
Thread overview: 13+ 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 ` Javier Martinez Canillas
2015-09-15 10:32 ` Javier Martinez Canillas
2015-09-15 10:32 ` Javier Martinez Canillas
2015-09-15 10:32 ` [PATCH v4 1/2] [media] media-device: check before unregister if mdev was registered 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 10:32 ` Javier Martinez Canillas
2015-09-15 10:32 ` Javier Martinez Canillas
2015-09-15 10:32 ` Javier Martinez Canillas
2015-09-15 11:01 ` Sakari Ailus [this message]
2015-09-15 11:01 ` Sakari Ailus
2015-09-15 11:01 ` Sakari Ailus
2015-09-15 11:01 ` Sakari Ailus
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=crope@iki.fi \
--cc=hans.verkuil@cisco.com \
--cc=hyun.kwon@xilinx.com \
--cc=javier@osg.samsung.com \
--cc=k.kozlowski@samsung.com \
--cc=kgene@kernel.org \
--cc=kyungmin.park@samsung.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=luis@debethencourt.com \
--cc=mchehab@osg.samsung.com \
--cc=michal.simek@xilinx.com \
--cc=olli.salonen@iki.fi \
--cc=s.nawrocki@samsung.com \
--cc=shuahkh@osg.samsung.com \
--cc=soren.brinkmann@xilinx.com \
--cc=stefanr@s5r6.in-berlin.de \
--cc=tt.rantala@gmail.com \
--cc=zzam@gentoo.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.