concern related to Functions For executing Longer delay in driver

Misbah khan misbah_khan at engineer.com
Wed Oct 10 14:55:43 EST 2007


Hi all....

I am working on a driver which is Pooling for a bit in hardware. And here is
my concern :-

1. The worst case time delay could be 400 ms for which i am pooling every 50
ms eg :-

                          while((test_bit(PIC_BUSY,(volatile UINT32*)((void
*)mmap_reg_ptr+FR_FPGA_STATUS_REG))==1)&& (delay < MAX_DELAY_PIC)){
		KDEBUG1(" In PIC busy state \n");
		msleep_interruptible(PIC_DELAY);
		delay +=PIC_DELAY;
		}/* End of if() */

2. This function will be called after every 1 min and i do have to poll for
400 ms (worst case) after every 1 min.

3. i have a wait queue Implimented in the driver which will be schedule to
be executed every time interrupt occurs (worst case 1ms).

3. The delay function which will make the driver to poll for the bit in the
hardware which you could see in the above example is
msleep_interruptible(PIC_DELAY);

4. As far as my knowledge we could use either mdelay() ,msleep(),
msleep_interruptible(), or schedule_timeout() for such long delays. I have
used msleep_interruptible() but still i feel as per the senario if i could
get a better option which will make my driver more effecient.

5. Please let me know which could be the best and reliable fn() for this
approach and please let me know the reason also .

Thank you 
Misbah
-- 
View this message in context: http://www.nabble.com/concern-related-to-Functions-For-executing-Longer-delay-in-driver-tf4598583.html#a13129401
Sent from the linuxppc-embedded mailing list archive at Nabble.com.



More information about the Linuxppc-embedded mailing list