Commit dc6a58c1 authored by Jean-Francois Moine's avatar Jean-Francois Moine Committed by Vinod Koul

dmaengine: sun6i: Fix impossible settings of burst and bus width

In the commit 1f9cd915 ("dmaengine: sun6i: Fix memcpy operation"),
the signed values returned by convert_burst() and convert_buswidth()
were stored in an unsigned value.
Then, these values were considered as errors when non null.

As a result, DMA transfers were rejected when the burst or buswidth
had values different from 1, as 8 for the burst or 4 for the bus width.
Acked-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: default avatarJean-Francois Moine <moinejf@free.fr>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 128fe7e9
...@@ -281,25 +281,25 @@ static inline int sun6i_dma_cfg_lli(struct sun6i_dma_lli *lli, ...@@ -281,25 +281,25 @@ static inline int sun6i_dma_cfg_lli(struct sun6i_dma_lli *lli,
dma_addr_t dst, u32 len, dma_addr_t dst, u32 len,
struct dma_slave_config *config) struct dma_slave_config *config)
{ {
u8 src_width, dst_width, src_burst, dst_burst; s8 src_width, dst_width, src_burst, dst_burst;
if (!config) if (!config)
return -EINVAL; return -EINVAL;
src_burst = convert_burst(config->src_maxburst); src_burst = convert_burst(config->src_maxburst);
if (src_burst) if (src_burst < 0)
return src_burst; return src_burst;
dst_burst = convert_burst(config->dst_maxburst); dst_burst = convert_burst(config->dst_maxburst);
if (dst_burst) if (dst_burst < 0)
return dst_burst; return dst_burst;
src_width = convert_buswidth(config->src_addr_width); src_width = convert_buswidth(config->src_addr_width);
if (src_width) if (src_width < 0)
return src_width; return src_width;
dst_width = convert_buswidth(config->dst_addr_width); dst_width = convert_buswidth(config->dst_addr_width);
if (dst_width) if (dst_width < 0)
return dst_width; return dst_width;
lli->cfg = DMA_CHAN_CFG_SRC_BURST(src_burst) | lli->cfg = DMA_CHAN_CFG_SRC_BURST(src_burst) |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment