DMA: add cpu_relax() to busy-loop in dma_sync_wait()
PATCH RESEND 1/1 DMA: add cpu_relax() to busy-loop in dma_sync_wait()
From: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] DMA: add cpu_relax() to busy-loop in dma_sync_wait()
Removal of the busy-loop from dma_sync_wait() is not a trivial task so just add cpu_relax() to the loop for now.
Cc Vinod Koul <[email protected]>
Cc Dan Williams <[email protected]>
Cc Tomasz Figa <[email protected]>
Signed-off-by Bartlomiej Zolnierkiewicz <[email protected]>
Signed-off-by Kyungmin Park <[email protected]>
--- drivers/dma/dmaengine.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/dma/dmaengine.c +4 -1
@@ -266,7 +266,10 @@ enum dma_status dma_sync_wait(struct dmapr_err ("%s: timeout!\n" , __func__);return DMA_ERROR ; } - }while (status ==DMA_IN_PROGRESS ); +if (status !=DMA_IN_PROGRESS ) +break ; +cpu_relax (); + }while (1 );return status; }