]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
dmaengine: add cpu_relax() to busy-loop in dma_sync_wait()
authorBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Thu, 8 Nov 2012 10:02:07 +0000 (10:02 +0000)
committerDan Williams <djbw@fb.com>
Tue, 18 Dec 2012 22:25:19 +0000 (14:25 -0800)
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 <vinod.koul@intel.com>
Cc: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dan Williams <djbw@fb.com>
drivers/dma/dmaengine.c

index a815d44c70a41b802c771dea337bf2e5348592a8..07109d061d815b803caa0342c6f17ec4a30d7182 100644 (file)
@@ -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;
 }