lkml.org 
[lkml]   [2009]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4] introduce macro spin_event_timeout()
From
Date

> But that's the thing - I don't want a required delay inside the loop.
>
> I guess I'm going to have to think about this for a while. I'd like
> to see something like cycles_per_usec() as a companion function to
> get_cycles().

I think that's where you're wrong :-)

Just require the delay inside the loop, it will make everything nicer.
There are also some good reasons to do that:

- The delay between "polls" of the register may have to be controlled,
for example some HW will choke if polled too fast

- If you aren't in an atomic section, you may want to use msleep() and
thus be schedule friendly

- It fixes all the problems mentioned earlier

Cheers,
Ben.



\
 
 \ /
  Last update: 2009-03-13 04:09    [W:1.384 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site