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 an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux