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

gregkh at linuxfoundation.org gregkh at linuxfoundation.org
Fri Feb 7 16:23:21 UTC 2014


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!  :)

thanks,

greg k-h


More information about the devel mailing list