From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
To: Ajith Raj <ajith.raj@broadcom.com>
Cc: linux-media@vger.kernel.org, g.liakhovetski@gmx.de, mchehab@kernel.org
Subject: Re: [Camera Driver] Building as Static v/s Dynamic module
Date: Mon, 26 Sep 2016 06:28:55 -0300 [thread overview]
Message-ID: <20160926062855.634f8628@vento.lan> (raw)
In-Reply-To: <3461d4fdf32e5b3a645419f0f3b1eb5b@mail.gmail.com>
Em Mon, 26 Sep 2016 14:39:06 +0530
Ajith Raj <ajith.raj@broadcom.com> escreveu:
> Hi Maintainers,
>
> I was working on a CPI based camera driver based on soc_camera framework
> which is compiled as a static module in kernel, due to the non-availability
> of modprobe framework.
Don't rely on soc_camera. We're in the process of rework such drivers
to use directly the V4L2 core or to remove them.
> While I was pushing the changes, I got a question from the internel code
> review that why the driver is being compiled as static while all other
> drivers available in the open source are compiled as dynamic .ko modules.
>
> I understand that camera as a component need not have to be built static and
> can be added later on the need basis. Is there any reason apart from this?
> Since the modprobe framework is not available, if I build it as dynamic .ko
> module, I need to insert all dependent modules independently and in the
> right order. There are many;
>
> videobuf2-dma-contig.ko, videobuf2-v4l2.ko, videobuf2-memops.ko,
> videobuf2-vmalloc.ko, …..etc
> v4l2-common.ko, v4l2-mem2mem.ko, v4l2-dv-timings.ko
> soc_mediabus.ko,soc_camera.ko ,……etc
> media.ko, videodev.ko
You don't need to take care of the order, as modprobe inserts them
with the right dependencies automatically. You may need to use the
async probe inside V4L, though, in order to ensure that the main
driver will be initializing the sub-drivers in the right order, as
OF doesn't ensure that.
> Do you see any issues in submitting camera as a static module?
> Or it has to be dynamic? If so, could you please help me understand the
> reasons.
All media drivers should build with modprobe. The more important
reason (at least for my PoV) is that it should be built with
allmodconfig/allyesconfig, and on all architectures, if COMPILE_TEST
Kconfig define is defined.
The rationale is that building the driver this way is required
for us to avoid building problems. Also, some static code analyzers
we have (Coverity) only runs on x86.
Another thing is that drivers that don't accept dynamic module load
very likely have hidden bugs (usually, race bugs, PM support issues,
dynamic bind/unbind issues).
>
> Thanks in advance.
>
> Regards,
> Ajith
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
Thanks,
Mauro
prev parent reply other threads:[~2016-09-26 9:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <0afd07b4dc410140902808df6b909507@mail.gmail.com>
2016-09-26 9:09 ` [Camera Driver] Building as Static v/s Dynamic module Ajith Raj
2016-09-26 9:28 ` Mauro Carvalho Chehab [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=20160926062855.634f8628@vento.lan \
--to=mchehab@s-opensource.com \
--cc=ajith.raj@broadcom.com \
--cc=g.liakhovetski@gmx.de \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox