Skip to contentSkip to conversation

dw_dmac: fix a regression in dwc_prep_dma_memcpy

PATCH Applied Andy Shevchenko 2 participants 2 messages Oct 1, 2012 – Oct 2, 2012 dmaengine

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dw_dmac: fix a regression in dwc_prep_dma_memcpy

Sometimes memory-to-memory test is failed, that's why we need to choose minimum data portion between source and destination limits together.

---
 drivers/dma/dw_dmac.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/dma/dw_dmac.c +5 -4
index 9ca9ca4..c4b0eb3 100644
@@ -716,6 +716,7 @@ dwc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
 	size_t			offset;
 	unsigned int		src_width;
 	unsigned int		dst_width;
+	unsigned int		data_width;
 	u32			ctllo;
 
 	dev_vdbg(chan2dev(chan),
@@ -728,11 +729,11 @@ dwc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
 		return NULL;
 	}
 
-	src_width = min_t(unsigned int, dwc->dw->data_width[dwc_get_sms(dws)],
-			  dwc_fast_fls(src | len));
+	data_width = min_t(unsigned int, dwc->dw->data_width[dwc_get_sms(dws)],
+					 dwc->dw->data_width[dwc_get_dms(dws)]);
 
-	dst_width = min_t(unsigned int, dwc->dw->data_width[dwc_get_dms(dws)],
-			  dwc_fast_fls(dest | len));
+	src_width = dst_width = min_t(unsigned int, data_width,
+				      dwc_fast_fls(src | dest | len));
 
 	ctllo = DWC_DEFAULT_CTLLO(chan)
 			| DWC_CTLL_DST_WIDTH(dst_width)
Signature · 1 line
1.7.10.4
Applied
#1 lore raw
Quoted 4 lines · Andy Shevchenko

Sometimes memory-to-memory test is failed, that's why we need to choose minimum data portion between source and destination limits together.

Applied, thanks for taking care of this

Signature · 1 line
~Vinod