linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Ilya Yanok <yanok@emcraft.com>
To: linuxppc-dev@lists.ozlabs.org, wd@denx.de, dzu@denx.de, vlad@emcraft.com
Cc: Piotr Ziecik <kosmo@semihalf.com>, Ilya Yanok <yanok@emcraft.com>
Subject: [PATCH 2/3] mpc512x_dma: fix the hanged transfer issue
Date: Tue, 28 Sep 2010 14:24:55 +0200	[thread overview]
Message-ID: <1285676696-5358-3-git-send-email-yanok@emcraft.com> (raw)
In-Reply-To: <1285676696-5358-1-git-send-email-yanok@emcraft.com>

Current code clears interrupt active status _after_ submiting new
transfers. This leaves a possibility of clearing the interrupt for this
new transfer (if it is triggered fast enough) and thus lose this
interrupt. We want to clear interrupt active status _before_ new
transfers is submited and for current channel only.

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
Cc: Piotr Ziecik <kosmo@semihalf.com>
---
 drivers/dma/mpc512x_dma.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/dma/mpc512x_dma.c b/drivers/dma/mpc512x_dma.c
index 1bc04aa..0717527 100644
--- a/drivers/dma/mpc512x_dma.c
+++ b/drivers/dma/mpc512x_dma.c
@@ -276,6 +276,9 @@ static void mpc_dma_irq_process(struct mpc_dma *mdma, u32 is, u32 es, int off)
 
 		spin_lock(&mchan->lock);
 
+		out_8(&mdma->regs->dmacint, ch + off);
+		out_8(&mdma->regs->dmacerr, ch + off);
+
 		/* Check error status */
 		if (es & (1 << ch))
 			list_for_each_entry(mdesc, &mchan->active, node)
@@ -309,12 +312,6 @@ static irqreturn_t mpc_dma_irq(int irq, void *data)
 	mpc_dma_irq_process(mdma, in_be32(&mdma->regs->dmaintl),
 					in_be32(&mdma->regs->dmaerrl), 0);
 
-	/* Ack interrupt on all channels */
-	out_be32(&mdma->regs->dmainth, 0xFFFFFFFF);
-	out_be32(&mdma->regs->dmaintl, 0xFFFFFFFF);
-	out_be32(&mdma->regs->dmaerrh, 0xFFFFFFFF);
-	out_be32(&mdma->regs->dmaerrl, 0xFFFFFFFF);
-
 	/* Schedule tasklet */
 	tasklet_schedule(&mdma->tasklet);
 
-- 
1.7.2.3

  parent reply	other threads:[~2010-09-28 12:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-28 12:24 [RFC][PATCH 0/3] fixes and MPC8308 support for the mpc512x_dma driver Ilya Yanok
2010-09-28 12:24 ` [PATCH 1/3] mpc512x_dma: scatter/gather fix Ilya Yanok
2010-09-28 12:24 ` Ilya Yanok [this message]
2010-09-28 12:24 ` [PATCH 3/3] mpc512x_dma: add MPC8308 support Ilya Yanok
2010-09-28 13:09   ` Wolfgang Denk
2010-09-28 13:47     ` Ilya Yanok
2010-10-26 23:52 ` [REPOST] [PATCH 0/6] fixes and MPC8308 support for the mpc512x_dma driver Ilya Yanok
2010-10-27  7:24   ` Piotr Zięcik
2010-10-28  0:44     ` Ilya Yanok
2010-11-11 12:11   ` Wolfgang Denk
2010-10-26 23:52 ` [PATCH 1/6] mpc512x_dma: scatter/gather fix Ilya Yanok
2010-12-30  5:35   ` Grant Likely
2010-10-26 23:52 ` [PATCH 2/6] mpc512x_dma: fix the hanged transfer issue Ilya Yanok
2010-12-30  5:36   ` Grant Likely
2010-10-26 23:52 ` [PATCH 3/6] mpc512x_dma: add MPC8308 support Ilya Yanok
2010-12-30  5:35   ` Grant Likely
2010-10-26 23:52 ` [PATCH 4/6] mpc512x_dma: try to free descriptors in case of allocation failure Ilya Yanok
2010-12-30  5:36   ` Grant Likely
2010-10-26 23:52 ` [PATCH 5/6] MPC8308RDB: add DMA controller device-tree node Ilya Yanok
2010-12-30  5:36   ` Grant Likely
2010-10-26 23:53 ` [PATCH 6/6] mpc8308_p1m: " Ilya Yanok
2010-12-30  5:35   ` Grant Likely

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=1285676696-5358-3-git-send-email-yanok@emcraft.com \
    --to=yanok@emcraft.com \
    --cc=dzu@denx.de \
    --cc=kosmo@semihalf.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=vlad@emcraft.com \
    --cc=wd@denx.de \
    /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).