You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dmaengine: andes: atcdmac300: Fix the descriptor timeout issue (torvalds#167)
In v5_advance_work, v5_complete_all() moves the descriptors from the queue
to the active_list. If active_list is empty, the operation of this DMA
channel is stopped and the DMA channel is set to idle (chan_used = 0).
However, if a new descriptor is added to the queue between the calls
to v5_complete_all() and the check for list_empty(&v5chan->active_list),
this descriptor will not be executed.
if (list_is_singular(&v5chan->active_list)) {
v5_complete_all(v5chan);
} ...
if (list_empty(&v5chan->active_list))
v5chan->chan_used = 0;
else
v5_dostart(v5chan, v5_first_active(v5chan));
The solution is to process the new descriptor in the queue before
stopping the DMA channel if there is a new descriptor in the queue.
if (list_is_singular(&v5chan->active_list)) {
v5_complete_all(v5chan);
} ...
spin_lock(&v5chan->lock);
if (list_empty(&v5chan->active_list)) {
if (!list_empty(&v5chan->queue)) {
list_move(v5chan->queue.next, &v5chan->active_list);
...
Signed-off-by: CL Wang <[email protected]>
Reviewed-on: https://gitea.andestech.com/RD-SW/linux/pulls/167
Reviewed-by: Tim Shih-Ting OuYang <[email protected]>
Reviewed-by: randolph <[email protected]>
Co-authored-by: CL Wang <[email protected]>
Co-committed-by: CL Wang <[email protected]>
0 commit comments