On Wednesday 08 October 2008, Haavard Skinnemoen wrote:
The specific QOS achieved is system-specific; the term for
that kind of mechanism is "hinting". It's very clearly defined
what the hint means .. but a given system might not use it.
The madvise(2) system call is a userspace example of hinting.
That is, "On the other hand, 'later' is not yet..." ?
Are you suggesting that debouncing support shouldn't
be provided without QOS query/update support?
Done: "as close to 1 msec as hardware allows". (I think less
than that is probably too little, and more would likely be OK.)
Note by the way what I think is a problematic assumption there:
that this *exact* debounce period matters. It seems to be more
usual that it just fit into a range of reasonable values; a bit
more or less won't matter, almost by definition.
(And also, that routine is less functional than request_irq ...)
I'm not sure which sentence you refer too, but the first
"perhaps" above is yours! :)
OK..
What I like about the flag is that it's really simple, a
"fire and forget" model. Easy for drivers to use. And it
need not be incompatible with a fancier interface...
The debounce() method might usefully be changed to take the
requested delay in microseconds, instead of a boolean. And
to return the actual delay. That would make it easier to
support fancier calls later, maybe just exposing the raw
irq_chip call like
usecs = set_irq_debounce(irq, range_spec);
The notion of a request_debounced_irq() needs more cooking
yet though, IMO.
But how important *is* that detail to most drivers? In practice.
I susct pethey pick numbers today since they have to debounce with
software timers, which require numbers.
I think irq_chip calls should be limited to hardware support.
Keep them really simple; put layers on top of them if needed.
I can't see it working otherwise. Of course, maybe there should
just be generic ranges rather than expecting drivers to understand
how springy contacts might be on a given board, or how dirty they
may be to cause other kinds of chatter.
- Dave
--