dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linaro.org>
To: dan.j.williams@intel.com, vkoul@kernel.org
Cc: eric.long@unisoc.com, orsonzhai@gmail.com, zhang.lyra@gmail.com,
	broonie@kernel.org, baolin.wang@linaro.org,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 5/7] dmaengine: sprd: Fix block length overflow
Date: Mon, 15 Apr 2019 20:14:59 +0800	[thread overview]
Message-ID: <93626039ad49c1c9d5726218b060c2267c1779cf.1555330115.git.baolin.wang@linaro.org> (raw)
Message-ID: <20190415121459.feQ6znxAG6fglS46RJO_TwQsS_Y-af5viHTQDLM1UYo@z> (raw)
In-Reply-To: <cover.1555330115.git.baolin.wang@linaro.org>
In-Reply-To: <cover.1555330115.git.baolin.wang@linaro.org>

From: Eric Long <eric.long@unisoc.com>

The maximum value of block length is 0xffff, so if the configured transfer length
is more than 0xffff, that will cause block length overflow to lead a configuration
error.

Thus we can set block length as the maximum burst length to avoid this issue, since
the maximum burst length will not be a big value which is more than 0xffff.

Signed-off-by: Eric Long <eric.long@unisoc.com>
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
 drivers/dma/sprd-dma.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index 9f99d4b..a64271e 100644
--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -778,7 +778,7 @@ static int sprd_dma_fill_desc(struct dma_chan *chan,
 	temp |= slave_cfg->src_maxburst & SPRD_DMA_FRG_LEN_MASK;
 	hw->frg_len = temp;
 
-	hw->blk_len = len & SPRD_DMA_BLK_LEN_MASK;
+	hw->blk_len = slave_cfg->src_maxburst & SPRD_DMA_BLK_LEN_MASK;
 	hw->trsc_len = len & SPRD_DMA_TRSC_LEN_MASK;
 
 	temp = (dst_step & SPRD_DMA_TRSF_STEP_MASK) << SPRD_DMA_DEST_TRSF_STEP_OFFSET;
-- 
1.7.9.5


  parent reply	other threads:[~2019-04-15 12:15 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-15 12:14 [PATCH 0/7] Fix some bugs and add new feature for Spreadtrum DMA engine Baolin Wang
2019-04-15 12:14 ` [1/7] dmaengine: sprd: Fix the possible crash when getting engine status Baolin Wang
2019-04-15 12:14   ` [PATCH 1/7] " Baolin Wang
2019-04-29 11:35   ` [1/7] " Vinod Koul
2019-04-29 11:35     ` [PATCH 1/7] " Vinod Koul
2019-04-29 11:49     ` [1/7] " Baolin Wang
2019-04-29 11:49       ` [PATCH 1/7] " Baolin Wang
2019-04-29 12:02       ` [1/7] " Vinod Koul
2019-04-29 12:02         ` [PATCH 1/7] " Vinod Koul
2019-04-15 12:14 ` [2/7] dmaengine: sprd: Add validation of current descriptor in irq handler Baolin Wang
2019-04-15 12:14   ` [PATCH 2/7] " Baolin Wang
2019-04-15 12:14 ` [3/7] dmaengine: sprd: Fix the incorrect start for 2-stage destination channels Baolin Wang
2019-04-15 12:14   ` [PATCH 3/7] " Baolin Wang
2019-04-15 12:14 ` [4/7] dmaengine: sprd: Add device validation to support multiple controllers Baolin Wang
2019-04-15 12:14   ` [PATCH 4/7] " Baolin Wang
2019-04-29 11:57   ` [4/7] " Vinod Koul
2019-04-29 11:57     ` [PATCH 4/7] " Vinod Koul
2019-04-29 12:20     ` [4/7] " Baolin Wang
2019-04-29 12:20       ` [PATCH 4/7] " Baolin Wang
2019-04-29 14:05       ` [4/7] " Vinod Koul
2019-04-29 14:05         ` [PATCH 4/7] " Vinod Koul
2019-04-30  5:30         ` [4/7] " Baolin Wang
2019-04-30  5:30           ` [PATCH 4/7] " Baolin Wang
2019-04-30  8:29           ` [4/7] " Vinod Koul
2019-04-30  8:29             ` [PATCH 4/7] " Vinod Koul
2019-04-30  8:34             ` [4/7] " Baolin Wang
2019-04-30  8:34               ` [PATCH 4/7] " Baolin Wang
2019-04-30  8:53               ` [4/7] " Baolin Wang
2019-04-30  8:53                 ` [PATCH 4/7] " Baolin Wang
2019-05-02  6:01                 ` [4/7] " Vinod Koul
2019-05-02  6:01                   ` [PATCH 4/7] " Vinod Koul
2019-05-06  4:48                   ` Baolin Wang
2019-04-15 12:14 ` Baolin Wang [this message]
2019-04-15 12:14   ` [PATCH 5/7] dmaengine: sprd: Fix block length overflow Baolin Wang
2019-04-15 12:15 ` [6/7] dmaengine: sprd: Fix the right place to configure 2-stage transfer Baolin Wang
2019-04-15 12:15   ` [PATCH 6/7] " Baolin Wang
2019-04-15 12:15 ` [7/7] dmaengine: sprd: Add interrupt support for " Baolin Wang
2019-04-15 12:15   ` [PATCH 7/7] " Baolin Wang
2019-04-29 12:01   ` [7/7] " Vinod Koul
2019-04-29 12:01     ` [PATCH 7/7] " Vinod Koul
2019-04-29 12:11     ` [7/7] " Baolin Wang
2019-04-29 12:11       ` [PATCH 7/7] " Baolin Wang
2019-04-29 14:10       ` [7/7] " Vinod Koul
2019-04-29 14:10         ` [PATCH 7/7] " Vinod Koul
2019-04-30  5:37         ` [7/7] " Baolin Wang
2019-04-30  5:37           ` [PATCH 7/7] " Baolin Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=93626039ad49c1c9d5726218b060c2267c1779cf.1555330115.git.baolin.wang@linaro.org \
    --to=baolin.wang@linaro.org \
    --cc=broonie@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=eric.long@unisoc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=vkoul@kernel.org \
    --cc=zhang.lyra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).