-
Notifications
You must be signed in to change notification settings - Fork 8.1k
NXP support lptmr tickless function #95143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
NXP support lptmr tickless function #95143
Conversation
2cf7357 to
0b787a8
Compare
|
Updated to fixed dts conflict with newly commit modification. Hi, this PR is aim to support nxp lptmr tickless function, and supported it in imx95 m7, can you help review it when you time free? Thanks |
a4522f5 to
5b1791a
Compare
5b1791a to
099ead3
Compare
|
@mmahadevan108 please help review this |
|
ping @henrikbrixandersen @DerekSnell |
Yeah, this is the reason I did not implement tickless mode in this driver when I originally submitted it (see 21806b5). |
099ead3 to
6719da2
Compare
|
Hi @mmahadevan108 , I have added disable/start code logic in LPTMR_SetTimerPeriod to avoid the hardware limitations, tested passed on imx95 m7 power_mgmt_soc test case, the time sleep and tick record is right in my side, please help reivew it when you time free, thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stopping/starting the timer when setting a new timeout will affect the ticks (as the time all the instructions between stopping and starting will not be counted). I don't think this is an acceptable solution.
6719da2 to
2446f3e
Compare
add lptmr1 node into imx95 m7 dts which locate on Always On domain and can continue work when whole soc enter system sleep mode Signed-off-by: Yongxu Wang <[email protected]>
remove lptmr2 and enable lptmr1 interface as default Signed-off-by: Yongxu Wang <[email protected]>
Enable lptmr interface to support counter_basic_api test case Signed-off-by: Yongxu Wang <[email protected]>
Use lptmr interface as system clock if enabled PM as system tick can't continue work in system suspend mode Signed-off-by: Yongxu Wang <[email protected]>
When tickless is enabled, it is necessary to ensure that lptmr can be set for a period of time instead of generating an interrupt at one tick Set lptmr to the free running mode to ensure that the current cycles value of lptmr can be directly obtained in ISR Signed-off-by: Yongxu Wang <[email protected]>
2446f3e to
ac6e777
Compare
|
Hi @henrikbrixandersen I fully understand your concerns. After reconfirming with the design team, we need to ensure that there is sufficient time when updating the CMP. We can choose to reset(but this will cause the time to go back instead of monotonically increasing. Even through software, it is difficult to guarantee that there are no corner cases). In the latest commit, I added a protection mechanism. When the distance is very close, It will postpone a windo to prevent it from being triggered. Of course, this should depend on different SoCs, please help review it again when you time free, thanks a lot |
Add safety window mechanism to prevent race conditions when updating LPTMR compare register (CMR). Problem: - Setting CMR too close to current hardware counter can cause missed interrupts and system hangs Solution: - Implement lptmr_set_safe_immediate() with configurable safety window Signed-off-by: Yongxu Wang <[email protected]>
ac6e777 to
43ce283
Compare
|
I'd like to hear @andyross and @teburd (System timer maintainer/collaborator) view on this. I am unsure if this is a good solution. |



Uh oh!
There was an error while loading. Please reload this page.