-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dma: dma_nxp_edma: refactor state transitioning
The channel state transitions are currently performed at the beginning of each of the functions that triggers them (e.g: edma_start(), edma_stop(), etc...). The main issue with this approach is the fact if there's any failures after the state transition then the channel will be in the target state without performing the required steps for it. For instance, during edma_config(), if any of the functions after the state transition (the channel_change_state() call) fails (e.g: get_transfer_type()) fails then the state of the channel will be CONFIGURED even if not all the required steps were performed (e.g: setting the MUX, configuring the transfer, etc...). To fix this, split the state transition into two steps: 1) Check if the transition is possible. 2) Do the transition. First step should be done before any configurations to make sure that we should be performing them in the first place, while the second step should be performed after all configurations, thus guaranteeing that all the required steps for the target state were performed before transitioning to it. Signed-off-by: Laurentiu Mihalcea <[email protected]>
- Loading branch information
1 parent
6bd3f96
commit 39cb688
Showing
2 changed files
with
37 additions
and
36 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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