Re: [Camera Driver] Building as Static v/s Dynamic module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Em Mon, 26 Sep 2016 14:39:06 +0530
Ajith Raj <ajith.raj@xxxxxxxxxxxx> 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@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



Thanks,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux