All of lore.kernel.org
 help / color / mirror / Atom feed
From: moinejf@free.fr (Jean-Francois Moine)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/5] dmaengine: sun6i: Fix impossible settings of burst and bus width
Date: Fri, 11 Mar 2016 11:55:54 +0100	[thread overview]
Message-ID: <8b05ebb302962a3009a357ea5f2ad7f245190e72.1457695169.git.moinejf@free.fr> (raw)
In-Reply-To: <cover.1457695169.git.moinejf@free.fr>

In the commit 1f9cd915b64bb95f (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.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
---
 drivers/dma/sun6i-dma.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c
index 2ec320d..3579ee7 100644
--- a/drivers/dma/sun6i-dma.c
+++ b/drivers/dma/sun6i-dma.c
@@ -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) |
-- 
2.7.3

  parent reply	other threads:[~2016-03-11 10:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-11 11:19 [PATCH v2 0/5] dmaengine: sun6i: Fixes and upgrade for audio transfers Jean-Francois Moine
2016-03-11 10:52 ` [PATCH v2 1/5] dmaengine: sun6i: Fix the access of the IRQ register Jean-Francois Moine
2016-03-11 10:55 ` Jean-Francois Moine [this message]
2016-03-11 11:01 ` [PATCH v2 3/5] dmaengine: sun6i: Add 4 as a possible burst value Jean-Francois Moine
2016-03-11 12:06   ` Maxime Ripard
2016-03-11 16:28     ` Jean-Francois Moine
2016-03-18 15:09       ` Maxime Ripard
2016-03-18 16:54         ` Jean-Francois Moine
2016-03-11 11:06 ` [PATCH v2 4/5] dmaengine: sun6i: Set system values to memory burst and bus width Jean-Francois Moine
2016-03-11 11:15 ` [PATCH v2 5/5] dmaengine: sun6i: Add cyclic capability Jean-Francois Moine

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=8b05ebb302962a3009a357ea5f2ad7f245190e72.1457695169.git.moinejf@free.fr \
    --to=moinejf@free.fr \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.