schedule: zephyr_dma_domain: Add support for shared IRQs#7923
Merged
lgirdwood merged 1 commit intothesofproject:mainfrom Jul 31, 2023
Merged
Conversation
3e56a9e to
29f3196
Compare
lgirdwood
reviewed
Jul 11, 2023
Member
lgirdwood
left a comment
There was a problem hiding this comment.
Quick read through, LGTM, does this need any west update ?
Contributor
Author
No west updates needed |
dbaluta
approved these changes
Jul 12, 2023
lyakh
reviewed
Jul 13, 2023
In the case of DMA channels using the same IRQ line the same interrupt handler with different data is registered multiple times for the same interrupt. This approach works perfectly fine when using the IRQ_STEER IP since the way its driver works is it allows registering multiple handlers+data for the same INTID. When switching to ARM64, this approach no longer works since the last irq_handler/irq_data pair will overwrite the previous one for the same INTID. Because of this, the IRQ bit from the DMA channel may not get cleared when multiple pipeline tasks are scheduled. This reasoning applies to the ARM64 architecture with GICv3 interrupt controller. To overcome this, the Zephyr DMA domain now holds a list of channels using the same IRQ. When the DMA IRQ gets triggered, the handler will iterate through the list of channels using the same IRQ and clear the interrupt. Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
29f3196 to
8b6177b
Compare
Contributor
Author
|
FYI: currently waiting on #7976 before I can test the changes from this PR. Hopefully that PR will fix the annoying crashes during stress testing. |
Contributor
Author
Collaborator
|
@LaurentiuM1234 Yes, this got through one round of internal CI. Looks good to me. Just take it out of Draft state. |
lgirdwood
approved these changes
Jul 31, 2023
Member
|
@juimonen any comments ? |
No, fine by me. I see this is IMX only. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the case of DMA channels using the same IRQ line the same interrupt handler with different data is
registered multiple times for the same interrupt.
This approach works perfectly fine when using the IRQ_STEER IP since the way its driver works is it allows registering multiple handlers+data for the same INTID.
When switching to ARM64, this approach no longer works since the last irq_handler/irq_data pair will overwrite the previous one for the same INTID. Because of this, the IRQ bit from the DMA channel may not get cleared when multiple pipeline tasks are scheduled. This reasoning applies to the ARM64 architecture with GICv3 interrupt controller.
To overcome this, the Zephyr DMA domain now holds a list of channels using the same IRQ. When the DMA IRQ gets triggered, the handler will iterate through the list of channels using the same IRQ and clear the interrupt.
This PR still requires more testing. For now, it has only been tested on ARM64-based i.MX93 and i.MX8QM and works fine for simple audio cases (i.e: simple playback, simple capture, simple playback with pause/resume)