Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xdma: explicitly stop engine on transfer completion
When used with the eop_flush flag, the driver may be interrupted before all descriptors has been processed by the XDMA core, and it may so happen that during the interrupt processing, the engine has already processed all descriptors, but the driver is not aware of it. In libxdma.c:1139 there is a check if the engine is busy if ((engine->running && !(engine->status & XDMA_STAT_BUSY)) at the engine is stopped if it not busy. When that code is executed, the engine may indeed be busy, but by the time we get the descriptor count on line 1155, all descriptors may have already been processed, and the engine is not busy anymore. Since the running status of the engine in the driver has not changed (engine->running == 1), subsequent transfers are only *queued*, but not processed by the engine, which leads to an eventual timeout and error 512. The proposed change explicitly stops the engine when a transfer is complete.
- Loading branch information