linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND][PATCH 0/2] mxs-dma: Bugfixes for mxs-dma originally sent in April
       [not found] <dc6791e4e926902967a182107d4558d5e0a16381.1303373126.git.LW@KARO-electronics.de>
@ 2011-08-08 12:47 ` Lothar Waßmann
  2011-08-08 12:47   ` [RESEND][PATCH 1/2] mxs-dma: Add missing end of list marker for platform_id table Lothar Waßmann
  2011-08-08 14:17   ` [RESEND][PATCH 0/2] mxs-dma: Bugfixes for mxs-dma originally sent in April Koul, Vinod
  0 siblings, 2 replies; 6+ messages in thread
From: Lothar Waßmann @ 2011-08-08 12:47 UTC (permalink / raw)
  To: Vinod Koul, Dan Williams, linux-kernel, shawn.guo, u.kleine-koenig


Hi,

I'm resending two bugfixes for the mxs-dma driver, that I had
originally sent in April which were acked by Shawn Guo and Uwe
Kleine-König, but obviously were not picked up by any maintainer.


Best regards,
Lothar Waßmann
---
 drivers/dma/mxs-dma.c |    3 ++-
 drivers/dma/mxs-dma.c |   45 ++++++++++++++++++++++++---------------------
 2 files changed, 26 insertions(+), 22 deletions(-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [RESEND][PATCH 1/2] mxs-dma: Add missing end of list marker for platform_id table
  2011-08-08 12:47 ` [RESEND][PATCH 0/2] mxs-dma: Bugfixes for mxs-dma originally sent in April Lothar Waßmann
@ 2011-08-08 12:47   ` Lothar Waßmann
  2011-08-08 12:47     ` [RESEND][PATCH 2/2] mxs-dma: enable CLKGATE before accessing registers Lothar Waßmann
  2011-08-08 14:17   ` [RESEND][PATCH 0/2] mxs-dma: Bugfixes for mxs-dma originally sent in April Koul, Vinod
  1 sibling, 1 reply; 6+ messages in thread
From: Lothar Waßmann @ 2011-08-08 12:47 UTC (permalink / raw)
  To: Vinod Koul, Dan Williams, linux-kernel, shawn.guo, u.kleine-koenig
  Cc: Lothar Waßmann


Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
 drivers/dma/mxs-dma.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index 88aad4f..f2ddcbd 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -707,7 +707,8 @@ static struct platform_device_id mxs_dma_type[] = {
 	}, {
 		.name = "mxs-dma-apbx",
 		.driver_data = MXS_DMA_APBX,
-	}
+	},
+	{ /* end of list marker */ }
 };
 
 static struct platform_driver mxs_dma_driver = {
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [RESEND][PATCH 2/2] mxs-dma: enable CLKGATE before accessing registers
  2011-08-08 12:47   ` [RESEND][PATCH 1/2] mxs-dma: Add missing end of list marker for platform_id table Lothar Waßmann
@ 2011-08-08 12:47     ` Lothar Waßmann
  0 siblings, 0 replies; 6+ messages in thread
From: Lothar Waßmann @ 2011-08-08 12:47 UTC (permalink / raw)
  To: Vinod Koul, Dan Williams, linux-kernel, shawn.guo, u.kleine-koenig
  Cc: Lothar Waßmann

After calling mxs_dma_disable_chan() for a channel, that channel
becomes unusable because some controller registers can only be written
when the clock is enabled via CLKGATE.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
 drivers/dma/mxs-dma.c |   45 ++++++++++++++++++++++++---------------------
 1 files changed, 24 insertions(+), 21 deletions(-)

diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index f2ddcbd..7deab8a 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -130,6 +130,23 @@ struct mxs_dma_engine {
 	struct mxs_dma_chan		mxs_chans[MXS_DMA_CHANNELS];
 };
 
+static inline void mxs_dma_clkgate(struct mxs_dma_chan *mxs_chan, int enable)
+{
+	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
+	int chan_id = mxs_chan->chan.chan_id;
+	int set_clr = enable ? MXS_CLR_ADDR : MXS_SET_ADDR;
+
+	/* enable apbh channel clock */
+	if (dma_is_apbh()) {
+		if (apbh_is_old())
+			writel(1 << (chan_id + BP_APBH_CTRL0_CLKGATE_CHANNEL),
+				mxs_dma->base + HW_APBHX_CTRL0 + set_clr);
+		else
+			writel(1 << chan_id,
+				mxs_dma->base + HW_APBHX_CTRL0 + set_clr);
+	}
+}
+
 static void mxs_dma_reset_chan(struct mxs_dma_chan *mxs_chan)
 {
 	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
@@ -148,38 +165,21 @@ static void mxs_dma_enable_chan(struct mxs_dma_chan *mxs_chan)
 	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
 	int chan_id = mxs_chan->chan.chan_id;
 
+	/* clkgate needs to be enabled before writing other registers */
+	mxs_dma_clkgate(mxs_chan, 1);
+
 	/* set cmd_addr up */
 	writel(mxs_chan->ccw_phys,
 		mxs_dma->base + HW_APBHX_CHn_NXTCMDAR(chan_id));
 
-	/* enable apbh channel clock */
-	if (dma_is_apbh()) {
-		if (apbh_is_old())
-			writel(1 << (chan_id + BP_APBH_CTRL0_CLKGATE_CHANNEL),
-				mxs_dma->base + HW_APBHX_CTRL0 + MXS_CLR_ADDR);
-		else
-			writel(1 << chan_id,
-				mxs_dma->base + HW_APBHX_CTRL0 + MXS_CLR_ADDR);
-	}
-
 	/* write 1 to SEMA to kick off the channel */
 	writel(1, mxs_dma->base + HW_APBHX_CHn_SEMA(chan_id));
 }
 
 static void mxs_dma_disable_chan(struct mxs_dma_chan *mxs_chan)
 {
-	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
-	int chan_id = mxs_chan->chan.chan_id;
-
 	/* disable apbh channel clock */
-	if (dma_is_apbh()) {
-		if (apbh_is_old())
-			writel(1 << (chan_id + BP_APBH_CTRL0_CLKGATE_CHANNEL),
-				mxs_dma->base + HW_APBHX_CTRL0 + MXS_SET_ADDR);
-		else
-			writel(1 << chan_id,
-				mxs_dma->base + HW_APBHX_CTRL0 + MXS_SET_ADDR);
-	}
+	mxs_dma_clkgate(mxs_chan, 0);
 
 	mxs_chan->status = DMA_SUCCESS;
 }
@@ -336,7 +336,10 @@ static int mxs_dma_alloc_chan_resources(struct dma_chan *chan)
 	if (ret)
 		goto err_clk;
 
+	/* clkgate needs to be enabled for reset to finish */
+	mxs_dma_clkgate(mxs_chan, 1);
 	mxs_dma_reset_chan(mxs_chan);
+	mxs_dma_clkgate(mxs_chan, 0);
 
 	dma_async_tx_descriptor_init(&mxs_chan->desc, chan);
 	mxs_chan->desc.tx_submit = mxs_dma_tx_submit;
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [RESEND][PATCH 0/2] mxs-dma: Bugfixes for mxs-dma originally sent in April
  2011-08-08 12:47 ` [RESEND][PATCH 0/2] mxs-dma: Bugfixes for mxs-dma originally sent in April Lothar Waßmann
  2011-08-08 12:47   ` [RESEND][PATCH 1/2] mxs-dma: Add missing end of list marker for platform_id table Lothar Waßmann
@ 2011-08-08 14:17   ` Koul, Vinod
  2011-08-08 16:25     ` Uwe Kleine-König
  1 sibling, 1 reply; 6+ messages in thread
From: Koul, Vinod @ 2011-08-08 14:17 UTC (permalink / raw)
  To: Lothar Waßmann
  Cc: Dan Williams, linux-kernel, shawn.guo, u.kleine-koenig

On Mon, 2011-08-08 at 14:47 +0200, Lothar Waßmann wrote:
> Hi,
> 
> I'm resending two bugfixes for the mxs-dma driver, that I had
> originally sent in April which were acked by Shawn Guo and Uwe
> Kleine-König, but obviously were not picked up by any maintainer.
Sorry about that, in case you received ack on same patch you can carry
them when you resend.

Shawn, Uwe Kleine-König pls send your acks again, I will apply these

> 
> 
> Best regards,
> Lothar Waßmann
> ---
>  drivers/dma/mxs-dma.c |    3 ++-
>  drivers/dma/mxs-dma.c |   45 ++++++++++++++++++++++++---------------------
>  2 files changed, 26 insertions(+), 22 deletions(-)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


-- 
~Vinod


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RESEND][PATCH 0/2] mxs-dma: Bugfixes for mxs-dma originally sent in April
  2011-08-08 14:17   ` [RESEND][PATCH 0/2] mxs-dma: Bugfixes for mxs-dma originally sent in April Koul, Vinod
@ 2011-08-08 16:25     ` Uwe Kleine-König
  2011-08-16 13:12       ` Koul, Vinod
  0 siblings, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2011-08-08 16:25 UTC (permalink / raw)
  To: Koul, Vinod; +Cc: Lothar Waßmann, Dan Williams, linux-kernel, shawn.guo

On Mon, Aug 08, 2011 at 07:47:19PM +0530, Koul, Vinod wrote:
> On Mon, 2011-08-08 at 14:47 +0200, Lothar Waßmann wrote:
> > Hi,
> > 
> > I'm resending two bugfixes for the mxs-dma driver, that I had
> > originally sent in April which were acked by Shawn Guo and Uwe
> > Kleine-König, but obviously were not picked up by any maintainer.
> Sorry about that, in case you received ack on same patch you can carry
> them when you resend.
> 
> Shawn, Uwe Kleine-König pls send your acks again, I will apply these
I'm sure I acked patch 1 and didn't look deeply into patch 2.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RESEND][PATCH 0/2] mxs-dma: Bugfixes for mxs-dma originally sent in April
  2011-08-08 16:25     ` Uwe Kleine-König
@ 2011-08-16 13:12       ` Koul, Vinod
  0 siblings, 0 replies; 6+ messages in thread
From: Koul, Vinod @ 2011-08-16 13:12 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Lothar Waßmann, Dan Williams, linux-kernel, shawn.guo

On Mon, 2011-08-08 at 18:25 +0200, Uwe Kleine-König wrote:
> On Mon, Aug 08, 2011 at 07:47:19PM +0530, Koul, Vinod wrote:
> > On Mon, 2011-08-08 at 14:47 +0200, Lothar Waßmann wrote:
> > > Hi,
> > > 
> > > I'm resending two bugfixes for the mxs-dma driver, that I had
> > > originally sent in April which were acked by Shawn Guo and Uwe
> > > Kleine-König, but obviously were not picked up by any maintainer.
> > Sorry about that, in case you received ack on same patch you can carry
> > them when you resend.
> > 
> > Shawn, Uwe Kleine-König pls send your acks again, I will apply these
> I'm sure I acked patch 1 and didn't look deeply into patch 2.

I have applied the patch 2/2. The patch 1/2 was no longer required as
its same as patch by Axel

commit 2a9778ed83b142e88cb38acc496a573a3472d27f
Author: Axel Lin <axel.lin@gmail.com>
Date:   Tue Jul 12 18:53:52 2011 +0800

    dma: mxs-dma: fix unterminated platform_device_id table
    
    Signed-off-by: Axel Lin <axel.lin@gmail.com>
    Signed-off-by: Vinod Koul <vinod.koul@intel.com>



-- 
~Vinod


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-08-16 13:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <dc6791e4e926902967a182107d4558d5e0a16381.1303373126.git.LW@KARO-electronics.de>
2011-08-08 12:47 ` [RESEND][PATCH 0/2] mxs-dma: Bugfixes for mxs-dma originally sent in April Lothar Waßmann
2011-08-08 12:47   ` [RESEND][PATCH 1/2] mxs-dma: Add missing end of list marker for platform_id table Lothar Waßmann
2011-08-08 12:47     ` [RESEND][PATCH 2/2] mxs-dma: enable CLKGATE before accessing registers Lothar Waßmann
2011-08-08 14:17   ` [RESEND][PATCH 0/2] mxs-dma: Bugfixes for mxs-dma originally sent in April Koul, Vinod
2011-08-08 16:25     ` Uwe Kleine-König
2011-08-16 13:12       ` Koul, Vinod

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).