Skip to contentSkip to conversation

DMA: add cpu_relax() to busy-loop in dma_sync_wait()

PATCH RESEND New Bartlomiej Zolnierkiewicz 1 participant 1 message Dec 5, 2012 dmaengine

lore
Share & tools
lore
#0 lore raw

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.

---
 drivers/dma/dmaengine.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/dma/dmaengine.c +4 -1
Index: b/drivers/dma/dmaengine.c
===================================================================
@@ -266,7 +266,10 @@ enum dma_status dma_sync_wait(struct dma
 			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;
 }