sched/hrtimer: fix hrtimer regression introduced by recent update and add support for tickless with hrtimer #18174
+34
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Change1:
The hrtimer subsystem is independent of the OS scheduler tick mechanism and
tickless mode. In fact, it operates below the OS scheduler and provides
scheduler tick support through an hrtimer object. Therefore, it must always
be able to reprogram the hardware timer to achieve nanosecond-level
resolution.
A recent update restricted hardware timer reprogramming to tickless mode
only. As a result, hrtimer no longer functions correctly when the scheduler
is running in tick-based mode.
This change removes the incorrect dependency on tickless mode and restores
proper hrtimer operation.
Change2:
add support for tickless with hrtimer
Impact
Fix the in-proper update of hrtimer module, this change is isolated in hrtimer moduler
no impact to other NuttX parts.
Testing
depends on apache/nuttx-apps#3380
**ostest passed on rv-virt:smp64 with hrtimer enabled on both non-tickless and tickless node **
1. tickless mode
2. non-tickless mode