Can't get nanosleep to work for small delays
Grant Edwards
grant.b.edwards at gmail.com
Tue Sep 20 23:18:20 UTC 2011
On 2011-09-20, Grant Edwards <grant.b.edwards at gmail.com> wrote:
> I'm running a 2.6.30 kernel on an Atmel AT91SAM9g20 with uClibc
> 0.9.30.3 built with gcc 4.4.6.
>
> The problem is that when calling nanosleep with small delays, the
> calling task doesn't wake up until the next 4ms tick.
>
> Here are what I _think_ are the relevent portions of kernel config:
>
> CONFIG_TICK_ONESHOT=y
> CONFIG_NO_HZ=y
> CONFIG_HIGH_RES_TIMERS=y
> CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
> CONFIG_VMSPLIT_3G=y
> # CONFIG_VMSPLIT_2G is not set
> # CONFIG_VMSPLIT_1G is not set
> CONFIG_PAGE_OFFSET=0xC0000000
> CONFIG_PREEMPT=y
> CONFIG_HZ=250
> CONFIG_AEABI=y
> CONFIG_OABI_COMPAT=y
[...]
> What I'm trying to figure out is what piece is missing...
After some more googling and experimentation, I figured out that on
Atmel AT91 targets you have to enable ATMEL_TCLIB in the kernel build
in order to get high-res timers. [It would be nice if that were
mentioned in the help text for ATMEL_TCLIB, but it isn't.]
--
Grant
More information about the uClibc
mailing list