[RFC] Improving udelay/ndelay on platforms where that is possible

Linus Torvalds torvalds at linux-foundation.org
Tue Oct 31 09:44:20 PDT 2017


On Tue, Oct 31, 2017 at 9:15 AM, Marc Gonzalez
<marc_gonzalez at sigmadesigns.com> wrote:
>
> On arm32, it is possible to set up udelay() to be clock-based.

I'm not sure why this is discussed as some kind of generic problem.

Just do what x86-64 already does. We use the TSC, and ndelay() does
the right thing too.

I've not checked precision, but it should be close to the TSC update
frequency. So we're talking tens of megahertz.

Does it work on all PC's? No. It's only half-way reliable on the ones
where the TSC frequency doesn't change. So there are no *guarantees*.

               Linus



More information about the linux-arm-kernel mailing list