stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] usb: gadget: legacy gadgets are optional
@ 2017-03-09 14:10 Romain Izard
  2017-03-10  9:15 ` Felipe Balbi
  0 siblings, 1 reply; 4+ messages in thread
From: Romain Izard @ 2017-03-09 14:10 UTC (permalink / raw)
  To: linux-usb, linux-kernel, Felipe Balbi, Greg Kroah-Hartman
  Cc: Romain Izard, # 4 . 9+

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: <stable@vger.kernel.org> # 4.9+
Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
---
changes in v2:
 - Reword description

 drivers/usb/gadget/Kconfig | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 8ad203296079..e157e9aa4f3d 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -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
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] usb: gadget: legacy gadgets are optional
  2017-03-09 14:10 [PATCH v2] usb: gadget: legacy gadgets are optional Romain Izard
@ 2017-03-10  9:15 ` Felipe Balbi
  2017-03-10  9:39   ` Romain Izard
  0 siblings, 1 reply; 4+ messages in thread
From: Felipe Balbi @ 2017-03-10  9:15 UTC (permalink / raw)
  To: Romain Izard, linux-usb, linux-kernel, Greg Kroah-Hartman
  Cc: Romain Izard, # 4 . 9+

[-- Attachment #1: Type: text/plain, Size: 2359 bytes --]


Hi,

Romain Izard <romain.izard.pro@gmail.com> writes:
> 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: <stable@vger.kernel.org> # 4.9+

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

> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
> ---
> changes in v2:
>  - Reword description
>
>  drivers/usb/gadget/Kconfig | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
> index 8ad203296079..e157e9aa4f3d 100644
> --- a/drivers/usb/gadget/Kconfig
> +++ b/drivers/usb/gadget/Kconfig
> @@ -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

>  	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

>  	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.

unrelated change

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] usb: gadget: legacy gadgets are optional
  2017-03-10  9:15 ` Felipe Balbi
@ 2017-03-10  9:39   ` Romain Izard
  2017-03-10 11:47     ` Felipe Balbi
  0 siblings, 1 reply; 4+ messages in thread
From: Romain Izard @ 2017-03-10  9:39 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: linux-usb, LKML, Greg Kroah-Hartman, # 4 . 9+

Hello Felipe,

2017-03-10 10:15 GMT+01:00 Felipe Balbi <balbi@kernel.org>:
>
> Hi,
>
> Romain Izard <romain.izard.pro@gmail.com> writes:
>> 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: <stable@vger.kernel.org> # 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.

>
>> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
>> ---
>> changes in v2:
>>  - Reword description
>>
>>  drivers/usb/gadget/Kconfig | 11 +++++++++--
>>  1 file changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
>> index 8ad203296079..e157e9aa4f3d 100644
>> --- a/drivers/usb/gadget/Kconfig
>> +++ b/drivers/usb/gadget/Kconfig
>> @@ -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
>
>>       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
>
>>       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.
>
> unrelated change

I'll split this.

Best regards,
-- 
Romain Izard

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] usb: gadget: legacy gadgets are optional
  2017-03-10  9:39   ` Romain Izard
@ 2017-03-10 11:47     ` Felipe Balbi
  0 siblings, 0 replies; 4+ messages in thread
From: Felipe Balbi @ 2017-03-10 11:47 UTC (permalink / raw)
  To: Romain Izard; +Cc: linux-usb, LKML, Greg Kroah-Hartman, # 4 . 9+

[-- Attachment #1: Type: text/plain, Size: 1861 bytes --]


Hi,

Romain Izard <romain.izard.pro@gmail.com> writes:
> Hello Felipe,
>
> 2017-03-10 10:15 GMT+01:00 Felipe Balbi <balbi@kernel.org>:
>>
>> Hi,
>>
>> Romain Izard <romain.izard.pro@gmail.com> writes:
>>> 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: <stable@vger.kernel.org> # 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 :-)

> 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.

>>> @@ -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
>
> I'll split this.

thank you

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-10 11:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-09 14:10 [PATCH v2] usb: gadget: legacy gadgets are optional Romain Izard
2017-03-10  9:15 ` Felipe Balbi
2017-03-10  9:39   ` Romain Izard
2017-03-10 11:47     ` Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).