Skip to content

Commit

Permalink
dw_dmac: fix a regression in dwc_prep_dma_memcpy
Browse files Browse the repository at this point in the history
Sometimes memory-to-memory test is failed, that's why we need to choose minimum
data portion between source and destination limits together.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
  • Loading branch information
Andy Shevchenko authored and Vinod Koul committed Oct 2, 2012
1 parent fed2574 commit 3d4f860
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/dma/dw_dmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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)
Expand Down

0 comments on commit 3d4f860

Please sign in to comment.