Situation for LS1021A High-Resolution Timers?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Situation for LS1021A High-Resolution Timers?

Jump to solution
1,610 Views
stefannickl
Contributor II

Hi,

I'm working with a standard Linux 4.4.19-rt27 kernel on the TQ Systems platform for the LS1021A, and  following http://elinux.org/High_Resolution_Timers, I'm not getting high-resolution timers despite having them activated in the kernel config.

 

I've tried all preemption levels that can be configured from PREEMPT_RT to LAZY, each time cyclictest warns about unavailable high resolution timers and gives results that correspond to the jiffy period.

Any advice how this could be solved?

I've seen replies to older posts referring to SDK kernels, but according to the FAE the platform work by Freescale/NXP is now pushed to mainline instead (very agreeable move in general), and the BSP by TQ Systems is also based on the standard kernel.

 

Best regards,

Stefan

Labels (1)
Tags (1)
1 Solution
1,435 Views
stefannickl
Contributor II

For anyone else interested, turns out the trick is to set the "always-on" property in the device tree node for the CPU's (ARM architecture) timer.

Doing so gives a guarantee to the kernel that the timer will not stop due to power management; I still have to see how well that holds for my platform, YMMV.

View solution in original post

0 Kudos
3 Replies
1,435 Views
Pavel
NXP Employee
NXP Employee

NXP offers SDK Linux BSP 2.0 for TWR-LS1021a board. This SDK supports high resolution timer. See attachment.

Use this SDK if high resolution timer is needed.


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,435 Views
stefannickl
Contributor II

Hello Pavel,

thanks for your reply.

The screenshots you've provided show the kernel compile-time configuration option for high resolution timers, which I have enabled as well.

However http://elinux.org/High_Resolution_Timers describes a number of tests for whether high resolution timers are actually available at run time, and those come out negative despite:

# zcat /proc/config.gz |egrep "RT_FULL|HIGH_RES" CONFIG_HIGH_RES_TIMERS=y CONFIG_PREEMPT_RT_FULL=y  # grep resolution /proc/timer_list   .resolution: 10000000 nsecs   .resolution: 10000000 nsecs   .resolution: 10000000 nsecs [...]  # grep event_handler /proc/timer_list  event_handler:  tick_handle_periodic  event_handler:  tick_handle_periodic  # cyclictest -n -p 80 -i 500 -l 5000 # /dev/cpu_dma_latency set to 0us WARN: High resolution timers not available policy: fifo: loadavg: 0.00 0.00 0.00 2/105 335 T: 0 (  335) P:80 I:500 C:   5000 Min:   1758 Act: 9748 Avg: 9743 Max: 9767

This was for HZ=100, latency goes down to 1ms for HZ=1000.

Can you confirm that the SDK kernel actually provides high-res timers at runtime?

Are there any plans to update the SDK kernel to 4.x over the next year or so?

Best regards,

Stefan

1,436 Views
stefannickl
Contributor II

For anyone else interested, turns out the trick is to set the "always-on" property in the device tree node for the CPU's (ARM architecture) timer.

Doing so gives a guarantee to the kernel that the timer will not stop due to power management; I still have to see how well that holds for my platform, YMMV.

0 Kudos