-
Notifications
You must be signed in to change notification settings - Fork 8.1k
drivers: dma: stm32: avoid clear TE in case of hal_override #97741
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?
drivers: dma: stm32: avoid clear TE in case of hal_override #97741
Conversation
If hal_override is set, avoid reporting an error and clear the transfer error (TE) bit so that HAL code can properly handle it. Signed-off-by: Alain Volmat <[email protected]>
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.
Non-blocking:
/* Let HAL DMA handle flags on its own */ | ||
if (!stream->hal_override) { | ||
LOG_ERR("Transfer Error."); | ||
stream->busy = false; | ||
dma_stm32_dump_stream_irq(dev, id); | ||
dma_stm32_clear_stream_irq(dev, id); | ||
} |
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.
Maybe we should log nonetheless?
/* Let HAL DMA handle flags on its own */ | |
if (!stream->hal_override) { | |
LOG_ERR("Transfer Error."); | |
stream->busy = false; | |
dma_stm32_dump_stream_irq(dev, id); | |
dma_stm32_clear_stream_irq(dev, id); | |
} | |
LOG_ERR("Transfer Error."); | |
if (!stream->hal_override) { | |
/* Let HAL DMA handle flags on its own */ | |
stream->busy = false; | |
dma_stm32_dump_stream_irq(dev, id); | |
dma_stm32_clear_stream_irq(dev, id); | |
} |
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.
Hum, considering that in case of HAL_OVERRIDE is being use, the Zephyr DMA framework is mainly use for resource handling rather than DMA functionaly speaking, I do not think that in such condition we should LOG anything here. If that's the HAL which is handling the DMA control, error checking etc, let's let it fully handle (aka configure, error handling etc).
Don't misunderstand me, I am not saying that we should bypass all and forever the Zephyr DMA framework ;) however in current implementation I do not see much merit to have the Zephyr DMA log this message. At least in case of DCMI, we have the callback in place to also get notification of transfer error. I suppose that's also the same thing for other drivers relying on HAL_OVERRIDE.
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.
Fine by me 🙂
In case of hal_override, we might want to also avoid doing the flag clear in case of FiFo error done by the dma_stm32_v1.c. |
In case of using HAL_OVERRIDE, avoid clearing the FIFO ERROR flag before calling the HAL DMA IrqHandler so that the HAL DMA code handling can be used. Signed-off-by: Alain Volmat <[email protected]>
445302d
I added a new commit to also avoid clear of the FIFO ERROR flag in case of using HAL_OVERRIDE. |
|
If hal_override is set, avoid reporting an error and clear the transfer error (TE) bit so that HAL code can properly handle it.