linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mpa@pengutronix.de (Markus Pargmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 4/4] dma: mxs-dma: Update state after channel reset
Date: Fri,  4 Oct 2013 12:44:09 +0200	[thread overview]
Message-ID: <1380883449-8649-5-git-send-email-mpa@pengutronix.de> (raw)
In-Reply-To: <1380883449-8649-1-git-send-email-mpa@pengutronix.de>

After a channel reset, the channel stops running automatically. The
state update was missing so that a channel perperation right after a
channel reset failed.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
---
 drivers/dma/mxs-dma.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index 98de9a7..e284395 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -234,6 +234,8 @@ static void mxs_dma_reset_chan(struct mxs_dma_chan *mxs_chan)
 		writel(1 << (chan_id + BP_APBHX_CHANNEL_CTRL_RESET_CHANNEL),
 			mxs_dma->base + HW_APBHX_CHANNEL_CTRL + STMP_OFFSET_REG_SET);
 	}
+
+	mxs_chan->status = DMA_SUCCESS;
 }
 
 static void mxs_dma_enable_chan(struct mxs_dma_chan *mxs_chan)
@@ -361,7 +363,7 @@ static irqreturn_t mxs_dma_int_handler(int irq, void *dev_id)
 			chan);
 		mxs_chan->status = DMA_ERROR;
 		mxs_dma_reset_chan(mxs_chan);
-	} else {
+	} else if (mxs_chan->status != DMA_SUCCESS) {
 		if (mxs_chan->flags & MXS_DMA_SG_LOOP)
 			mxs_chan->status = DMA_IN_PROGRESS;
 		else
-- 
1.8.4.rc3

      parent reply	other threads:[~2013-10-04 10:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-04 10:44 [PATCH v3 0/4] dma: mxs-dma bugfixes and cleanup Markus Pargmann
2013-10-04 10:44 ` [PATCH v3 1/4] dma: mxs-dma: Cleanup interrupt handler Markus Pargmann
2013-10-04 10:44 ` [PATCH v3 2/4] dma: mxs-dma: Report correct residue for cyclic DMA Markus Pargmann
2013-10-04 10:44 ` [PATCH v3 3/4] dma: mxs-dma: Fix channel reset hardware bug Markus Pargmann
2013-10-04 10:44 ` Markus Pargmann [this message]

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=1380883449-8649-5-git-send-email-mpa@pengutronix.de \
    --to=mpa@pengutronix.de \
    --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 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).