linux kernel - How to implement timer expire function in sysfs of driver.? -


scenario: suppose if doing echo 1 > sysfs_entry - start doing i/o operation until echo 0 > sysfs_entry. here, wanted implement timer in sysfs_entry should stop i/o operation after t seconds , if not give echo 0 > sysfs_entry.

ps: not want use busy wait methods.

preferred: deferred/delayed work

please me resolve scenario.

you can use add_timer() , del_timer() api this. event queue might work (depends on context). more details, please read chapter 7 «time, delays, , deferred work» of linux device drivers (aka ldd) book available free of charge right here. timer api described on page 198.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -