Re: [PATCH 41/48] staging: comedi: pcl812: use comedi_timeout()

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

 



On 2014-02-07 16:23, gregkh@xxxxxxxxxxxxxxxxxxx wrote:
On Fri, Feb 07, 2014 at 04:14:01PM +0000, Hartley Sweeten wrote:
On Friday, February 07, 2014 8:34 AM, Ian Abbott wrote:
On 2014-02-06 23:49, H Hartley Sweeten wrote:
Use comedi_timeout() to wait for the analog input end-of-conversion.

Combine the logic for the pcl812 and acl812 end-of-conversion in the
helper function to simplify the driver.

The interrupt routine also uses the timeout check to make sure data
is actually available. Using NULL here for the 'insn' is safe since
nothing uses it.

I don't think you can rely on jiffies being updated in the interrupt
routine.

 From previous comments from Greg I assumed using jiffies for the
timeout was ok in interrupt contexts, we just couldn't use cpu_relax().
But, I could be wrong. Hopefully someone might be able to provide
some more information on this.

Unless you are the timer interrupt, I'm pretty sure that jiffies is ok
to use in interrupt context.  But I could be totally wrong, it's been
years since I looked at that.  Try it and see!  :)

It would probably work unless timer interrupts are lower priority than the device interrupts (not true on a PC), OR interrupts are disabled on a single CPU system (depends on the code), OR local CPU interrupts are disabled on a multi-CPU system but timer interrupts always run on the same CPU by interrupt affinity (don't know).

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@xxxxxxxxx>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux