Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: dw_mmc: avoid using dmaengine_terminate_all

dmaengine_terminate_all is deprecated and should be
replaced by more explicit synchronous and asynchronous
terminate functions. This change is based on the
commit b36f09c3c441 ("dmaengine: Add transfer termination
synchronization support"). Currently dw_mci_stop_dma
may be called under the spinlock, let's migrate
dmaengine_terminate_all to async terminate. This could
avoid the race condition of use-after-free resouce of
dmaengine once slave-dma driver implement the synchronize
method.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Shawn Lin and committed by
Ulf Hansson
ab925a31 49b17858

+1 -1
+1 -1
drivers/mmc/host/dw_mmc.c
··· 680 680 681 681 static void dw_mci_edmac_stop_dma(struct dw_mci *host) 682 682 { 683 - dmaengine_terminate_all(host->dms->ch); 683 + dmaengine_terminate_async(host->dms->ch); 684 684 } 685 685 686 686 static int dw_mci_edmac_start_dma(struct dw_mci *host,