diff options
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/amba-pl08x.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index 45d8a5d5bccd..4bcf6036f35d 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c | |||
@@ -669,20 +669,22 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, | |||
669 | * width left | 669 | * width left |
670 | */ | 670 | */ |
671 | while (bd.remainder > (mbus->buswidth - 1)) { | 671 | while (bd.remainder > (mbus->buswidth - 1)) { |
672 | size_t lli_len, tsize; | 672 | size_t lli_len, tsize, width; |
673 | 673 | ||
674 | /* | 674 | /* |
675 | * If enough left try to send max possible, | 675 | * If enough left try to send max possible, |
676 | * otherwise try to send the remainder | 676 | * otherwise try to send the remainder |
677 | */ | 677 | */ |
678 | lli_len = min(bd.remainder, max_bytes_per_lli); | 678 | lli_len = min(bd.remainder, max_bytes_per_lli); |
679 | |||
679 | /* | 680 | /* |
680 | * Check against minimum bus alignment: Calculate actual | 681 | * Check against maximum bus alignment: Calculate actual |
681 | * transfer size in relation to bus width and get a | 682 | * transfer size in relation to bus width and get a |
682 | * maximum remainder of the smallest bus width - 1 | 683 | * maximum remainder of the highest bus width - 1 |
683 | */ | 684 | */ |
684 | tsize = lli_len / min(mbus->buswidth, sbus->buswidth); | 685 | width = max(mbus->buswidth, sbus->buswidth); |
685 | lli_len = tsize * min(mbus->buswidth, sbus->buswidth); | 686 | lli_len = (lli_len / width) * width; |
687 | tsize = lli_len / bd.srcbus.buswidth; | ||
686 | 688 | ||
687 | dev_vdbg(&pl08x->adev->dev, | 689 | dev_vdbg(&pl08x->adev->dev, |
688 | "%s fill lli with single lli chunk of " | 690 | "%s fill lli with single lli chunk of " |