Skip to contentSkip to conversation

usb: gadget: legacy gadgets are optional

PATCH Superseded Romain Izard 2 participants 4 messages Mar 9, 2017 – Mar 10, 2017

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 usb: gadget: legacy gadgets are optional

With commit "usb: gadget: don't couple configfs to legacy gadgets" it is possible to build a modular kernel with both built-in configfs support and modular legacy gadget drivers.

But when building a kernel without modules, it is also necessary to be able to build with configfs but without any legacy gadget driver.

Mark the choice for legacy gadget drivers as optional.

Fixes bc49d1d17dcf ("usb: gadget: don't couple configfs to legacy gadgets")
Cc <[email protected]> # 4.9+

---
changes in v2:
- Reword description

 drivers/usb/gadget/Kconfig | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/usb/gadget/Kconfig +9 -2
index 8ad203296079..e157e9aa4f3d 100644
@@ -212,7 +212,7 @@ config USB_F_TCM
 # this first set of drivers all depend on bulk-capable hardware.
 
 config USB_CONFIGFS
-	tristate "USB functions configurable through configfs"
+	tristate "USB Gadget functions configurable through configfs"
 	select USB_LIBCOMPOSITE
 	help
 	  A Linux USB "gadget" can be set up through configfs.
@@ -458,8 +458,9 @@ config USB_CONFIGFS_F_TCM
 	  UAS utilizes the USB 3.0 feature called streams support.
 
 choice
-	tristate "USB Gadget Drivers"
+	tristate "USB Gadget precomposed configurations"
 	default USB_ETH
+	optional
 	help
 	  A Linux "Gadget Driver" talks to the USB Peripheral Controller
 	  driver through the abstract "gadget" API.  Some other operating
@@ -476,6 +477,12 @@ choice
 	  not be able work with that controller, or might need to implement
 	  a less common variant of a device class protocol.
 
+	  The available choices each represent a single precomposed USB
+	  gadget configuration. In the device model, each option contains
+	  both the device instanciation as a child for a USB gadget
+	  controller, and the relevant drivers for each function declared
+	  by the device.
+
 source "drivers/usb/gadget/legacy/Kconfig"
 
 endchoice
Signature · 1 line
2.9.3
#1 lore raw

Hi,

Quoted 11 lines · Romain Izard

With commit "usb: gadget: don't couple configfs to legacy gadgets" it is possible to build a modular kernel with both built-in configfs support and modular legacy gadget drivers.

But when building a kernel without modules, it is also necessary to be able to build with configfs but without any legacy gadget driver.

Mark the choice for legacy gadget drivers as optional.

Fixes bc49d1d17dcf ("usb: gadget: don't couple configfs to legacy gadgets")
Cc <[email protected]> # 4.9+

this is *NOT* a fix since this requirement didn't exist before.

Quoted 13 lines

---
changes in v2:
- Reword description

 drivers/usb/gadget/Kconfig | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/usb/gadget/Kconfig +0 -0
index 8ad203296079..e157e9aa4f3d 100644

drivers/usb/gadget/Kconfig config USB_F_TCM · line 215

Quoted 5 lines
drivers/usb/gadget/Kconfig +1 -1
@@ -212,7 +212,7 @@ config USB_F_TCM
 # this first set of drivers all depend on bulk-capable hardware.
 
 config USB_CONFIGFS
-	tristate "USB functions configurable through configfs"
+	tristate "USB Gadget functions configurable through configfs"

unrelated change

drivers/usb/gadget/Kconfig config USB_CONFIGFS_F_TCM · line 461

Quoted 9 lines
drivers/usb/gadget/Kconfig +1 -1
 	select USB_LIBCOMPOSITE
 	help
 	  A Linux USB "gadget" can be set up through configfs.
@@ -458,8 +458,9 @@ config USB_CONFIGFS_F_TCM
 	  UAS utilizes the USB 3.0 feature called streams support.
 
 choice
-	tristate "USB Gadget Drivers"
+	tristate "USB Gadget precomposed configurations"

unrelated change

Quoted 6 lines
drivers/usb/gadget/Kconfig +1 -0
 	default USB_ETH
+	optional
 	help
 	  A Linux "Gadget Driver" talks to the USB Peripheral Controller
 	  driver through the abstract "gadget" API.  Some other operating

drivers/usb/gadget/Kconfig choice · line 484

Quoted 8 lines
drivers/usb/gadget/Kconfig +5 -0
@@ -476,6 +477,12 @@ choice
 	  not be able work with that controller, or might need to implement
 	  a less common variant of a device class protocol.
 
+	  The available choices each represent a single precomposed USB
+	  gadget configuration. In the device model, each option contains
+	  both the device instanciation as a child for a USB gadget
+	  controller, and the relevant drivers for each function declared
+	  by the device.

unrelated change

Signature · 1 line
balbi
#2 lore raw

Hello Felipe,

2017-03-10 10:15 GMT+01:00 Felipe Balbi <[email protected]>:

Quoted 11 lines

Hi,

Quoted 7 lines · Romain Izard

With commit "usb: gadget: don't couple configfs to legacy gadgets" it is possible to build a modular kernel with both built-in configfs support and modular legacy gadget drivers.

But when building a kernel without modules, it is also necessary to be able to build with configfs but without any legacy gadget driver.

Quoted 6 lines
Quoted 4 lines

Mark the choice for legacy gadget drivers as optional.

Fixes bc49d1d17dcf ("usb: gadget: don't couple configfs to legacy gadgets")
Cc <[email protected]> # 4.9+

this is *NOT* a fix since this requirement didn't exist before.

It worked in 4.1, as a non-modular kernel would only have a single entry from the USB gadget driver choice option, and USB_CONFIGFS was one of those.

When I moved on to 4.9, this configuration could not be selected anymore.

Quoted 43 lines
Quoted 14 lines

---
changes in v2:
- Reword description

 drivers/usb/gadget/Kconfig | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/usb/gadget/Kconfig +0 -0
index 8ad203296079..e157e9aa4f3d 100644

drivers/usb/gadget/Kconfig config USB_F_TCM · line 215

Quoted 5 lines
drivers/usb/gadget/Kconfig +1 -1
@@ -212,7 +212,7 @@ config USB_F_TCM
 # this first set of drivers all depend on bulk-capable hardware.
 
 config USB_CONFIGFS
-     tristate "USB functions configurable through configfs"
+     tristate "USB Gadget functions configurable through configfs"

unrelated change

drivers/usb/gadget/Kconfig config USB_CONFIGFS_F_TCM · line 461

Quoted 9 lines
drivers/usb/gadget/Kconfig +1 -1
      select USB_LIBCOMPOSITE
      help
        A Linux USB "gadget" can be set up through configfs.
@@ -458,8 +458,9 @@ config USB_CONFIGFS_F_TCM
        UAS utilizes the USB 3.0 feature called streams support.
 
 choice
-     tristate "USB Gadget Drivers"
+     tristate "USB Gadget precomposed configurations"

unrelated change

Quoted 9 lines
drivers/usb/gadget/Kconfig +1 -0
      default USB_ETH
+     optional
      help
        A Linux "Gadget Driver" talks to the USB Peripheral Controller
        driver through the abstract "gadget" API.  Some other operating
@@ -476,6 +477,12 @@ choice
        not be able work with that controller, or might need to implement
        a less common variant of a device class protocol.
 
Quoted 7 lines

drivers/usb/gadget/Kconfig choice · line 484

Quoted 5 lines
drivers/usb/gadget/Kconfig +5 -0
+       The available choices each represent a single precomposed USB
+       gadget configuration. In the device model, each option contains
+       both the device instanciation as a child for a USB gadget
+       controller, and the relevant drivers for each function declared
+       by the device.

unrelated change

I'll split this.

Best regards,

Signature · 1 line
Romain Izard
#3 lore raw

Hi,

Quoted 16 lines · Romain Izard

Hello Felipe,

2017-03-10 10:15 GMT+01:00 Felipe Balbi <[email protected]>:

Quoted 13 lines

Hi,

Quoted 9 lines · Romain Izard

With commit "usb: gadget: don't couple configfs to legacy gadgets" it is possible to build a modular kernel with both built-in configfs support and modular legacy gadget drivers.

But when building a kernel without modules, it is also necessary to be able to build with configfs but without any legacy gadget driver.

Mark the choice for legacy gadget drivers as optional.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Fixes bc49d1d17dcf ("usb: gadget: don't couple configfs to legacy gadgets")
Cc <[email protected]> # 4.9+

this is *NOT* a fix since this requirement didn't exist before.

It worked in 4.1, as a non-modular kernel would only have a single entry from the USB gadget driver choice option, and USB_CONFIGFS was one of those.

but it wasn't a requirement :-)

Quoted 1 line

When I moved on to 4.9, this configuration could not be selected anymore.

you could've let us know you needed that working :-) That changed quite a while back :-) Anyway, I get what you mean. I'll take patch for v4.12 with the stable tag in it.

Quoted 12 lines
Quoted 11 lines

drivers/usb/gadget/Kconfig choice · line 484

Quoted 9 lines
drivers/usb/gadget/Kconfig +5 -0
@@ -476,6 +477,12 @@ choice
        not be able work with that controller, or might need to implement
        a less common variant of a device class protocol.
 
+       The available choices each represent a single precomposed USB
+       gadget configuration. In the device model, each option contains
+       both the device instanciation as a child for a USB gadget
+       controller, and the relevant drivers for each function declared
+       by the device.

unrelated change

Quoted 1 line

I'll split this.

thank you

Signature · 1 line
balbi