From: Stefan Agner <stefan@agner.ch>
To: vinod.koul@intel.com
Cc: jingchang.lu@freescale.com, dan.j.williams@intel.com,
dmaengine@vger.kernel.org, shawn.guo@linaro.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, kernel@pengutronix.de,
Stefan Agner <stefan@agner.ch>
Subject: [PATCH] dmaengine: fsl-edma: fix calculation of remaining bytes
Date: Thu, 13 Nov 2014 12:56:02 +0100 [thread overview]
Message-ID: <1415879762-12177-1-git-send-email-stefan@agner.ch> (raw)
If the current transfer control descriptor (TCD) was not yet started,
the address will be the same as the initial address. Hence test if the
current address is less than or equal to the start address of each TCD.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
This bug was discovered during development on a AC97 capable SAI driver,
I don't think that this is currently a issue since only a few drivers
use DMA on Vybrid so far and don't use the remaining bytes information.
drivers/dma/fsl-edma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma/fsl-edma.c b/drivers/dma/fsl-edma.c
index 3c5711d..58c6fc7 100644
--- a/drivers/dma/fsl-edma.c
+++ b/drivers/dma/fsl-edma.c
@@ -386,7 +386,7 @@ static size_t fsl_edma_desc_residue(struct fsl_edma_chan *fsl_chan,
&(edesc->tcd[i].vtcd->daddr));
len -= size;
- if (cur_addr > dma_addr && cur_addr < dma_addr + size) {
+ if (cur_addr >= dma_addr && cur_addr < dma_addr + size) {
len += dma_addr + size - cur_addr;
break;
}
--
2.1.3
next reply other threads:[~2014-11-13 11:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-13 11:56 Stefan Agner [this message]
2014-12-02 16:53 ` Stefan Agner
2014-12-08 13:14 ` Vinod Koul
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=1415879762-12177-1-git-send-email-stefan@agner.ch \
--to=stefan@agner.ch \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=jingchang.lu@freescale.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shawn.guo@linaro.org \
--cc=vinod.koul@intel.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
all inboxes | Powered by JetHome®