-
Notifications
You must be signed in to change notification settings - Fork 66
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
Remove sched_elect in serialchar_callback #29
Conversation
DO NOT USE sched_elect inside the irq. If a context switch is done inside the irq, it will make v7m-head.S `pop {pc}` to a undefined place.
@mlouielu , let me double-check it. You mean that triggering scheduler in irq context would violate flow of exception handler due to exception return ? If so, you might be right. How about the result of test suites and behavior of minishell? |
Although I think this is a correct fix, please hold off a second. I still trying to figure out why we can not do a context switch inside a regular ISR....it is weird. |
Confirm that this have some bug inside, reproduce step:
|
Currently, I'm working on #36 to ensure that this problem isn't coming from the scheduler. |
The use of |
+1 |
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.
@mlouielu , I already confirmed that that's the reason for serial halted. Please mention what's wrong with that in perspective of exception flow and the benefits to following exception service convention. Unexpected exception return increases the probability of occurrence of faults, such as INVPC, INVSTATE. In this situation, we can't make sure that it wouldn't cause faults or invalid interrupt raising due to unfinished interrupt handling.
Moreover, PendSV handler is involved with |
DO NOT USE sched_elect inside the irq.
If a context switch is done inside the irq,
it will make v7m-head.S
pop {pc}
to a undefined place,or not able to
pop {pc}
out.cc. @yenwu.