-
Notifications
You must be signed in to change notification settings - Fork 8.1k
arch: arc: add support for multilevel interrupts #92269
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?
Conversation
6584090 to
2fdd7af
Compare
Update the arch_irq_enable/disable functions to support multilevel interrupts on the ARC architecture. Signed-off-by: Aaron Fong <[email protected]>
2fdd7af to
2f77dca
Compare
|
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.
The use of multilevel irq APIs LGTM, but I'm not familiar with ARC nor irq_nextlevel
|
Looks ok to me as well, but is there any SoC/board or example also using this (i.e. some testing has been done)? |
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.
Do you have a reason to left unchanged the ARConnect-aware variant above? I believe it should work with multi-level interrupts just as well.
|
Few more remarks/questions, I'm not very familiar with multi-level interrupts in Zephyr: |
Yes, that's how multi-level interrupts work in Zephyr. |
I think |
That dependency is enforced in the Kconfig zephyr/drivers/interrupt_controller/Kconfig.multilevel Lines 91 to 96 in b3ccee4
|
We're using this in production in Tenstorrent Blackhole chip:
From what I've seen, the initialization function of the interrupt aggregator device is responsible for enabling its parent interrupt line. So e.g. intc_plic (interrupt aggregator) enabling its parent interrupt during device init: |
|
From the answers, and having a quick look at other multi-level sources in the tree, I'm still not sure yet. Should the sequence be that With current logic, things probably work as the 'root' and intermediate interrupts are and remain always enabled. Only 'leaf' interrupts are enabled/disabled. But the "next_level" implies other intended logic to me. |
|
@ruuddw - can you make suggestions for code changes? @evgeniy-paltsev - can you please review? |
|
@ruuddw @evgeniy-paltsev - just pinging again to see if you are able to revisit |
|
@ycsin - since you wrote much of the multi-level interrupt handling code, can you address @ruuddw's comment? I don't believe there are changes required in this PR, and it is working in our firmware as-is, but maybe we've missed something. If so, please suggest changes. @ruuddw - if you are able to suggest changes in the code itself, that might be helpful. |
I guess @ruuddw's main concern is that if something used If the interrupt controllers are implemented as a driver (i.e. using one of Conversely, if everything is done in the app (i.e. not defined in devicetree, not initialized by Zephyr), then it is the dev's responsibility to call I reckon we don't do runtime check for these to keep things simple (and probably encourage devs to implement hardware with the device APIs? I don't know) So @ruuddw's concern is valid, but generally not an issue, that's how the RISCV works as well. EDIT: had a brief look at the IRQ 'nextlevel' APIs while I'm typing this comment and it seems like the nextlevel API is kinda similar conceptually to the multilevel IRQ but might do things differently For example, in This PR's implementation is closer to |
|
Thanks @ycsin for the explanations. I came to similar conclusions. I see two different approaches in other soc's. Both may work, explicitly manage all intermediate controllers when enabling/disabling a leave interrupt, or by default enable all intermediate levels to pass on any interrupt and only enable/disable the leave controllers. But the "next_level" name and call made me think the explicit handling of the full chain was intended, instead of always enable all intermediate controllers. |
|
Hi @afongTT, can you please confirm that from the two possible strategies for managing the multilevel interrupts, you chose the one best fitting your use-case (enable/disabling the final-level controller interrupt only, and have all others always enabled)? And maybe add a note/documentation that this approach is assumed? |



Update the arch_irq_enable/disable functions to support multilevel interrupts on the ARC architecture.