-
Notifications
You must be signed in to change notification settings - Fork 214
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
Possible interrupt footgun on multicore systems #1525
Comments
Maybe it would be good to have a way to specify which core the interrupt should be handled on. IIRC we are considering removing the interrupt handler from the constructors and add |
Unfortunately I don't think this is possible, at least on Xtensa. The mapping of interrupts can be done, but enable has be done each CPU respectively. After thinking about this, I don't think this is a real issue. I will submit a docs PR to inform users about this, then we can close this. |
Re opening thanks to the new construction of async drivers and a great idea from @Dominaezzz (#2430 (comment)) we can do better than just documentation now. |
We can disallow Sending async drivers. We can disable interrupt handlers on the "other" core when setting a new one. However, we can't really prevent Sending a blocking driver that has set an interrupt handler without disallowing Sending drivers completely. I'm not sure this is a big deal and the other two cases will already have practical benefit. If we ever get to implementing split interrupt control structs, we can (and should) also make the split driver |
The idea of making async drivers !Send is because the interrupt handlers in the hal haven't been written to correctly handle cross core interactions. For blocking drivers, I mostly see this as "it's up to the user to get it right". SplitBlocking being !Send might be a little heavy handed, I think marking the interrupt control object itself as !Sync should be enough to force the user to do the right thing. |
Adding the beta blocker label as we probably want to flesh out a design here before we get close to 1.0 |
Now that the interrupt is handled internally by the peripheral driver, the interrupt is configured for the core the driver is created on, which means if core 0 creates a driver and moves it to core 1, its interrupt will still be handled by core 0. Maybe this isn't a big deal, but we should document or avoid it entirely if possible.
The text was updated successfully, but these errors were encountered: