Skip to content
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

drivers: dma: dma_dw_common: Disable channel even if draining times out #68621

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions drivers/dma/dma_dw_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,13 @@ int dw_dma_stop(const struct device *dev, uint32_t channel)
bool fifo_empty = WAIT_FOR(dw_read(dev_cfg->base, DW_CFG_LOW(channel)) & DW_CFGL_FIFO_EMPTY,
DW_DMA_TIMEOUT, k_busy_wait(DW_DMA_TIMEOUT/10));
if (!fifo_empty) {
LOG_ERR("%s: dma %d channel drain time out", __func__, channel);
return -ETIMEDOUT;
LOG_WRN("%s: dma %d channel drain time out", __func__, channel);

/* Continue even if draining timed out to make sure that the channel is going to be
* disabled.
* The same channel might be requested for other purpose (or for same) next time
* which will fail if the channel has been left enabled.
*/
}
#endif

Expand Down
Loading