From: Bartlomiej Zolnierkiewicz Date: Thu, 8 Nov 2012 10:02:07 +0000 (+0000) Subject: dmaengine: add cpu_relax() to busy-loop in dma_sync_wait() X-Git-Tag: next-20130218~69^2~5 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=64306d671620723efcb70408c2a498c6735d9813;p=karo-tx-linux.git dmaengine: 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 Cc: Tomasz Figa Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Kyungmin Park Signed-off-by: Dan Williams --- diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index a815d44c70a4..07109d061d81 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -266,7 +266,10 @@ enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie) pr_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; }