Skip to content

Commit

Permalink
dmaengine: sun6i: Fix impossible settings of burst and bus width
Browse files Browse the repository at this point in the history
In the commit 1f9cd91 ("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: Maxime Ripard <[email protected]>
Signed-off-by: Jean-Francois Moine <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
  • Loading branch information
moinejf authored and Vinod Koul committed Apr 26, 2016
1 parent 128fe7e commit dc6a58c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/dma/sun6i-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,25 +281,25 @@ static inline int sun6i_dma_cfg_lli(struct sun6i_dma_lli *lli,
dma_addr_t dst, u32 len,
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)
return -EINVAL;

src_burst = convert_burst(config->src_maxburst);
if (src_burst)
if (src_burst < 0)
return src_burst;

dst_burst = convert_burst(config->dst_maxburst);
if (dst_burst)
if (dst_burst < 0)
return dst_burst;

src_width = convert_buswidth(config->src_addr_width);
if (src_width)
if (src_width < 0)
return src_width;

dst_width = convert_buswidth(config->dst_addr_width);
if (dst_width)
if (dst_width < 0)
return dst_width;

lli->cfg = DMA_CHAN_CFG_SRC_BURST(src_burst) |
Expand Down

0 comments on commit dc6a58c

Please sign in to comment.