Skip to contentSkip to conversation

usb: musb: USB_TI_CPPI41_DMA requires dmaengine support

PATCH In review Arnd Bergmann 3 participants 10 messages Nov 18, 2015

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

PATCH 1/1 usb: musb: USB_TI_CPPI41_DMA requires dmaengine support

The CPPI-4.1 driver selects TI_CPPI41, which is a dmaengine driver and that may not be available when CONFIG_DMADEVICES is not set:

warning: (USB_TI_CPPI41_DMA) selects TI_CPPI41 which has unmet direct dependencies (DMADEVICES && ARCH_OMAP)

This adds an extra dependency to avoid generating warnings in randconfig builds. Ideally we'd remove the 'select' statement, but that has the potential to break defconfig files.

Fixes 411dd19c682d ("usb: musb: Kconfig: Select the DMA driver if DMA mode of MUSB is enabled")
drivers/usb/musb/Kconfig +1 -1
index 1f2037bbeb0d..45c83baf675d 100644
@@ -159,7 +159,7 @@ config USB_TI_CPPI_DMA
 
 config USB_TI_CPPI41_DMA
 	bool 'TI CPPI 4.1 (AM335x)'
-	depends on ARCH_OMAP
+	depends on ARCH_OMAP && DMADEVICES
 	select TI_CPPI41
 
 config USB_TUSB_OMAP_DMA
#1 lore raw

Hi,

Quoted 18 lines · Arnd Bergmann

The CPPI-4.1 driver selects TI_CPPI41, which is a dmaengine driver and that may not be available when CONFIG_DMADEVICES is not set:

warning: (USB_TI_CPPI41_DMA) selects TI_CPPI41 which has unmet direct dependencies (DMADEVICES && ARCH_OMAP)

This adds an extra dependency to avoid generating warnings in randconfig builds. Ideally we'd remove the 'select' statement, but that has the potential to break defconfig files.

Fixes 411dd19c682d ("usb: musb: Kconfig: Select the DMA driver if DMA mode of MUSB is enabled")
drivers/usb/musb/Kconfig +0 -0
index 1f2037bbeb0d..45c83baf675d 100644

drivers/usb/musb/Kconfig config USB_TI_CPPI_DMA · line 163

Quoted 6 lines
drivers/usb/musb/Kconfig +1 -1
@@ -159,7 +159,7 @@ config USB_TI_CPPI_DMA
 
 config USB_TI_CPPI41_DMA
        bool 'TI CPPI 4.1 (AM335x)'
-       depends on ARCH_OMAP
+       depends on ARCH_OMAP && DMADEVICES
        select TI_CPPI41

I am not sure what the generic policy is, but instead of hiding USB_TI_CPPI41_DMA if DMADEVICES is disabled, I'd like to enable DMADEVICES if USB_TI_CPPI41_DMA is enabled, from user experience perspective.

Thanks,
-Bin.

Quoted 7 lines
drivers/usb/musb/Kconfig +0 -1
 config USB_TUSB_OMAP_DMA
 
--

To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

Hi,

Quoted 20 lines · Bin Liu
Quoted 19 lines · Arnd Bergmann

The CPPI-4.1 driver selects TI_CPPI41, which is a dmaengine driver and that may not be available when CONFIG_DMADEVICES is not set:

warning: (USB_TI_CPPI41_DMA) selects TI_CPPI41 which has unmet direct dependencies (DMADEVICES && ARCH_OMAP)

This adds an extra dependency to avoid generating warnings in randconfig builds. Ideally we'd remove the 'select' statement, but that has the potential to break defconfig files.

Fixes 411dd19c682d ("usb: musb: Kconfig: Select the DMA driver if DMA mode of MUSB is enabled")
drivers/usb/musb/Kconfig +0 -0
index 1f2037bbeb0d..45c83baf675d 100644
@@ -159,7 +159,7 @@ config USB_TI_CPPI_DMA
 
Quoted 10 lines

drivers/usb/musb/Kconfig config USB_TI_CPPI_DMA · line 163

Quoted 5 lines
drivers/usb/musb/Kconfig +1 -1
 config USB_TI_CPPI41_DMA
        bool 'TI CPPI 4.1 (AM335x)'
-       depends on ARCH_OMAP
+       depends on ARCH_OMAP && DMADEVICES
        select TI_CPPI41

I am not sure what the generic policy is, but instead of hiding USB_TI_CPPI41_DMA if DMADEVICES is disabled, I'd like to enable DMADEVICES if USB_TI_CPPI41_DMA is enabled, from user experience perspective.

that would mean "select DMADEVICES" and that's frowned upon.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151118/d0365a41/attachment.sig>
#3 lore raw

Hi,

Quoted 35 lines · Felipe Balbi

Hi,

Quoted 20 lines · Bin Liu
Quoted 19 lines · Arnd Bergmann

The CPPI-4.1 driver selects TI_CPPI41, which is a dmaengine driver and that may not be available when CONFIG_DMADEVICES is not set:

warning: (USB_TI_CPPI41_DMA) selects TI_CPPI41 which has unmet direct dependencies (DMADEVICES && ARCH_OMAP)

This adds an extra dependency to avoid generating warnings in randconfig builds. Ideally we'd remove the 'select' statement, but that has the potential to break defconfig files.

Fixes 411dd19c682d ("usb: musb: Kconfig: Select the DMA driver if DMA mode of MUSB is enabled")
drivers/usb/musb/Kconfig +0 -0
index 1f2037bbeb0d..45c83baf675d 100644
@@ -159,7 +159,7 @@ config USB_TI_CPPI_DMA
 
Quoted 10 lines

drivers/usb/musb/Kconfig config USB_TI_CPPI_DMA · line 163

Quoted 5 lines
drivers/usb/musb/Kconfig +1 -1
 config USB_TI_CPPI41_DMA
        bool 'TI CPPI 4.1 (AM335x)'
-       depends on ARCH_OMAP
+       depends on ARCH_OMAP && DMADEVICES
        select TI_CPPI41

I am not sure what the generic policy is, but instead of hiding USB_TI_CPPI41_DMA if DMADEVICES is disabled, I'd like to enable DMADEVICES if USB_TI_CPPI41_DMA is enabled, from user experience perspective.

Quoted 1 line

that would mean "select DMADEVICES" and that's frowned upon.

Currently 'select DMADEVICES' is not in there. Will adding it fix the dependency warning in randconfig? Sorry for the question, but I don't know enough about Kconfig to get the answer.

Regards,
-Bin.

Quoted 3 lines

--
balbi

#4 lore raw

Hi,

Quoted 32 lines · Bin Liu
Quoted 32 lines
Quoted 30 lines · Bin Liu
Quoted 18 lines · Arnd Bergmann

The CPPI-4.1 driver selects TI_CPPI41, which is a dmaengine driver and that may not be available when CONFIG_DMADEVICES is not set:

warning: (USB_TI_CPPI41_DMA) selects TI_CPPI41 which has unmet direct dependencies (DMADEVICES && ARCH_OMAP)

This adds an extra dependency to avoid generating warnings in randconfig builds. Ideally we'd remove the 'select' statement, but that has the potential to break defconfig files.

Fixes 411dd19c682d ("usb: musb: Kconfig: Select the DMA driver if DMA mode of MUSB is enabled")
drivers/usb/musb/Kconfig +0 -0
index 1f2037bbeb0d..45c83baf675d 100644

drivers/usb/musb/Kconfig config USB_TI_CPPI_DMA · line 163

Quoted 6 lines
drivers/usb/musb/Kconfig +1 -1
@@ -159,7 +159,7 @@ config USB_TI_CPPI_DMA
 
 config USB_TI_CPPI41_DMA
        bool 'TI CPPI 4.1 (AM335x)'
-       depends on ARCH_OMAP
+       depends on ARCH_OMAP && DMADEVICES
        select TI_CPPI41

I am not sure what the generic policy is, but instead of hiding USB_TI_CPPI41_DMA if DMADEVICES is disabled, I'd like to enable DMADEVICES if USB_TI_CPPI41_DMA is enabled, from user experience perspective.

Quoted 5 lines
Quoted 1 line

that would mean "select DMADEVICES" and that's frowned upon.

Currently 'select DMADEVICES' is not in there. Will adding it fix the dependency warning in randconfig? Sorry for the question, but I don't know enough about Kconfig to get the answer.

it certainly would, but we don't like to add "select XYZ" to Kconfig because a select bypasses the dependency tree. Let me explain:

config A
tristate "A"
depends on B

config B
tristate "B"

config C
tristate "C"
select A

C can select A without B being enabled.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151118/b9899acb/attachment.sig>
#5 lore raw
Quoted 53 lines · Felipe Balbi

Hi,

Quoted 32 lines · Bin Liu
Quoted 32 lines
Quoted 30 lines · Bin Liu
Quoted 18 lines · Arnd Bergmann

The CPPI-4.1 driver selects TI_CPPI41, which is a dmaengine driver and that may not be available when CONFIG_DMADEVICES is not set:

warning: (USB_TI_CPPI41_DMA) selects TI_CPPI41 which has unmet direct dependencies (DMADEVICES && ARCH_OMAP)

This adds an extra dependency to avoid generating warnings in randconfig builds. Ideally we'd remove the 'select' statement, but that has the potential to break defconfig files.

Fixes 411dd19c682d ("usb: musb: Kconfig: Select the DMA driver if DMA mode of MUSB is enabled")
drivers/usb/musb/Kconfig +0 -0
index 1f2037bbeb0d..45c83baf675d 100644

drivers/usb/musb/Kconfig config USB_TI_CPPI_DMA · line 163

Quoted 6 lines
drivers/usb/musb/Kconfig +1 -1
@@ -159,7 +159,7 @@ config USB_TI_CPPI_DMA
 
 config USB_TI_CPPI41_DMA
        bool 'TI CPPI 4.1 (AM335x)'
-       depends on ARCH_OMAP
+       depends on ARCH_OMAP && DMADEVICES
        select TI_CPPI41

I am not sure what the generic policy is, but instead of hiding USB_TI_CPPI41_DMA if DMADEVICES is disabled, I'd like to enable DMADEVICES if USB_TI_CPPI41_DMA is enabled, from user experience perspective.

Quoted 5 lines
Quoted 1 line

that would mean "select DMADEVICES" and that's frowned upon.

Currently 'select DMADEVICES' is not in there. Will adding it fix the dependency warning in randconfig? Sorry for the question, but I don't know enough about Kconfig to get the answer.

it certainly would, but we don't like to add "select XYZ" to Kconfig because a select bypasses the dependency tree. Let me explain:

config A
tristate "A"
depends on B

config B
tristate "B"

Quoted 6 lines

config C
tristate "C"
select A

C can select A without B being enabled.

Thanks for the explanation, very clear.

Quoted 3 lines

--
balbi

#6 lore raw
In reply to Bin Liu
Quoted 6 lines · On Wednesday 18 November 2015 12:29:27 Bin Liu wrote:
Quoted 6 lines
drivers/usb/musb/Kconfig +0 -0
index 1f2037bbeb0d..45c83baf675d 100644
@@ -159,7 +159,7 @@ config USB_TI_CPPI_DMA
 
Quoted 10 lines

drivers/usb/musb/Kconfig config USB_TI_CPPI_DMA · line 163

Quoted 5 lines
drivers/usb/musb/Kconfig +1 -1
 config USB_TI_CPPI41_DMA
        bool 'TI CPPI 4.1 (AM335x)'
-       depends on ARCH_OMAP
+       depends on ARCH_OMAP && DMADEVICES
        select TI_CPPI41

I am not sure what the generic policy is, but instead of hiding USB_TI_CPPI41_DMA if DMADEVICES is disabled, I'd like to enable DMADEVICES if USB_TI_CPPI41_DMA is enabled, from user experience perspective.

General policy is that you should not 'select' a symbol that is also user-visible, as that tends to cause dependency loops and other problems when something is enabled without the user being aware of that.

Ideally we should remove the 'select TI_CPPI41' here as well, but what we could do instead is to make that a silent symbol and remove the prompt so it always gets enabled implicitly when USB_TI_CPPI41_DMA and DMADEVICES are both enabled.

Arnd

#7 lore raw

Hi,

Quoted 18 lines · Arnd Bergmann
Quoted 6 lines · On Wednesday 18 November 2015 12:29:27 Bin Liu wrote:
Quoted 6 lines
drivers/usb/musb/Kconfig +0 -0
index 1f2037bbeb0d..45c83baf675d 100644
@@ -159,7 +159,7 @@ config USB_TI_CPPI_DMA
 
Quoted 10 lines

drivers/usb/musb/Kconfig config USB_TI_CPPI_DMA · line 163

Quoted 5 lines
drivers/usb/musb/Kconfig +1 -1
 config USB_TI_CPPI41_DMA
        bool 'TI CPPI 4.1 (AM335x)'
-       depends on ARCH_OMAP
+       depends on ARCH_OMAP && DMADEVICES
        select TI_CPPI41

I am not sure what the generic policy is, but instead of hiding USB_TI_CPPI41_DMA if DMADEVICES is disabled, I'd like to enable DMADEVICES if USB_TI_CPPI41_DMA is enabled, from user experience perspective.

Quoted 4 lines

General policy is that you should not 'select' a symbol that is also user-visible, as that tends to cause dependency loops and other problems when something is enabled without the user being aware of that.

Understood. Thanks. I am okay with this patch.

Quoted 5 lines

Ideally we should remove the 'select TI_CPPI41' here as well, but what we could do instead is to make that a silent symbol and remove the prompt so it always gets enabled implicitly when USB_TI_CPPI41_DMA and DMADEVICES are both enabled.

But what if DMADEVICES was disabled and USB_TI_CPPI41_DMA was enabled? I would think I had CPPI fully enabled for MUSB, but it didn't because TI_CPPI41 was disabled.

I would think this patch is the test option so far, we might have to document somewhere that to dmaengine has to be enabled to use MUSB CPPI, but I am not sure where the best place is to document...

Regards,
-Bin.

Quoted 2 lines

Arnd

#8 lore raw
Quoted 8 lines · On Wednesday 18 November 2015 14:39:10 Bin Liu wrote:
Quoted 4 lines

Ideally we should remove the 'select TI_CPPI41' here as well, but what we could do instead is to make that a silent symbol and remove the prompt so it always gets enabled implicitly when USB_TI_CPPI41_DMA and DMADEVICES are both enabled.

But what if DMADEVICES was disabled and USB_TI_CPPI41_DMA was enabled? I would think I had CPPI fully enabled for MUSB, but it didn't because TI_CPPI41 was disabled.

That would cause a runtime failure, just like any other configuration that does not enable all the hardware you want to use.

Quoted 3 lines

I would think this patch is the test option so far, we might have to document somewhere that to dmaengine has to be enabled to use MUSB CPPI, but I am not sure where the best place is to document...

There are hundreds of device drivers that use dmaengines as a backend, we don't normally document this, just like we don't document the fact that you need to enable the right gpio, irqchip, timer, clock etc drivers for your platform.

Arnd

#9 lore raw
In reply to Arnd Bergmann

Hi,

Quoted 23 lines · Arnd Bergmann
Quoted 6 lines · On Wednesday 18 November 2015 12:29:27 Bin Liu wrote:
Quoted 6 lines
drivers/usb/musb/Kconfig +0 -0
index 1f2037bbeb0d..45c83baf675d 100644
@@ -159,7 +159,7 @@ config USB_TI_CPPI_DMA
 
Quoted 10 lines

drivers/usb/musb/Kconfig config USB_TI_CPPI_DMA · line 163

Quoted 5 lines
drivers/usb/musb/Kconfig +1 -1
 config USB_TI_CPPI41_DMA
        bool 'TI CPPI 4.1 (AM335x)'
-       depends on ARCH_OMAP
+       depends on ARCH_OMAP && DMADEVICES
        select TI_CPPI41

I am not sure what the generic policy is, but instead of hiding USB_TI_CPPI41_DMA if DMADEVICES is disabled, I'd like to enable DMADEVICES if USB_TI_CPPI41_DMA is enabled, from user experience perspective.

General policy is that you should not 'select' a symbol that is also user-visible, as that tends to cause dependency loops and other problems when something is enabled without the user being aware of that.

Quoted 4 lines

Ideally we should remove the 'select TI_CPPI41' here as well, but what we could do instead is to make that a silent symbol and remove the prompt so it always gets enabled implicitly when USB_TI_CPPI41_DMA and DMADEVICES are both enabled.

that should be perfect now that Tony L fixed this up so we can enable all MUSB DMA Engines in a single zImage.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151118/b6237d3d/attachment-0001.sig>