-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
tests/kernel/interrupt failed on ARC #23476
Comments
This also fails on nsim_sem, nsim_em, nsim_sem_mpu_stack_guard, nsim_em_mpu_stack_guard |
@andrewboie @ruuddw @abrodkin , here is my investigation
systick timer irq cannot be handled as irq is locked. So it means the sys tick may be lost. Meanwhile, k_busy_wait(MS_TO_US(1000)) relies on k_cycle_get_32, then to arch_k_cycle_get_32()->z_timer_cycle_get_32 However, as the sys tick is not updated because of irq lock , the value return by z_timer_cycle_get_32 will wrap back. ARC's timer is a free running timer and will wrap to 0 when the counter reaches the LIMIT. (other arch like ARM has similar issue) This will cause processor loops forever in k_busy_wait. The root issue is how to maintain the sys cycles when sys tick irq is not updated and there is no global wall clock. For the test, a quick fix is don't k_busy_wait too long when irq is locked. e.g, a second fix is to implement CONFIG_ARCH_HAS_CUSTOM_BUSY_WAIT a third fix is to maintain the correct wall clock in arch_k_cycle_get_32/z_timer_cycle_get32. I think in high-level, it needs some discussion about this. |
It could be argued that busy waiting for longer than 2 (dynamic) system ticks is a-typical use ("A busy wait is typically used instead of thread sleeping when the required delay is too short to warrant having the scheduler context switch from the current thread to another thread and then back again."). |
Describe the bug
Running tests/kernel/interrupt on iotdk board, it will stop at "test_prevent_interruption" and fail due to timeout.
To Reproduce
Steps to reproduce the behavior:
Screenshots or console output
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: