2013-08-18 20:21:04

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH 1/4] usb: gadget: USB_FUSB300 should depend on HAS_DMA

If NO_DMA=y:

drivers/built-in.o: In function `fusb300_set_idma':
drivers/usb/gadget/fusb300_udc.c:946: undefined reference to `usb_gadget_map_request'
drivers/usb/gadget/fusb300_udc.c:958: undefined reference to `usb_gadget_unmap_request'

Signed-off-by: Geert Uytterhoeven <[email protected]>
---
drivers/usb/gadget/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 8e93683..d2e6f4f 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -188,7 +188,7 @@ config USB_FSL_USB2

config USB_FUSB300
tristate "Faraday FUSB300 USB Peripheral Controller"
- depends on !PHYS_ADDR_T_64BIT
+ depends on !PHYS_ADDR_T_64BIT && HAS_DMA
help
Faraday usb device controller FUSB300 driver

--
1.7.9.5


2013-08-18 20:21:05

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH 3/4] usb: gadget: USB_NET2272_DMA should depend on HAS_DMA

If NO_DMA=y:

drivers/built-in.o: In function `net2272_done':
drivers/usb/gadget/net2272.c:386: undefined reference to `usb_gadget_unmap_request'
drivers/built-in.o: In function `net2272_queue':
drivers/usb/gadget/net2272.c:848: undefined reference to `usb_gadget_map_request'

Signed-off-by: Geert Uytterhoeven <[email protected]>
---
drivers/usb/gadget/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 3c1cadd..324dc61 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -403,7 +403,7 @@ config USB_NET2272

config USB_NET2272_DMA
boolean "Support external DMA controller"
- depends on USB_NET2272
+ depends on USB_NET2272 && HAS_DMA
help
The NET2272 part can optionally support an external DMA
controller, but your board has to have support in the
--
1.7.9.5

2013-08-18 20:21:03

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH 2/4] usb: gadget: USB_R8A66597 should depend on HAS_DMA

If NO_DMA=y:

drivers/built-in.o: In function `sudmac_free_channel':
drivers/usb/gadget/r8a66597-udc.c:676: undefined reference to `usb_gadget_unmap_request'
drivers/built-in.o: In function `sudmac_alloc_channel':
drivers/usb/gadget/r8a66597-udc.c:666: undefined reference to `usb_gadget_map_request'

Signed-off-by: Geert Uytterhoeven <[email protected]>
---
drivers/usb/gadget/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index d2e6f4f..3c1cadd 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -246,6 +246,7 @@ config USB_PXA25X_SMALL

config USB_R8A66597
tristate "Renesas R8A66597 USB Peripheral Controller"
+ depends on HAS_DMA
help
R8A66597 is a discrete USB host and peripheral controller chip that
supports both full and high speed USB 2.0 data transfers.
--
1.7.9.5

2013-08-18 20:21:47

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH 4/4] usb: chipidea: USB_CHIPIDEA should depend on HAS_DMA

If NO_DMA=y:

drivers/built-in.o: In function `dma_set_coherent_mask':
include/linux/dma-mapping.h:93: undefined reference to `dma_supported'

Signed-off-by: Geert Uytterhoeven <[email protected]>
---
drivers/usb/chipidea/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/chipidea/Kconfig b/drivers/usb/chipidea/Kconfig
index d1bd8ef..dbd5232 100644
--- a/drivers/usb/chipidea/Kconfig
+++ b/drivers/usb/chipidea/Kconfig
@@ -1,6 +1,6 @@
config USB_CHIPIDEA
tristate "ChipIdea Highspeed Dual Role Controller"
- depends on USB || USB_GADGET
+ depends on (USB || USB_GADGET) && HAS_DMA
help
Say Y here if your system has a dual role high speed USB
controller based on ChipIdea silicon IP. Currently, only the
--
1.7.9.5

2013-08-19 03:22:39

by Peter Chen

[permalink] [raw]
Subject: Re: [PATCH 4/4] usb: chipidea: USB_CHIPIDEA should depend on HAS_DMA

On Sun, Aug 18, 2013 at 10:20:44PM +0200, Geert Uytterhoeven wrote:
> If NO_DMA=y:
>
> drivers/built-in.o: In function `dma_set_coherent_mask':
> include/linux/dma-mapping.h:93: undefined reference to `dma_supported'
>
> Signed-off-by: Geert Uytterhoeven <[email protected]>
> ---
> drivers/usb/chipidea/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/chipidea/Kconfig b/drivers/usb/chipidea/Kconfig
> index d1bd8ef..dbd5232 100644
> --- a/drivers/usb/chipidea/Kconfig
> +++ b/drivers/usb/chipidea/Kconfig
> @@ -1,6 +1,6 @@
> config USB_CHIPIDEA
> tristate "ChipIdea Highspeed Dual Role Controller"
> - depends on USB || USB_GADGET
> + depends on (USB || USB_GADGET) && HAS_DMA
> help
> Say Y here if your system has a dual role high speed USB
> controller based on ChipIdea silicon IP. Currently, only the

I can't understand why the DMA can't be changed to fix this instead
of changing every driver?

--

Best Regards,
Peter Chen

2013-08-27 19:17:05

by Felipe Balbi

[permalink] [raw]
Subject: Re: [PATCH 4/4] usb: chipidea: USB_CHIPIDEA should depend on HAS_DMA

On Mon, Aug 19, 2013 at 09:24:01AM +0800, Peter Chen wrote:
> On Sun, Aug 18, 2013 at 10:20:44PM +0200, Geert Uytterhoeven wrote:
> > If NO_DMA=y:
> >
> > drivers/built-in.o: In function `dma_set_coherent_mask':
> > include/linux/dma-mapping.h:93: undefined reference to `dma_supported'
> >
> > Signed-off-by: Geert Uytterhoeven <[email protected]>
> > ---
> > drivers/usb/chipidea/Kconfig | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/chipidea/Kconfig b/drivers/usb/chipidea/Kconfig
> > index d1bd8ef..dbd5232 100644
> > --- a/drivers/usb/chipidea/Kconfig
> > +++ b/drivers/usb/chipidea/Kconfig
> > @@ -1,6 +1,6 @@
> > config USB_CHIPIDEA
> > tristate "ChipIdea Highspeed Dual Role Controller"
> > - depends on USB || USB_GADGET
> > + depends on (USB || USB_GADGET) && HAS_DMA
> > help
> > Say Y here if your system has a dual role high speed USB
> > controller based on ChipIdea silicon IP. Currently, only the
>
> I can't understand why the DMA can't be changed to fix this instead
> of changing every driver?

I'm with you. It'd be nicer to just provide empty stubs when !HAS_DMA

--
balbi


Attachments:
(No filename) (1.14 kB)
signature.asc (836.00 B)
Digital signature
Download all attachments

2013-08-27 19:26:58

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH 4/4] usb: chipidea: USB_CHIPIDEA should depend on HAS_DMA

On Tue, Aug 27, 2013 at 9:16 PM, Felipe Balbi <[email protected]> wrote:
> On Mon, Aug 19, 2013 at 09:24:01AM +0800, Peter Chen wrote:
>> On Sun, Aug 18, 2013 at 10:20:44PM +0200, Geert Uytterhoeven wrote:
>> > If NO_DMA=y:
>> >
>> > drivers/built-in.o: In function `dma_set_coherent_mask':
>> > include/linux/dma-mapping.h:93: undefined reference to `dma_supported'
>> >
>> > Signed-off-by: Geert Uytterhoeven <[email protected]>
>> > ---
>> > drivers/usb/chipidea/Kconfig | 2 +-
>> > 1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/drivers/usb/chipidea/Kconfig b/drivers/usb/chipidea/Kconfig
>> > index d1bd8ef..dbd5232 100644
>> > --- a/drivers/usb/chipidea/Kconfig
>> > +++ b/drivers/usb/chipidea/Kconfig
>> > @@ -1,6 +1,6 @@
>> > config USB_CHIPIDEA
>> > tristate "ChipIdea Highspeed Dual Role Controller"
>> > - depends on USB || USB_GADGET
>> > + depends on (USB || USB_GADGET) && HAS_DMA
>> > help
>> > Say Y here if your system has a dual role high speed USB
>> > controller based on ChipIdea silicon IP. Currently, only the
>>
>> I can't understand why the DMA can't be changed to fix this instead
>> of changing every driver?
>
> I'm with you. It'd be nicer to just provide empty stubs when !HAS_DMA

That would give us drivers that compile but don't work.
Not having stubs is intentional, cfr. the comment at the top of
include/asm-generic/dma-mapping-broken.h:

/* define the dma api to allow compilation but not linking of
* dma dependent code. Code that depends on the dma-mapping
* API needs to set 'depends on HAS_DMA' in its Kconfig
*/

and the comments in the commit that introduced it:

commit 1b0fac45878bb88759eec347c273285195649ff7
Author: Dan Williams <[email protected]>
Date: Sun Jul 15 23:40:26 2007 -0700

dma-mapping: prevent dma dependent code from linking on !HAS_DMA archs

Continuing the work started in 411f0f3edc141a582190d3605cadd1d993abb6df ...

This enables code with a dma path, that compiles away, to build without
requiring additional code factoring. It also prevents code that calls
dma_alloc_coherent and dma_free_coherent from linking whereas previously
the code would hit a BUG() at run time. Finally, it allows archs that set
!HAS_DMA to delete their asm/dma-mapping.h file.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds