Linux Media Controller development
 help / color / mirror / Atom feed
* RFC run time configuration parameter checks in subdriver
@ 2013-01-04 14:02 Antti Palosaari
  2013-01-04 18:13 ` Michael Krufky
  0 siblings, 1 reply; 2+ messages in thread
From: Antti Palosaari @ 2013-01-04 14:02 UTC (permalink / raw)
  To: linux-media

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

-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: RFC run time configuration parameter checks in subdriver
  2013-01-04 14:02 RFC run time configuration parameter checks in subdriver Antti Palosaari
@ 2013-01-04 18:13 ` Michael Krufky
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Krufky @ 2013-01-04 18:13 UTC (permalink / raw)
  To: Antti Palosaari; +Cc: linux-media

On Fri, Jan 4, 2013 at 9:02 AM, Antti Palosaari <crope@iki.fi> wrote:
> 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

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-04 18:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-04 14:02 RFC run time configuration parameter checks in subdriver Antti Palosaari
2013-01-04 18:13 ` Michael Krufky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox