diff options
| author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2012-10-01 06:06:25 -0400 |
|---|---|---|
| committer | Vinod Koul <vinod.koul@linux.intel.com> | 2012-10-02 03:48:00 -0400 |
| commit | 3d4f860583bf4aa55dd5c6d5ba6ccf1f25fb473a (patch) | |
| tree | fc5cb522ecd43872c01b35318deb5003853ff1f0 | |
| parent | fed2574b3c9f44556ed4f5cb17f63b15edd87d06 (diff) | |
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>
| -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 9ca9ca41b83e..c4b0eb3cde81 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, | |||
| 716 | size_t offset; | 716 | size_t offset; |
| 717 | unsigned int src_width; | 717 | unsigned int src_width; |
| 718 | unsigned int dst_width; | 718 | unsigned int dst_width; |
| 719 | unsigned int data_width; | ||
| 719 | u32 ctllo; | 720 | u32 ctllo; |
| 720 | 721 | ||
| 721 | dev_vdbg(chan2dev(chan), | 722 | dev_vdbg(chan2dev(chan), |
| @@ -728,11 +729,11 @@ dwc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src, | |||
| 728 | return NULL; | 729 | return NULL; |
| 729 | } | 730 | } |
| 730 | 731 | ||
| 731 | src_width = min_t(unsigned int, dwc->dw->data_width[dwc_get_sms(dws)], | 732 | data_width = min_t(unsigned int, dwc->dw->data_width[dwc_get_sms(dws)], |
| 732 | dwc_fast_fls(src | len)); | 733 | dwc->dw->data_width[dwc_get_dms(dws)]); |
| 733 | 734 | ||
| 734 | dst_width = min_t(unsigned int, dwc->dw->data_width[dwc_get_dms(dws)], | 735 | src_width = dst_width = min_t(unsigned int, data_width, |
| 735 | dwc_fast_fls(dest | len)); | 736 | dwc_fast_fls(src | dest | len)); |
| 736 | 737 | ||
| 737 | ctllo = DWC_DEFAULT_CTLLO(chan) | 738 | ctllo = DWC_DEFAULT_CTLLO(chan) |
| 738 | | DWC_CTLL_DST_WIDTH(dst_width) | 739 | | DWC_CTLL_DST_WIDTH(dst_width) |
