dmaengine: imx-sdma: add terminated list for freed descriptor in worker
authorRobin Gong <yibin.gong@nxp.com>
Thu, 25 Mar 2021 10:42:50 +0000 (18:42 +0800)
committerRobin Gong <yibin.gong@nxp.com>
Wed, 28 Apr 2021 15:03:57 +0000 (23:03 +0800)
commit581e661370820c196f8ec262363d50a6df8f0f33
tree0fe28b047ced82d3c1aa1cc76f34b1337d8c4428
parenta216dbe15a896447bf5effffa43d5635b3545619
dmaengine: imx-sdma: add terminated list for freed descriptor in worker

Add terminated list for keeping descriptor so that it could be freed in
worker without any potential involving next descriptor raised up before
this descriptor freed, because vchan_get_all_descriptors get all
descriptors including the last terminated descriptor and the next
descriptor, hence, the next descriptor maybe freed unexpectly when it's
done in worker without this patch.
https://www.spinics.net/lists/dmaengine/msg23367.html

Change-Id: Iece434f55f3c6b5cf861fc23e4076fd4aa670ac4
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reported-by: Richard Leitner <richard.leitner@skidata.com>
(cherry picked from commit 24e30e721438600a496bcf1ae44cb4d7c93eafd8)
drivers/dma/imx-sdma.c