diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2012-10-01 13:06:25 +0300 |
---|---|---|
committer | Vinod Koul <vinod.koul@linux.intel.com> | 2012-10-02 13:18:00 +0530 |
commit | 3d4f860583bf4aa55dd5c6d5ba6ccf1f25fb473a (patch) | |
tree | fc5cb522ecd43872c01b35318deb5003853ff1f0 /drivers/dma | |
parent | fed2574b3c9f44556ed4f5cb17f63b15edd87d06 (diff) | |
download | op-kernel-dev-3d4f860583bf4aa55dd5c6d5ba6ccf1f25fb473a.zip op-kernel-dev-3d4f860583bf4aa55dd5c6d5ba6ccf1f25fb473a.tar.gz |
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.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/dw_dmac.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c index 9ca9ca4..c4b0eb3c 100644 --- a/drivers/dma/dw_dmac.c +++ b/drivers/dma/dw_dmac.c @@ -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) |