From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Linux Media Mailing List <linux-media@vger.kernel.org>,
Hans Verkuil <hverkuil@xs4all.nl>
Subject: Re: [PATCH v4] V4L: dynamically allocate video_device nodes in subdevices
Date: Wed, 14 Sep 2011 12:37:12 +0200 [thread overview]
Message-ID: <4E7083D8.9050804@samsung.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1109132245570.11360@axis700.grange>
Hi Guennadi,
On 09/13/2011 11:18 PM, Guennadi Liakhovetski wrote:
> On Tue, 13 Sep 2011, Sylwester Nawrocki wrote:
>> On 09/13/2011 04:48 PM, Guennadi Liakhovetski wrote:
>>> Currently only very few drivers actually use video_device nodes, embedded
>>> in struct v4l2_subdev. Allocate these nodes dynamically for those drivers
>>> to save memory for the rest.
>>>
>>> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>>
>> I have tested this patch with Samsung FIMC driver and with MC enabled
>> sensor driver.
>> After some hundreds of module load/unload I didn't observe anything unusual.
>> The patch seem to be safe for device node enabled subdevs. You can stick my:
>>
>> Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
>>
>> if you feel so.
>
> Thanks very much for testing! However, depending on your test scenario,
> you might still not notice a problem by just loading and unloading of
> modules. It would, however, be useful to execute just one test:
>
> 1. add one line v4l2-device.c:
>
> diff --git a/drivers/media/video/v4l2-device.c b/drivers/media/video/v4l2-device.c
> index a3b89f4..33226857 100644
> --- a/drivers/media/video/v4l2-device.c
> +++ b/drivers/media/video/v4l2-device.c
> @@ -195,6 +195,7 @@ EXPORT_SYMBOL_GPL(v4l2_device_register_subdev);
> static void v4l2_device_release_subdev_node(struct video_device *vdev)
> {
> struct v4l2_subdev *sd = video_get_drvdata(vdev);
> + dev_info(&vdev->dev, "%s()\n", __func__);
> sd->devnode = NULL;
> kfree(vdev);
> }
>
> 2. with this patch start and stop capture
>
> 3. check dmesg - v4l2_device_release_subdev_node() output should not be
> there yet
>
> 4. rmmod modules, then the output should be there
>
> If you could test that - that would be great!
OK, I double checked if v4l2_device_release_subdev_node() is called at the right
time, i.e. I've also checked if the streaming works in between the module unload/load.
I'd added the printk and everything behaved as expected, other than I've tracked
down a few minor bugs in the drivers in the meantime;)
I'll keep your patch applied in my development tree.
Thanks,
--
Sylwester Nawrocki
Samsung Poland R&D Center
next prev parent reply other threads:[~2011-09-14 10:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-09 15:02 [PATCH] V4L: dynamically allocate video_device nodes in subdevices Guennadi Liakhovetski
2011-09-09 17:45 ` [PATCH v2] " Guennadi Liakhovetski
2011-09-09 21:32 ` Laurent Pinchart
2011-09-10 10:27 ` Guennadi Liakhovetski
2011-09-12 10:55 ` [PATCH v3] " Guennadi Liakhovetski
2011-09-13 9:16 ` Laurent Pinchart
2011-09-13 9:26 ` Guennadi Liakhovetski
2011-09-13 9:45 ` Laurent Pinchart
2011-09-13 14:15 ` Guennadi Liakhovetski
2011-09-13 14:48 ` [PATCH v4] " Guennadi Liakhovetski
2011-09-13 17:51 ` Sylwester Nawrocki
2011-09-13 21:18 ` Guennadi Liakhovetski
2011-09-14 10:37 ` Sylwester Nawrocki [this message]
2011-09-13 17:52 ` Laurent Pinchart
2011-09-27 17:05 ` [PATCH v5] " 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=4E7083D8.9050804@samsung.com \
--to=s.nawrocki@samsung.com \
--cc=g.liakhovetski@gmx.de \
--cc=hverkuil@xs4all.nl \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.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.