-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Add architectural support for shared interrupts #61278
Comments
Hi @LaurentiuM1234! We appreciate you submitting your first issue for our open-source project. 🌟 Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙 |
With my current project I actually have a real world usecase for this. I need 3 i2c ports on the STM32G0B1, and ports 2 and 3 share IRQs. Using non-IRQ mode is not possible because port 2 needs to run in slave mode (which forces the needs for IRQs). Also I'll need the two CAN ports, and they also shared IRQ's. So I hope the PR #61422 to this issue lands in main soon :-) |
@lowlander yes, this should land in zephyr once Laurentiu gets back from vacation next week. I wonder if you could do some testing and provide your feedback. |
Feature was addressed in #61422, closing. |
Problem description
Currently, there seems to be no architectural support for shared interrupts. As such, in the following sequence:
irq_connect_dynamic(33, INTID_33_PRIO, some_handler, some_argument);
irq_connect_dynamic(33, INTID_33_PRIO, some_other_handler, some_other_argument);
some_other_handler
would overwritesome_handler
. Currently there seem to be 2 ways to solve this:intc_shared_irq.c
interrupt controller => doesn't scale very well, seems to require a DT node per shared IRQ. Problematic on platforms which have multiple shared IRQs (e.g: i.MX8QM which has the same INTID for groups of x channels)Proposed change
As as a way to solve the problem described above, we could add architectural support for shared interrupts. This could be achieved by simply registering a "dummy" ISR for an INTID and calling all registered ISRs for that INTID.
Detailed RFC
More specifically, if the
SHARED_IRQ
feature is enabled, we could overwritez_isr_install()
such that instead of registering the passed routine and argument in the ISR table, we could register our own "dummy" ISR and pass it a list of routine/arg pairs that it needs to invoke.The following is a draft of how this could be achieved:
Dependencies
This feature would be something one can enable/disable with a configuration. As such, if
CONFIG_SHARED_INTERRUPTS=y
,z_isr_install
would have the above definition. Otherwise, the default definition fromsw_isr_common.c
will be used. In theory there should be no dependencies.Would this change be something desired by the community? If so, I can submit a PR after I have something functional.
The text was updated successfully, but these errors were encountered: