Skip to contentSkip to conversation

dma: of: Move the functions under CONFIG_OF_DMA instead of CONFIG_OF

PATCH New Santosh Shilimkar 2 participants 8 messages Feb 28, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dma: of: Move the functions under CONFIG_OF_DMA instead of CONFIG_OF

The of-dma.c is compiled out with !CONFIG_OF_DMA but the functions in the header are kept under CONFIG_OF. Move them under CONFIG_OF_DMA to avoid build errors with CONFIG_OFF && !CONFIG_OF_DMA

---
 include/linux/of_dma.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/of_dma.h +1 -1
index 0322363..3d2beab 100644
@@ -31,7 +31,7 @@ struct of_dma_filter_info {
 	dma_filter_fn	filter_fn;
 };
 
-#ifdef CONFIG_OF
+#ifdef CONFIG_OF_DMA
 extern int of_dma_controller_register(struct device_node *np,
 		struct dma_chan *(*of_dma_xlate)
 		(struct of_phandle_args *, struct of_dma *),
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 dma: of: Move the functions under CONFIG_OF_DMA instead of CONFIG_OF

Quoted 16 lines · Santosh Shilimkar

The of-dma.c is compiled out with !CONFIG_OF_DMA but the functions in the header are kept under CONFIG_OF. Move them under CONFIG_OF_DMA to avoid build errors with CONFIG_OFF && !CONFIG_OF_DMA

---
 include/linux/of_dma.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/of_dma.h +0 -0
index 0322363..3d2beab 100644

include/linux/of_dma.h struct of_dma_filter_info { · line 34

Quoted 5 lines
include/linux/of_dma.h +1 -1
@@ -31,7 +31,7 @@ struct of_dma_filter_info {
 	dma_filter_fn	filter_fn;
 };
 
-#ifdef CONFIG_OF
+#ifdef CONFIG_OF_DMA

Sorry.. Typo here.. Should have been CONFIG_DMA_OF

Quoted 1 line

From 31242461b6ba5e8c0c5ee26e394fa4cab61e3aa1 Mon Sep 17 00:00:00 2001

From: Santosh Shilimkar <[email protected]>
Date: Thu, 27 Feb 2014 19:13:36 -0500
Subject: [PATCH] dma: of: Move the functions under CONFIG_DMA_OF instead of
CONFIG_OF

The of-dma.c is compiled out with !CONFIG_DMA_OF but the functions in the header are kept under CONFIG_OF. Move them under CONFIG_OF_DMA to avoid build errors with CONFIG_OFF && !CONFIG_DMA_OF

---
 include/linux/of_dma.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/of_dma.h +1 -1
index 0322363..0ea24f4 100644
@@ -31,7 +31,7 @@ struct of_dma_filter_info {
 	dma_filter_fn	filter_fn;
 };
 
-#ifdef CONFIG_OF
+#ifdef CONFIG_DMA_OF
 extern int of_dma_controller_register(struct device_node *np,
 		struct dma_chan *(*of_dma_xlate)
 		(struct of_phandle_args *, struct of_dma *),
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 1/1 dma: of: Move the functions under CONFIG_OF_DMA instead of CONFIG_OF

Quoted 8 lines · On Thursday 27 February 2014 19:27:03 Santosh Shilimkar wrote:

The of-dma.c is compiled out with !CONFIG_DMA_OF but the functions in the header are kept under CONFIG_OF. Move them under CONFIG_OF_DMA to avoid build errors with CONFIG_OFF && !CONFIG_DMA_OF

Sorry, but what is the problem you are seeing with this?

CONFIG_DMA_OF is defined as 'OF && DMAENGINE', and this code should only be called from drivers that depend on DMAENGINE.

I'm not saying your patch is wrong, but you shouldn't need it unless you do something very odd.

Arnd

#3 lore raw

PATCH 1/1 dma: of: Move the functions under CONFIG_OF_DMA instead of CONFIG_OF

Quoted 10 lines · Arnd Bergmann
Quoted 8 lines · On Thursday 27 February 2014 19:27:03 Santosh Shilimkar wrote:

The of-dma.c is compiled out with !CONFIG_DMA_OF but the functions in the header are kept under CONFIG_OF. Move them under CONFIG_OF_DMA to avoid build errors with CONFIG_OFF && !CONFIG_DMA_OF

Quoted 8 lines

Sorry, but what is the problem you are seeing with this?

CONFIG_DMA_OF is defined as 'OF && DMAENGINE', and this code should only be called from drivers that depend on DMAENGINE.

I'm not saying your patch is wrong, but you shouldn't need it unless you do something very odd.

So for ARM 'allnoconfig' build we have CONFIG_OF enabled but CONFIG_DMA_OF disabled. With that the of-dma.c gets compiled out leaving the functions from of-dma.h undefined. I noticed this while adding couple of exports in of_dma.h

I am not sure but we added couple of functions for dma-ranges and dma-coherent which gets called from generic code.

In any case, the patch makes sense since the header and Makefile are not consistent.

Regards,
Santosh

#4 lore raw

PATCH 1/1 dma: of: Move the functions under CONFIG_OF_DMA instead of CONFIG_OF

Quoted 4 lines · On Friday 28 February 2014 09:24:27 Santosh Shilimkar wrote:

So for ARM 'allnoconfig' build we have CONFIG_OF enabled but CONFIG_DMA_OF disabled. With that the of-dma.c gets compiled out leaving the functions from of-dma.h undefined. I noticed this while adding couple of exports in of_dma.h

Looking at current linux-next, I find

Kconfig:

menuconfig DMADEVICES
bool "DMA Engine support"
...
if DMADEVICES

config DMA_OF
def_bool y
depends on OF

endif

This means that DMA_OF is disabled in 'allnoconfig' since DMADEVICES is also disabled, as you say. The Makefile looks like

obj-$(CONFIG_DMA_OF) += of-dma.o

As of 5fa422c922c25 "dmaengine: move drivers/of/dma.c -> drivers/dma/of-dma.c"

which seems to solve the problem already.

Quoted 2 lines

I am not sure but we added couple of functions for dma-ranges and dma-coherent which gets called from generic code.

These functions have nothing to do with the dmaengine code though, they should be in a different file.

Arnd

#5 lore raw

PATCH 1/1 dma: of: Move the functions under CONFIG_OF_DMA instead of CONFIG_OF

Quoted 28 lines · Arnd Bergmann
Quoted 4 lines · On Friday 28 February 2014 09:24:27 Santosh Shilimkar wrote:

So for ARM 'allnoconfig' build we have CONFIG_OF enabled but CONFIG_DMA_OF disabled. With that the of-dma.c gets compiled out leaving the functions from of-dma.h undefined. I noticed this while adding couple of exports in of_dma.h

Looking at current linux-next, I find

Kconfig:

menuconfig DMADEVICES
bool "DMA Engine support"
...
if DMADEVICES

config DMA_OF
def_bool y
depends on OF

endif

This means that DMA_OF is disabled in 'allnoconfig' since DMADEVICES is also disabled, as you say. The Makefile looks like

obj-$(CONFIG_DMA_OF) += of-dma.o

As of 5fa422c922c25 "dmaengine: move drivers/of/dma.c -> drivers/dma/of-dma.c"

Quoted 8 lines

which seems to solve the problem already.

Quoted 2 lines

I am not sure but we added couple of functions for dma-ranges and dma-coherent which gets called from generic code.

These functions have nothing to do with the dmaengine code though, they should be in a different file.

Any suggestion on different file ?

#6 lore raw

PATCH 1/1 dma: of: Move the functions under CONFIG_OF_DMA instead of CONFIG_OF

Quoted 11 lines · On Friday 28 February 2014 10:03:10 Santosh Shilimkar wrote:
Quoted 10 lines

As of 5fa422c922c25 "dmaengine: move drivers/of/dma.c -> drivers/dma/of-dma.c"

which seems to solve the problem already.

Quoted 2 lines

I am not sure but we added couple of functions for dma-ranges and dma-coherent which gets called from generic code.

These functions have nothing to do with the dmaengine code though, they should be in a different file.

Any suggestion on different file ?

drivers/of/platform.c would be my first choice. Possibly a new drivers/of/dma-mapping.c.

Arnd

#7 lore raw

PATCH 1/1 dma: of: Move the functions under CONFIG_OF_DMA instead of CONFIG_OF

Quoted 8 lines · Arnd Bergmann
Quoted 7 lines · On Friday 28 February 2014 10:03:10 Santosh Shilimkar wrote:
Quoted 7 lines

As of 5fa422c922c25 "dmaengine: move drivers/of/dma.c -> drivers/dma/of-dma.c"

which seems to solve the problem already.

Quoted 2 lines

I am not sure but we added couple of functions for dma-ranges and dma-coherent which gets called from generic code.

Quoted 8 lines
Quoted 4 lines
Quoted 3 lines

These functions have nothing to do with the dmaengine code though, they should be in a different file.

Any suggestion on different file ?

drivers/of/platform.c would be my first choice. Possibly a new drivers/of/dma-mapping.c.

'drivers/of/platform.c' sounds good.
Regards,
Santosh