Skip to contentSkip to conversation

dmaengine: add CSR SiRFprimaII DMAC driver

PATCH Superseded Barry Song 3 participants 10 messages Oct 18, 2011 – Oct 29, 2011 dmaengine

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Barry Song

author
#0 lore raw

PATCH v4 1/1 dmaengine: add CSR SiRFprimaII DMAC driver

From: Rongjun Ying <[email protected]>

Cc Jassi Brar <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Linus Walleij <[email protected]>

---
-v4:
add error handler in probe;
free resource in remove;
add necessary comments in source codes;
fix the mismatch of license between file head and MODULE_LINCENSE; define MACRO to replace magic number for xlen/dma_width boundary.

 MAINTAINERS                 |    1 +
 drivers/dma/Kconfig         |    7 +
 drivers/dma/Makefile        |    1 +
 drivers/dma/sirf-dma.c      |  708 +++++++++++++++++++++++++++++++++++++++++++
 include/linux/sirfsoc_dma.h |    6 +
 5 files changed, 723 insertions(+), 0 deletions(-)
 create mode 100644 drivers/dma/sirf-dma.c
 create mode 100644 include/linux/sirfsoc_dma.h
MAINTAINERS +1 -0
index 5483e0c..adcb6ce 100644
@@ -739,6 +739,7 @@ M:	Barry Song <[email protected]>
 L:	linux-arm-kernel at lists.infradead.org (moderated for non-subscribers)
 S:	Maintained
 F:	arch/arm/mach-prima2/
+F:	drivers/dma/sirf-dma*
 
 ARM/EBSA110 MACHINE SUPPORT
 M:	Russell King <[email protected]>
drivers/dma/Kconfig +7 -0
index 2e3b3d3..1341bcd 100644
@@ -187,6 +187,13 @@ config TIMB_DMA
 	help
 	  Enable support for the Timberdale FPGA DMA engine.
 
+config SIRF_DMA
+	tristate "CSR SiRFprimaII DMA support"
+	depends on ARCH_PRIMA2
+	select DMA_ENGINE
+	help
+	  Enable support for the CSR SiRFprimaII DMA engine.
+
 config ARCH_HAS_ASYNC_TX_FIND_CHANNEL
 	bool
 
drivers/dma/Makefile +1 -0
index 30cf3b1..009a222 100644
@@ -21,6 +21,7 @@ obj-$(CONFIG_IMX_SDMA) += imx-sdma.o
 obj-$(CONFIG_IMX_DMA) += imx-dma.o
 obj-$(CONFIG_MXS_DMA) += mxs-dma.o
 obj-$(CONFIG_TIMB_DMA) += timb_dma.o
+obj-$(CONFIG_SIRF_DMA) += sirf-dma.o
 obj-$(CONFIG_STE_DMA40) += ste_dma40.o ste_dma40_ll.o
 obj-$(CONFIG_PL330_DMA) += pl330.o
 obj-$(CONFIG_PCH_DMA) += pch_dma.o
drivers/dma/sirf-dma.c new file +708 -0

708 lines not on this page · raw message

include/linux/sirfsoc_dma.h new file +6 -0
new file mode 100644
index 0000000..29d9593
@@ -0,0 +1,6 @@
+#ifndef _SIRFSOC_DMA_H_
+#define _SIRFSOC_DMA_H_
+
+bool sirfsoc_dma_filter_id(struct dma_chan *chan, void *chan_id);
+
+#endif
Signature · 6 lines
1.7.1



Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog
#1 lore raw
Quoted 7 lines · Barry Song

From: Rongjun Ying <[email protected]>

Cc Jassi Brar <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Linus Walleij <[email protected]>
Quoted 7 lines

---
-v4:
add error handler in probe;
free resource in remove;
add necessary comments in source codes;
fix the mismatch of license between file head and MODULE_LINCENSE; define MACRO to replace magic number for xlen/dma_width boundary.

Barry,

You should _always_ run checkpatch before sending patches. It should have 0 errors.

ERROR: trailing whitespace
#773: FILE: drivers/dma/sirf-dma.c:649:
+^I$

Also there are bunch of 80char warning, see if you can reduce/eliminate them without sacrificing the code readability, and looking at them it seems possible

Also, Please ensure you send patches which compile with ZERO warnings:
drivers/dma/sirf-dma.c: In function 'sirfsoc_dma_probe':
drivers/dma/sirf-dma.c:616: warning: assignment from incompatible pointer type drivers/dma/sirf-dma.c:617: warning: assignment from incompatible pointer type which comes from the fact that your prep_interleaved_dma does not have last argument of flags.
On the second one you have not rebased to patch from Jassi which I applied after converting direction stuff.

Signature · 1 line
~Vinod
author
#2 lore raw
Quoted 25 lines

-----Original Message-----
From: linux-arm-kernel-bounces at lists.infradead.org [mailto:linux-arm-kernel-bounces at lists.infradead.org] On Behalf Of Vinod Koul
Sent: 2011?10?27? 16:19
To: Barry Song
Cc: Arnd Bergmann; Jassi Brar; Linus Walleij; linux-kernel at vger.kernel.org; DL-SHA-WorkGroupLinux; Rongjun Ying; Barry Song;
linux-arm-kernel at lists.infradead.org
Subject: Re: [PATCH v4] dmaengine: add CSR SiRFprimaII DMAC driver

Quoted 7 lines · Barry Song

From: Rongjun Ying <[email protected]>

Cc Jassi Brar <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Linus Walleij <[email protected]>
Quoted 7 lines

---
-v4:
add error handler in probe;
free resource in remove;
add necessary comments in source codes;
fix the mismatch of license between file head and MODULE_LINCENSE; define MACRO to replace magic number for xlen/dma_width boundary.

Quoted 8 lines

Barry,

You should _always_ run checkpatch before sending patches. It should have 0 errors.

ERROR: trailing whitespace
#773: FILE: drivers/dma/sirf-dma.c:649:
+^I$

Sorry for losing this one.

Quoted 6 lines

Also there are bunch of 80char warning, see if you can reduce/eliminate them without sacrificing the code readability, and looking at them it seems possible

Quoted 10 lines

Also, Please ensure you send patches which compile with ZERO warnings:
drivers/dma/sirf-dma.c: In function 'sirfsoc_dma_probe':
drivers/dma/sirf-dma.c:616: warning: assignment from incompatible pointer type
drivers/dma/sirf-dma.c:617: warning: assignment from incompatible pointer type
which comes from the fact that your prep_interleaved_dma does not have last argument of flags.
On the second one you have not rebased to patch from Jassi which I applied after converting direction stuff.

Ok. will do soon and send fix tomorrow. That should be ok to catch 3.2 merge window.

Quoted 4 lines

--
~Vinod

-barry

Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog

#3 lore raw
In reply to Vinod Koul
Quoted 15 lines · Vinod Koul
Quoted 7 lines · Barry Song

From: Rongjun Ying <[email protected]>

Cc Jassi Brar <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Linus Walleij <[email protected]>
Quoted 7 lines

---
-v4:
add error handler in probe;
free resource in remove;
add necessary comments in source codes;
fix the mismatch of license between file head and MODULE_LINCENSE; define MACRO to replace magic number for xlen/dma_width boundary.

Quoted 4 lines

Barry,

You should _always_ run checkpatch before sending patches. It should have 0 errors.

Not true.

Quoted 8 lines

ERROR: trailing whitespace
#773: FILE: drivers/dma/sirf-dma.c:649:
+^I$

Also there are bunch of 80char warning, see if you can reduce/eliminate them without sacrificing the code readability, and looking at them it seems possible

80char warnings about printks should be ignored, because breaking kernel messages across lines prevents them from being greppable. This (breaking kernel messages, particularly error messages, across multiple lines) is a topic Linus has frequently complained about.

#4 lore raw
Quoted 28 lines · Russell King - ARM Linux
Quoted 15 lines · Vinod Koul
Quoted 7 lines · Barry Song

From: Rongjun Ying <[email protected]>

Cc Jassi Brar <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Linus Walleij <[email protected]>
Quoted 7 lines

---
-v4:
add error handler in probe;
free resource in remove;
add necessary comments in source codes;
fix the mismatch of license between file head and MODULE_LINCENSE; define MACRO to replace magic number for xlen/dma_width boundary.

Quoted 4 lines

Barry,

You should _always_ run checkpatch before sending patches. It should have 0 errors.

Not true.

Quoted 5 lines

ERROR: trailing whitespace
#773: FILE: drivers/dma/sirf-dma.c:649:
+^I$

Quoted 8 lines
Quoted 3 lines

Also there are bunch of 80char warning, see if you can reduce/eliminate them without sacrificing the code readability, and looking at them it seems possible

80char warnings about printks should be ignored, because breaking kernel messages across lines prevents them from being greppable. This (breaking kernel messages, particularly error messages, across multiple lines) is a topic Linus has frequently complained about.

Sure, I wasn't complaining about printks, btw none of them were hit by printks.

These were mostly write_l exceeding 80chars, thats why my suggestion to see if they can be reduced/eliminated without sacrificing code readability

Signature · 1 line
~Vinod
author
#5 lore raw
In reply to Vinod Koul
Quoted 10 lines

Also, Please ensure you send patches which compile with ZERO warnings:
drivers/dma/sirf-dma.c: In function 'sirfsoc_dma_probe':
drivers/dma/sirf-dma.c:616: warning: assignment from incompatible pointer type
drivers/dma/sirf-dma.c:617: warning: assignment from incompatible pointer type
which comes from the fact that your prep_interleaved_dma does not have last argument of flags.
On the second one you have not rebased to patch from Jassi which I applied after converting direction stuff.

I rebased to both yours and Jassi by my merging manually. I remember you have changed the last param of device_prep_dma_cyclic from dma_data_direction to dma_transfer_direction. After checking the tree interleaved_dma @ git://git.infradead.org/users/vkoul/slave-dma.git, it doesn't. then make another compiling warning in sirfsoc_dma_prep_cyclic(). so I'll still use dma_data_direction in sirfsoc_dma_prep_cyclic().

Quoted 4 lines

--
~Vinod

-barry

Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog

#6 lore raw
Quoted 12 lines · Barry Song
Quoted 10 lines

Also, Please ensure you send patches which compile with ZERO warnings:
drivers/dma/sirf-dma.c: In function 'sirfsoc_dma_probe':
drivers/dma/sirf-dma.c:616: warning: assignment from incompatible pointer type
drivers/dma/sirf-dma.c:617: warning: assignment from incompatible pointer type
which comes from the fact that your prep_interleaved_dma does not have last argument of flags.
On the second one you have not rebased to patch from Jassi which I applied after converting direction stuff.

[pls wrap 80chars within paragraphs, i have reformatted below)

Quoted 7 lines

I rebased to both yours and Jassi by my merging manually. I remember you have changed the last param of device_prep_dma_cyclic from dma_data_direction to dma_transfer_direction. After checking the tree interleaved_dma @ git://git.infradead.org/users/vkoul/slave-dma.git,
it doesn't. then make another compiling warning in sirfsoc_dma_prep_cyclic(). so I'll still use dma_data_direction in sirfsoc_dma_prep_cyclic().

Yes for cyclic, I have missed to fix that. I will push the fixed version now

Signature · 1 line
~Vinod
author
#7 lore raw
Quoted 24 lines

-----Original Message-----
From: Vinod Koul [mailto:vinod.koul at intel.com]
Sent: 2011?10?28? 12:10
To: Barry Song
Cc: Arnd Bergmann; Jassi Brar; Linus Walleij; linux-kernel at vger.kernel.org; DL-SHA-WorkGroupLinux; Rongjun Ying; linux-arm-kernel at lists.infradead.org
Subject: RE: [PATCH v4] dmaengine: add CSR SiRFprimaII DMAC driver

Quoted 3 lines · Barry Song
Quoted 3 lines

Also, Please ensure you send patches which compile with ZERO warnings:
drivers/dma/sirf-dma.c: In function 'sirfsoc_dma_probe':
drivers/dma/sirf-dma.c:616: warning: assignment from incompatible

pointer

Quoted 2 lines
Quoted 2 lines

type
drivers/dma/sirf-dma.c:617: warning: assignment from incompatible

pointer

Quoted 7 lines
Quoted 5 lines

type
which comes from the fact that your prep_interleaved_dma does not have last argument of flags.
On the second one you have not rebased to patch from Jassi which I applied after converting direction stuff.

[pls wrap 80chars within paragraphs, i have reformatted below)

Quoted 8 lines
Quoted 7 lines

I rebased to both yours and Jassi by my merging manually. I remember you have changed the last param of device_prep_dma_cyclic from dma_data_direction to dma_transfer_direction. After checking the tree interleaved_dma @ git://git.infradead.org/users/vkoul/slave-dma.git,
it doesn't. then make another compiling warning in sirfsoc_dma_prep_cyclic(). so I'll still use dma_data_direction in sirfsoc_dma_prep_cyclic().

Yes for cyclic, I have missed to fix that. I will push the fixed version

Ok. note my v5 is still using dma_data_direction. You might take care too :-)

Quoted 4 lines

now

--
~Vinod

-barry

Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog

author Acked-by
#8 lore raw
In reply to Vinod Koul
Quoted 39 lines

-----Original Message-----
From: Barry Song
Sent: 2011?10?28? 13:04
To: 'Vinod Koul'
Cc: Arnd Bergmann; Jassi Brar; Linus Walleij; linux-kernel at vger.kernel.org; DL-SHA-WorkGroupLinux; Rongjun Ying; linux-arm-kernel at lists.infradead.org
Subject: RE: [PATCH v4] dmaengine: add CSR SiRFprimaII DMAC driver

Quoted 31 lines

-----Original Message-----
From: Vinod Koul [mailto:vinod.koul at intel.com]
Sent: 2011?10?28? 12:10
To: Barry Song
Cc: Arnd Bergmann; Jassi Brar; Linus Walleij; linux-kernel at vger.kernel.org; DL-SHA-WorkGroupLinux; Rongjun Ying; linux-arm-kernel at lists.infradead.org
Subject: RE: [PATCH v4] dmaengine: add CSR SiRFprimaII DMAC driver

Quoted 3 lines · Barry Song
Quoted 3 lines

Also, Please ensure you send patches which compile with ZERO warnings:
drivers/dma/sirf-dma.c: In function 'sirfsoc_dma_probe':
drivers/dma/sirf-dma.c:616: warning: assignment from incompatible

pointer

Quoted 2 lines
Quoted 2 lines

type
drivers/dma/sirf-dma.c:617: warning: assignment from incompatible

pointer

Quoted 7 lines
Quoted 5 lines

type
which comes from the fact that your prep_interleaved_dma does not have last argument of flags.
On the second one you have not rebased to patch from Jassi which I applied after converting direction stuff.

[pls wrap 80chars within paragraphs, i have reformatted below)

Quoted 7 lines

I rebased to both yours and Jassi by my merging manually. I remember you have changed the last param of device_prep_dma_cyclic from dma_data_direction to dma_transfer_direction. After checking the tree interleaved_dma @ git://git.infradead.org/users/vkoul/slave-dma.git,
it doesn't. then make another compiling warning in sirfsoc_dma_prep_cyclic(). so I'll still use dma_data_direction in sirfsoc_dma_prep_cyclic().

Quoted 3 lines
Quoted 1 line

Yes for cyclic, I have missed to fix that. I will push the fixed version

Ok. note my v5 is still using dma_data_direction. You might take care too :-)

Vinod, as I have acked interleaved dma API explicitly before, could you pls add:

in the commit of " DMAEngine: Define interleaved transfer request api" in your tree too. I didn't find it after I fetch your tree :-)

Quoted 5 lines
Quoted 5 lines

now

--
~Vinod

-barry

Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog

#9 lore raw
Quoted 5 lines · Barry Song

Vinod, as I have acked interleaved dma API explicitly before, could you pls add:

in the commit of " DMAEngine: Define interleaved transfer request api" in your tree too. I didn't find it after I fetch your tree :-)

Sorry I must have missed that.
Fixed now :)

Signature · 1 line
~Vinod