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

OK to use timer to periodically check device status?



I'm a true kernel programming newbie... been browsing the code for years,
and made some small patches, but now it's time for something more
significant...

The current ide-floppy driver has no useful "media change notification"
mechanism, and this causes problems for me and others. I can rectify this,
but the mechanism to do so will require polling the device (probably once
per second or so) for its status.

After looking around, it appears that the best way to accomplish this would
be to create a lightweight timer handler function (minimal code included)
and add a kernel timer to invoke that once per second. If the handler finds
significant work to do, should it do it, or queue a task for "later" to do
that? (that work could cause the drive's media to spun up and the partition
table to read, among other things)

Anything significantly wrong with this approach? My intention is to make
this feature a kernel config selectable option if you choose to include the
ide-floppy driver (and mark it experimental, of course).

-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/