mdelay

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

 



Hi,

I'm trying to understand an I2C algo driver for a platform that I'm
working on. In the source code where the driver is trying to read and
write certain data to my device, I frequently see code like this:

/*Initiate a transactionon on bus */

spin_lock_irq(&lock);
mdelay(1);
spin_unlock_irq(&lock);

/* Read status from device */

The delays like above are sprinkled quite often throughout the code,
whereever the driver is reading / writing to the hardware.

The driver does NOT have an interrupt handler, and the only reason
lock is used is to guard the mdelay statements throughout the code.

1) Can somebody help me understand what could be the use of disabling
interrupts while mdelay()?

2) AFAIK, mdelay is busy looping, right?

Thanks,

Dan.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

[Index of Archives]     [Audio]     [Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Fedora Users]

  Powered by Linux