Skip to contentSkip to conversation

RFC run time configuration parameter checks in subdriver

DISCUSSION Antti Palosaari 2 participants 2 messages Jan 4, 2013 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

I would like to discuss if there is idea to validate subdriver parameters explicitly at run-time when subdriver module is load.

There is configuration parameters for about every driver like:
* I2C address
* clock frequency

Nowadays, when main driver loads subdriver, it passes those static compile-time parameters to the subdriver, those parameters are not mainly validated at all. That could lead situation device is not working, instead it is will fail with some error, like I/O as I2C address is wrong.

As these parameters are set compile time, this situation affects only developers which are adding support for new hardware.

regards
Antti

Signature · 1 line
http://palosaari.fi/
#1 lore raw
Quoted 12 lines · Antti Palosaari

I would like to discuss if there is idea to validate subdriver parameters explicitly at run-time when subdriver module is load.

There is configuration parameters for about every driver like:
* I2C address
* clock frequency

Nowadays, when main driver loads subdriver, it passes those static compile-time parameters to the subdriver, those parameters are not mainly validated at all. That could lead situation device is not working, instead it is will fail with some error, like I/O as I2C address is wrong.

Quoted 5 lines

As these parameters are set compile time, this situation affects only developers which are adding support for new hardware.

regards
Antti

As Linux itself appeals most to developers, or at least we as developers want to encourage Linux users to be involved in their operating system, I believe it is indeed best to provide checking and error reporting for the sake of development (especially by newcomer programmers) during driver bring-up *and* for the use case of users themselves.

I understand that you are very concerned with "bloat" of what you consider to be potentially unnecessary checks, but I do believe that this is better for the grand scheme of things. If you have concerns about "bloat" then I would indeed find it friendly to make these such checks conditional to be included in debug mode, only. (or if the kernel is compiled with the media subsystem's "advanced debug" flag enabled)

Is that a fair compromise?

Cheers,

Mike Krufky