-
Notifications
You must be signed in to change notification settings - Fork 7.8k
drivers: dma: stm32: take "stream offset" into account when DMAV1 + DMAMUX is used #93673
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
Depending on the series in use dma_config should take into account a stream offset for the channel in use. Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Probably we need to review this whole offset handling and see why it can't be directly dealt from inside dma driver. |
From zephyr/include/zephyr/drivers/dma/dma_stm32.h Lines 18 to 31 in 2a88cb5
DMAv1 + DMAMUX ==> However, neither
zephyr/drivers/dma/dma_stm32.c Lines 108 to 112 in 2a88cb5
Possibly, this #ifdef CONFIG_DMAMUX_STM32 is wrong.
|
This seems to be the case, if the STM32_DMA_STREAM_OFFSET is applied to both cases:
The end result appears to operate correctly |
IRQ handler should take into account STM32_DMA_STREAM_OFFSET also when DMAMUX is present. Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Thanks for this feedback. I've just pushed an update. I've also performed a satisfying (and logically harmless) clean up on U5 driver. @djiatsaf-st could you perform a non regression on this whole PR to remain on the safe side ? I'm particularly worried about the potential impact of the dmamux related change as potentially this misalignment was compensated in other clients drivers to achieve functional state. |
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.
Otherwise LGTM (though possibly now we need to remove the id + STM32_DMA_STREAM_OFFSET
in the few drivers that have it...)
#ifdef CONFIG_DMAMUX_STM32 | ||
callback_arg = stream->mux_channel; | ||
callback_arg = stream->mux_channel + STM32_DMA_STREAM_OFFSET; |
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.
I think we should instead apply the offset here:
zephyr/drivers/dma/dma_stm32.c
Lines 656 to 659 in 0cc6d52
#ifdef CONFIG_DMAMUX_STM32 | |
/* Each further stream->mux_channel is fixed here */ | |
config->streams[i].mux_channel = i + config->offset; | |
#endif /* CONFIG_DMAMUX_STM32 */ |
#ifdef CONFIG_DMAMUX_STM32
/* Each further stream->mux_channel is fixed here */
- config->streams[i].mux_channel = i + config->offset;
+ config->streams[i].mux_channel = i + config->offset + STM32_DMA_STREAM_OFFSET;
#endif /* CONFIG_DMAMUX_STM32 */
STM32_DMA_STREAM_OFFSET is defined as 0 in case "dma u5" is in use. Clean up code relating to this define. Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
|
Depending on the series in use dma_config should take into account a stream offset for the channel in use.
Fixes #93617