linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fsldma: Split the MPC83xx event from MPC85xx and refine irq codes.
@ 2008-03-26  7:42 Zhang Wei
  2008-03-26  7:42 ` [PATCH] fsldma: The MPC8377MDS board device tree node for fsldma driver Zhang Wei
  0 siblings, 1 reply; 7+ messages in thread
From: Zhang Wei @ 2008-03-26  7:42 UTC (permalink / raw)
  To: dan.j.williams; +Cc: linux-kernel, Zhang Wei

Split MPC83xx EOCDI event from MPC85xx EOLNI event, which is
also need to update cookie and start the next transfer.
The DMA channel irq handler function code is refined.
The patch is tested on MPC8377MDS board.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
---
 drivers/dma/fsldma.c |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index 07de0cf..b5a9d79 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -696,6 +696,8 @@ static irqreturn_t fsl_dma_chan_do_interrupt(int irq, void *data)
 {
 	struct fsl_dma_chan *fsl_chan = (struct fsl_dma_chan *)data;
 	u32 stat;
+	int update_cookie = 0;
+	int xfer_ld_q = 0;
 
 	stat = get_sr(fsl_chan);
 	dev_dbg(fsl_chan->dev, "event: channel %d, stat = 0x%x\n",
@@ -720,8 +722,8 @@ static irqreturn_t fsl_dma_chan_do_interrupt(int irq, void *data)
 			 * Now, update the completed cookie, and continue the
 			 * next uncompleted transfer.
 			 */
-			fsl_dma_update_completed_cookie(fsl_chan);
-			fsl_chan_xfer_ld_queue(fsl_chan);
+			update_cookie = 1;
+			xfer_ld_q = 1;
 		}
 		stat &= ~FSL_DMA_SR_PE;
 	}
@@ -734,19 +736,33 @@ static irqreturn_t fsl_dma_chan_do_interrupt(int irq, void *data)
 		dev_dbg(fsl_chan->dev, "event: clndar %p, nlndar %p\n",
 			(void *)get_cdar(fsl_chan), (void *)get_ndar(fsl_chan));
 		stat &= ~FSL_DMA_SR_EOSI;
-		fsl_dma_update_completed_cookie(fsl_chan);
+		update_cookie = 1;
+	}
+
+	/* For MPC8349, EOCDI event need to update cookie
+	 * and start the next transfer if it exist.
+	 */
+	if (stat & FSL_DMA_SR_EOCDI) {
+		dev_dbg(fsl_chan->dev, "event: End-of-Chain link INT\n");
+		stat &= ~FSL_DMA_SR_EOCDI;
+		update_cookie = 1;
+		xfer_ld_q = 1;
 	}
 
 	/* If it current transfer is the end-of-transfer,
 	 * we should clear the Channel Start bit for
 	 * prepare next transfer.
 	 */
-	if (stat & (FSL_DMA_SR_EOLNI | FSL_DMA_SR_EOCDI)) {
+	if (stat & FSL_DMA_SR_EOLNI) {
 		dev_dbg(fsl_chan->dev, "event: End-of-link INT\n");
 		stat &= ~FSL_DMA_SR_EOLNI;
-		fsl_chan_xfer_ld_queue(fsl_chan);
+		xfer_ld_q = 1;
 	}
 
+	if (update_cookie)
+		fsl_dma_update_completed_cookie(fsl_chan);
+	if (xfer_ld_q)
+		fsl_chan_xfer_ld_queue(fsl_chan);
 	if (stat)
 		dev_dbg(fsl_chan->dev, "event: unhandled sr 0x%02x\n",
 					stat);
-- 
1.5.4


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

* [PATCH] fsldma: The MPC8377MDS board device tree node for fsldma driver
  2008-03-26  7:42 [PATCH] fsldma: Split the MPC83xx event from MPC85xx and refine irq codes Zhang Wei
@ 2008-03-26  7:42 ` Zhang Wei
  2008-03-27 19:37   ` Dan Williams
  0 siblings, 1 reply; 7+ messages in thread
From: Zhang Wei @ 2008-03-26  7:42 UTC (permalink / raw)
  To: dan.j.williams; +Cc: linux-kernel, Zhang Wei

The fsldma driver is tested on MPC8377MDS board.
The patch adds fsldma driver support into MPC8377MDS device tree.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
---
 arch/powerpc/boot/dts/mpc8377_mds.dts |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc8377_mds.dts b/arch/powerpc/boot/dts/mpc8377_mds.dts
index 49c05e9..ba5312e 100644
--- a/arch/powerpc/boot/dts/mpc8377_mds.dts
+++ b/arch/powerpc/boot/dts/mpc8377_mds.dts
@@ -268,6 +268,33 @@
 			interrupt-parent = <&ipic>;
 		};
 
+		dma@82a8 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			compatible = "fsl,mpc8349-dma";
+			reg = <0x82a8 4>;
+			ranges = <0 0x8100 0x1a8>;
+			interrupt-parent = <&ipic>;
+			interrupts = <0x47 8>;
+			cell-index = <0>;
+			dma-channel@0 {
+				compatible = "fsl,mpc8349-dma-channel";
+				reg = <0 0x80>;
+			};
+			dma-channel@80 {
+				compatible = "fsl,mpc8349-dma-channel";
+				reg = <0x80 0x80>;
+			};
+			dma-channel@100 {
+				compatible = "fsl,mpc8349-dma-channel";
+				reg = <0x100 0x80>;
+			};
+			dma-channel@180 {
+				compatible = "fsl,mpc8349-dma-channel";
+				reg = <0x180 0x28>;
+			};
+		};
+
 		/* IPIC
 		 * interrupts cell = <intr #, sense>
 		 * sense values match linux IORESOURCE_IRQ_* defines:
-- 
1.5.4


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

* Re: [PATCH] fsldma: The MPC8377MDS board device tree node for fsldma driver
  2008-03-26  7:42 ` [PATCH] fsldma: The MPC8377MDS board device tree node for fsldma driver Zhang Wei
@ 2008-03-27 19:37   ` Dan Williams
  2008-03-28  2:10     ` Zhang Wei
  2008-03-28  2:23     ` Kumar Gala
  0 siblings, 2 replies; 7+ messages in thread
From: Dan Williams @ 2008-03-27 19:37 UTC (permalink / raw)
  To: Zhang Wei, Andrew Morton; +Cc: Linux Kernel, Kumar Gala, linuxppc-dev

On Wed, Mar 26, 2008 at 12:42 AM, Zhang Wei <wei.zhang@freescale.com> wrote:
> The fsldma driver is tested on MPC8377MDS board.
>  The patch adds fsldma driver support into MPC8377MDS device tree.
>
>  Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
>  ---
>   arch/powerpc/boot/dts/mpc8377_mds.dts |   27 +++++++++++++++++++++++++++
>   1 files changed, 27 insertions(+), 0 deletions(-)

I think this patch should probably go through the powerpc tree, or
-mm.  I'll pick up the ones that touch either drivers/dma or
crypto/async_tx.

--
Dan

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

* RE: [PATCH] fsldma: The MPC8377MDS board device tree node for fsldma driver
  2008-03-27 19:37   ` Dan Williams
@ 2008-03-28  2:10     ` Zhang Wei
  2008-03-28  2:23     ` Kumar Gala
  1 sibling, 0 replies; 7+ messages in thread
From: Zhang Wei @ 2008-03-28  2:10 UTC (permalink / raw)
  To: Dan Williams, Andrew Morton; +Cc: Linux Kernel, Kumar Gala, linuxppc-dev

Hi, Dan,

Sure. The patch can be just a reference to how to config and enable the fsldma driver in dts file on MPC83xx boards.

Thanks!
Wei.

> -----Original Message-----
> From: dan.j.williams@gmail.com 
> [mailto:dan.j.williams@gmail.com] On Behalf Of Dan Williams
> Sent: Friday, March 28, 2008 3:38 AM
> To: Zhang Wei; Andrew Morton
> Cc: Linux Kernel; Kumar Gala; linuxppc-dev@ozlabs.org
> Subject: Re: [PATCH] fsldma: The MPC8377MDS board device tree 
> node for fsldma driver
> 
> On Wed, Mar 26, 2008 at 12:42 AM, Zhang Wei 
> <wei.zhang@freescale.com> wrote:
> > The fsldma driver is tested on MPC8377MDS board.
> >  The patch adds fsldma driver support into MPC8377MDS device tree.
> >
> >  Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
> >  ---
> >   arch/powerpc/boot/dts/mpc8377_mds.dts |   27 
> +++++++++++++++++++++++++++
> >   1 files changed, 27 insertions(+), 0 deletions(-)
> 
> I think this patch should probably go through the powerpc tree, or
> -mm.  I'll pick up the ones that touch either drivers/dma or
> crypto/async_tx.
> 
> --
> Dan
> 

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

* Re: [PATCH] fsldma: The MPC8377MDS board device tree node for fsldma driver
  2008-03-27 19:37   ` Dan Williams
  2008-03-28  2:10     ` Zhang Wei
@ 2008-03-28  2:23     ` Kumar Gala
  2008-03-28  2:25       ` Zhang Wei
  2008-03-28  4:31       ` Olof Johansson
  1 sibling, 2 replies; 7+ messages in thread
From: Kumar Gala @ 2008-03-28  2:23 UTC (permalink / raw)
  To: Dan Williams; +Cc: Zhang Wei, Andrew Morton, Linux Kernel, linuxppc-dev


On Mar 27, 2008, at 2:37 PM, Dan Williams wrote:
> On Wed, Mar 26, 2008 at 12:42 AM, Zhang Wei  
> <wei.zhang@freescale.com> wrote:
>> The fsldma driver is tested on MPC8377MDS board.
>> The patch adds fsldma driver support into MPC8377MDS device tree.
>>
>> Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
>> ---
>>  arch/powerpc/boot/dts/mpc8377_mds.dts |   27 ++++++++++++++++++++++ 
>> +++++
>>  1 files changed, 27 insertions(+), 0 deletions(-)
>
> I think this patch should probably go through the powerpc tree, or
> -mm.  I'll pick up the ones that touch either drivers/dma or
> crypto/async_tx.

Can you resend and CC me.  I'll pick it up and push through via the  
powerpc tree.

I want to make one update to the driver to support the "proper" names  
we document for compatible properties.

(uugh too many things to do)

- k

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

* RE: [PATCH] fsldma: The MPC8377MDS board device tree node for fsldma driver
  2008-03-28  2:23     ` Kumar Gala
@ 2008-03-28  2:25       ` Zhang Wei
  2008-03-28  4:31       ` Olof Johansson
  1 sibling, 0 replies; 7+ messages in thread
From: Zhang Wei @ 2008-03-28  2:25 UTC (permalink / raw)
  To: Kumar Gala, Dan Williams; +Cc: Andrew Morton, Linux Kernel, linuxppc-dev

I'll send it to to. 

> -----Original Message-----
> From: Kumar Gala [mailto:galak@kernel.crashing.org] 
> Sent: Friday, March 28, 2008 10:24 AM
> To: Dan Williams
> Cc: Zhang Wei; Andrew Morton; Linux Kernel; linuxppc-dev@ozlabs.org
> Subject: Re: [PATCH] fsldma: The MPC8377MDS board device tree 
> node for fsldma driver
> 
> 
> On Mar 27, 2008, at 2:37 PM, Dan Williams wrote:
> > On Wed, Mar 26, 2008 at 12:42 AM, Zhang Wei  
> > <wei.zhang@freescale.com> wrote:
> >> The fsldma driver is tested on MPC8377MDS board.
> >> The patch adds fsldma driver support into MPC8377MDS device tree.
> >>
> >> Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
> >> ---
> >>  arch/powerpc/boot/dts/mpc8377_mds.dts |   27 
> ++++++++++++++++++++++ 
> >> +++++
> >>  1 files changed, 27 insertions(+), 0 deletions(-)
> >
> > I think this patch should probably go through the powerpc tree, or
> > -mm.  I'll pick up the ones that touch either drivers/dma or
> > crypto/async_tx.
> 
> Can you resend and CC me.  I'll pick it up and push through via the  
> powerpc tree.
> 
> I want to make one update to the driver to support the 
> "proper" names  
> we document for compatible properties.
> 
> (uugh too many things to do)
> 
> - k
> 

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

* Re: [PATCH] fsldma: The MPC8377MDS board device tree node for fsldma driver
  2008-03-28  2:23     ` Kumar Gala
  2008-03-28  2:25       ` Zhang Wei
@ 2008-03-28  4:31       ` Olof Johansson
  1 sibling, 0 replies; 7+ messages in thread
From: Olof Johansson @ 2008-03-28  4:31 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Dan Williams, linuxppc-dev, Andrew Morton, Linux Kernel

On Thu, Mar 27, 2008 at 09:23:54PM -0500, Kumar Gala wrote:

>> I think this patch should probably go through the powerpc tree, or
>> -mm.  I'll pick up the ones that touch either drivers/dma or
>> crypto/async_tx.

It's a good idea to cc all fsldma patches to linuxppc-dev when they're
posted too, none of them have been so they have been missing review from
the powerpc crowd that didn't catch them on lkml.


-Olof

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

end of thread, other threads:[~2008-03-28  4:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-26  7:42 [PATCH] fsldma: Split the MPC83xx event from MPC85xx and refine irq codes Zhang Wei
2008-03-26  7:42 ` [PATCH] fsldma: The MPC8377MDS board device tree node for fsldma driver Zhang Wei
2008-03-27 19:37   ` Dan Williams
2008-03-28  2:10     ` Zhang Wei
2008-03-28  2:23     ` Kumar Gala
2008-03-28  2:25       ` Zhang Wei
2008-03-28  4:31       ` Olof Johansson

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