Skip to contentSkip to conversation

usb: gadget: Move USB_GADGET_DUALSPEED to be slightly more visible

PATCH Superseded Tom Rini 3 participants 16 messages Mar 17 – Apr 8 USB

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 usb: gadget: Move USB_GADGET_DUALSPEED to be slightly more visible

As exposed by "make randconfig", we have an issue around USB_GADGET_DUALSPEED. It is possible to select this symbol (via SPL_USB_CDNS3_GADGET for example) and so have an unmet dependency. As this is a hidden symbol, move it up within the menu.

---
Cc: Mattijs Korpershoek <[email protected]>
Cc: Marek Vasut <[email protected]>

---
 drivers/usb/gadget/Kconfig | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/usb/gadget/Kconfig +4 -4
index baa2eb61ea33..a36be818a68c 100644
@@ -44,6 +44,10 @@ config SPL_USB_GADGET
 	  Enable USB Gadget API which allows to enable USB device functions
 	  in SPL.
 
+# Selected by UDC drivers that support high-speed operation.
+config USB_GADGET_DUALSPEED
+	bool
+
 if USB_GADGET
 
 config USB_GADGET_MANUFACTURER
@@ -179,10 +183,6 @@ config SDP_LOADADDR
 	hex "Default load address at SDP_WRITE and SDP_JUMP"
 	default 0x0
 
-# Selected by UDC drivers that support high-speed operation.
-config USB_GADGET_DUALSPEED
-	bool
-
 config USB_GADGET_DOWNLOAD
 	bool "Enable USB download gadget"
 	help
Signature · 1 line
2.43.0
#1 lore raw
Quoted 4 lines · Tom Rini

As exposed by "make randconfig", we have an issue around USB_GADGET_DUALSPEED. It is possible to select this symbol (via SPL_USB_CDNS3_GADGET for example) and so have an unmet dependency. As this is a hidden symbol, move it up within the menu.

What is the issue this is fixing ?

author
#2 lore raw
Quoted 6 lines · Marek Vasut
Quoted 4 lines · Tom Rini

As exposed by "make randconfig", we have an issue around USB_GADGET_DUALSPEED. It is possible to select this symbol (via SPL_USB_CDNS3_GADGET for example) and so have an unmet dependency. As this is a hidden symbol, move it up within the menu.

What is the issue this is fixing ?

Valid configs causing the kconfig part of the build system to note unmet dependencies.

Signature · 1 line
Tom
#3 lore raw
Quoted 10 lines · Tom Rini
Quoted 6 lines · Marek Vasut
Quoted 4 lines · Tom Rini

As exposed by "make randconfig", we have an issue around USB_GADGET_DUALSPEED. It is possible to select this symbol (via SPL_USB_CDNS3_GADGET for example) and so have an unmet dependency. As this is a hidden symbol, move it up within the menu.

What is the issue this is fixing ?

Valid configs causing the kconfig part of the build system to note unmet dependencies.

Lemme rephrase, is this actually a fix, or is this some readability/ordering improvement patch ?

author
#4 lore raw
Quoted 7 lines · Marek Vasut
Quoted 6 lines · Tom Rini
Quoted 5 lines · Marek Vasut
Quoted 4 lines · Tom Rini

As exposed by "make randconfig", we have an issue around USB_GADGET_DUALSPEED. It is possible to select this symbol (via SPL_USB_CDNS3_GADGET for example) and so have an unmet dependency. As this is a hidden symbol, move it up within the menu.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

What is the issue this is fixing ?

Valid configs causing the kconfig part of the build system to note unmet dependencies.

Lemme rephrase, is this actually a fix, or is this some readability/ordering improvement patch ?

Yes, it's a fix because randconfig finds problems that users may stumble on to while trying to make a valid config for a platform.

Signature · 1 line
Tom
#5 lore raw
Quoted 10 lines · Tom Rini
Quoted 9 lines · Marek Vasut
Quoted 8 lines · Tom Rini
Quoted 6 lines · Marek Vasut
Quoted 4 lines · Tom Rini

As exposed by "make randconfig", we have an issue around USB_GADGET_DUALSPEED. It is possible to select this symbol (via SPL_USB_CDNS3_GADGET for example) and so have an unmet dependency. As this is a hidden symbol, move it up within the menu.

What is the issue this is fixing ?

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Valid configs causing the kconfig part of the build system to note unmet dependencies.

Lemme rephrase, is this actually a fix, or is this some readability/ordering improvement patch ?

Yes, it's a fix because randconfig finds problems that users may stumble on to while trying to make a valid config for a platform.

Is the commit message telling me, that "config USB_GADGET_DUALSPEED" is moved outside of the "if USB_GADGET" block ?

Because if this is something else, and the symbols are simply reordered, that I do not understand how this could be fixing anything.

author
#6 lore raw
Quoted 16 lines · Marek Vasut
Quoted 15 lines · Tom Rini
Quoted 13 lines · Marek Vasut
Quoted 10 lines · Tom Rini
Quoted 6 lines · Marek Vasut
Quoted 4 lines · Tom Rini

As exposed by "make randconfig", we have an issue around USB_GADGET_DUALSPEED. It is possible to select this symbol (via SPL_USB_CDNS3_GADGET for example) and so have an unmet dependency. As this is a hidden symbol, move it up within the menu.

What is the issue this is fixing ?

Valid configs causing the kconfig part of the build system to note unmet dependencies.

Lemme rephrase, is this actually a fix, or is this some readability/ordering improvement patch ?

Quoted 8 lines
Quoted 2 lines

Yes, it's a fix because randconfig finds problems that users may stumble on to while trying to make a valid config for a platform.

Is the commit message telling me, that "config USB_GADGET_DUALSPEED" is moved outside of the "if USB_GADGET" block ?

Because if this is something else, and the symbols are simply reordered, that I do not understand how this could be fixing anything.

I'm unclear what else you need to know to take this bugfix. The symbol is not placed correctly, leading to possibly unmet dependency errors. Yes, the error is discovered by randconfig which makes it harder to describe how exactly to reproduce it (but I believe it does), but that doesn't make it any less valid.

We'll probably never hit the level of support the kernel has, which is all randconfigs compile and link (and usually even run), but we should at least be able to clear out most/all of the Kconfig issues that can be caught at parse time in a month or two, and maybe even this year have most CONFIG_SANDBOX=y results build (excluding drivers not fully configured by Kconfig). And this matters for real users because it means that downstream developers can probably configure a build rather than get stuck with odd errors.

Signature · 1 line
Tom
#7 lore raw
Quoted 20 lines · Tom Rini
Quoted 19 lines · Marek Vasut
Quoted 17 lines · Tom Rini
Quoted 7 lines · Marek Vasut
Quoted 6 lines · Tom Rini
Quoted 5 lines · Marek Vasut
Quoted 4 lines · Tom Rini

As exposed by "make randconfig", we have an issue around USB_GADGET_DUALSPEED. It is possible to select this symbol (via SPL_USB_CDNS3_GADGET for example) and so have an unmet dependency. As this is a hidden symbol, move it up within the menu.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

What is the issue this is fixing ?

Valid configs causing the kconfig part of the build system to note unmet dependencies.

Lemme rephrase, is this actually a fix, or is this some readability/ordering improvement patch ?

Yes, it's a fix because randconfig finds problems that users may stumble on to while trying to make a valid config for a platform.

Quoted 8 lines
Quoted 5 lines

Is the commit message telling me, that "config USB_GADGET_DUALSPEED" is moved outside of the "if USB_GADGET" block ?

Because if this is something else, and the symbols are simply reordered, that I do not understand how this could be fixing anything.

I'm unclear what else you need to know to take this bugfix. The symbol is not placed correctly, leading to possibly unmet dependency errors.

Why do you think the symbol is placed incorrectly ?

What this change does, is it moves "config USB_GADGET_DUALSPEED" outside of the "if USB_GADGET" block in drivers/usb/gadget/Kconfig , which the commit message should clearly spell out.

However , I believe that is not the correct fix. The USB_GADGET_DUALSPEED has to be available only if USB_GADGET or SPL_USB_GADGET is selected, the former is already satisfied, the later is not and the SPL_USB_CDNS3_GADGET triggers a problem here. I think this is the correct fix:

"

drivers/usb/gadget/Kconfig +8 -4
index ebb306852a6..87d17780c45 100644
@@ -178,10 +178,6 @@ config SDP_LOADADDR
        hex "Default load address at SDP_WRITE and SDP_JUMP"
        default 0x0
 
-# Selected by UDC drivers that support high-speed operation.
-config USB_GADGET_DUALSPEED
-       bool
-
 config USB_GADGET_DOWNLOAD
        bool "Enable USB download gadget"
        help
@@ -371,3 +367,11 @@ config SPL_SDP_USB_DEV
          so it can be used in compiled environment.
 
 endif # SPL_USB_GADGET
+
+if USB_GADGET || SPL_USB_GADGET
+
+# Selected by UDC drivers that support high-speed operation.
+config USB_GADGET_DUALSPEED
+       bool
+
+endif

"

Quoted 3 lines

Yes, the error is discovered by randconfig which makes it harder to describe how exactly to reproduce it (but I believe it does), but that doesn't make it any less valid.

This part is not relevant.

author
#8 lore raw
Quoted 24 lines · Marek Vasut
Quoted 23 lines · Tom Rini
Quoted 22 lines · Marek Vasut
Quoted 10 lines · Tom Rini
Quoted 9 lines · Marek Vasut
Quoted 8 lines · Tom Rini
Quoted 6 lines · Marek Vasut
Quoted 4 lines · Tom Rini

As exposed by "make randconfig", we have an issue around USB_GADGET_DUALSPEED. It is possible to select this symbol (via SPL_USB_CDNS3_GADGET for example) and so have an unmet dependency. As this is a hidden symbol, move it up within the menu.

What is the issue this is fixing ?

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Valid configs causing the kconfig part of the build system to note unmet dependencies.

Lemme rephrase, is this actually a fix, or is this some readability/ordering improvement patch ?

Yes, it's a fix because randconfig finds problems that users may stumble on to while trying to make a valid config for a platform.

Is the commit message telling me, that "config USB_GADGET_DUALSPEED" is moved outside of the "if USB_GADGET" block ?

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Because if this is something else, and the symbols are simply reordered, that I do not understand how this could be fixing anything.

I'm unclear what else you need to know to take this bugfix. The symbol is not placed correctly, leading to possibly unmet dependency errors.

Why do you think the symbol is placed incorrectly ?

Because we wouldn't get a Kconfig unmet dependency error if it was correctly placed.

Quoted 3 lines

What this change does, is it moves "config USB_GADGET_DUALSPEED" outside of the "if USB_GADGET" block in drivers/usb/gadget/Kconfig , which the commit message should clearly spell out.

I could reword "As this is a hidden symbol, move it up within the menu." more, sure.

Quoted 33 lines

However , I believe that is not the correct fix. The USB_GADGET_DUALSPEED has to be available only if USB_GADGET or SPL_USB_GADGET is selected, the former is already satisfied, the later is not and the SPL_USB_CDNS3_GADGET triggers a problem here. I think this is the correct fix:

"

drivers/usb/gadget/Kconfig +8 -4
index ebb306852a6..87d17780c45 100644
@@ -178,10 +178,6 @@ config SDP_LOADADDR
        hex "Default load address at SDP_WRITE and SDP_JUMP"
        default 0x0
 
-# Selected by UDC drivers that support high-speed operation.
-config USB_GADGET_DUALSPEED
-       bool
-
 config USB_GADGET_DOWNLOAD
        bool "Enable USB download gadget"
        help
@@ -371,3 +367,11 @@ config SPL_SDP_USB_DEV
          so it can be used in compiled environment.
 
 endif # SPL_USB_GADGET
+
+if USB_GADGET || SPL_USB_GADGET
+
+# Selected by UDC drivers that support high-speed operation.
+config USB_GADGET_DUALSPEED
+       bool
+
+endif
Quoted 1 line

"

You don't need to guard hidden symbols. But this also probably also works, so yes, please post that as a proper patch and I'll go Changes Requested mine.

Quoted 4 lines
Quoted 3 lines

Yes, the error is discovered by randconfig which makes it harder to describe how exactly to reproduce it (but I believe it does), but that doesn't make it any less valid.

This part is not relevant.

Well it's been unclear to me what you do and don't see as a valid problem with this and the other patch.

Signature · 1 line
Tom
#9 lore raw

On 3/20/26 2:53 PM, Tom Rini wrote:

[...]

Quoted 15 lines
Quoted 12 lines
drivers/usb/gadget/Kconfig +8 -0
@@ -371,3 +367,11 @@ config SPL_SDP_USB_DEV
           so it can be used in compiled environment.
 
  endif # SPL_USB_GADGET
+
+if USB_GADGET || SPL_USB_GADGET
+
+# Selected by UDC drivers that support high-speed operation.
+config USB_GADGET_DUALSPEED
+       bool
+
+endif
Quoted 1 line

"

You don't need to guard hidden symbols.

We also do not want to expose this Kconfig symbol unless it makes sense to expose it ? In fact, if the symbol is not available and someone attempts to use it in Kconfig, they would get a warning, which should provide a clue that they are doing something wrong ?

author Reviewed-by
#10 lore raw
Quoted 20 lines · Marek Vasut

On 3/20/26 2:53 PM, Tom Rini wrote:

[...]

Quoted 15 lines
Quoted 12 lines
drivers/usb/gadget/Kconfig +8 -0
@@ -371,3 +367,11 @@ config SPL_SDP_USB_DEV
           so it can be used in compiled environment.
 
  endif # SPL_USB_GADGET
+
+if USB_GADGET || SPL_USB_GADGET
+
+# Selected by UDC drivers that support high-speed operation.
+config USB_GADGET_DUALSPEED
+       bool
+
+endif
Quoted 1 line

"

You don't need to guard hidden symbols.

Quoted 4 lines

We also do not want to expose this Kconfig symbol unless it makes sense to expose it ? In fact, if the symbol is not available and someone attempts to use it in Kconfig, they would get a warning, which should provide a clue that they are doing something wrong ?

It's a hidden symbol, so it's not exposed to the user. The problem is that today someone is getting it wrong as you suggest but it's hard to trigger a warning over it. That said, your patch also fixes the problem, so:

Signature · 1 line
Tom
#11 lore raw
Quoted 26 lines · Tom Rini
Quoted 20 lines · Marek Vasut

On 3/20/26 2:53 PM, Tom Rini wrote:

[...]

Quoted 15 lines
Quoted 12 lines
drivers/usb/gadget/Kconfig +8 -0
@@ -371,3 +367,11 @@ config SPL_SDP_USB_DEV
            so it can be used in compiled environment.
 
   endif # SPL_USB_GADGET
+
+if USB_GADGET || SPL_USB_GADGET
+
+# Selected by UDC drivers that support high-speed operation.
+config USB_GADGET_DUALSPEED
+       bool
+
+endif
Quoted 1 line

"

You don't need to guard hidden symbols.

Quoted 4 lines

We also do not want to expose this Kconfig symbol unless it makes sense to expose it ? In fact, if the symbol is not available and someone attempts to use it in Kconfig, they would get a warning, which should provide a clue that they are doing something wrong ?

Quoted 6 lines

It's a hidden symbol, so it's not exposed to the user. The problem is that today someone is getting it wrong as you suggest but it's hard to trigger a warning over it. That said, your patch also fixes the problem, so:

Can you send that as a V2 please ?

Thank you

author
#12 lore raw

PATCH v2 1/1 usb: gadget: Move USB_GADGET_DUALSPEED to be slightly more visible

In reply to Tom Rini

As exposed by "make randconfig", we have an issue around USB_GADGET_DUALSPEED. It is possible to select this symbol (via SPL_USB_CDNS3_GADGET for example) and so have an unmet dependency due to how this symbol is placed today. Move this to it's own section of the file guarded by USB_GADGET || SPL_USB_GADGET.

---
Changes in v2:
- Implement this move as suggested by Marek instead

Cc Mattijs Korpershoek <[email protected]>
Cc Marek Vasut <[email protected]>
---
 drivers/usb/gadget/Kconfig | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/usb/gadget/Kconfig +8 -4
index baa2eb61ea33..2f79840df18c 100644
@@ -179,10 +179,6 @@ config SDP_LOADADDR
 	hex "Default load address at SDP_WRITE and SDP_JUMP"
 	default 0x0
 
-# Selected by UDC drivers that support high-speed operation.
-config USB_GADGET_DUALSPEED
-	bool
-
 config USB_GADGET_DOWNLOAD
 	bool "Enable USB download gadget"
 	help
@@ -372,3 +368,11 @@ config SPL_SDP_USB_DEV
 	  so it can be used in compiled environment.
 
 endif # SPL_USB_GADGET
+
+if USB_GADGET || SPL_USB_GADGET
+
+# Selected by UDC drivers that support high-speed operation.
+config USB_GADGET_DUALSPEED
+	bool
+
+endif
Signature · 1 line
2.43.0
Reviewed-by on v2 1/1
#13 lore raw
Quoted 7 lines · Tom Rini

As exposed by "make randconfig", we have an issue around USB_GADGET_DUALSPEED. It is possible to select this symbol (via SPL_USB_CDNS3_GADGET for example) and so have an unmet dependency due to how this symbol is placed today. Move this to it's own section of the file guarded by USB_GADGET || SPL_USB_GADGET.

Reviewed-by on v2 1/1
#14 lore raw
In reply to Tom Rini

Hi Tom,

Thank you for the patch.

Quoted 7 lines · Tom Rini

As exposed by "make randconfig", we have an issue around USB_GADGET_DUALSPEED. It is possible to select this symbol (via SPL_USB_CDNS3_GADGET for example) and so have an unmet dependency due to how this symbol is placed today. Move this to it's own section of the file guarded by USB_GADGET || SPL_USB_GADGET.

Quoted 39 lines

---
Changes in v2:
- Implement this move as suggested by Marek instead

Cc Mattijs Korpershoek <[email protected]>
Cc Marek Vasut <[email protected]>
---
 drivers/usb/gadget/Kconfig | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/usb/gadget/Kconfig +8 -4
index baa2eb61ea33..2f79840df18c 100644
@@ -179,10 +179,6 @@ config SDP_LOADADDR
 	hex "Default load address at SDP_WRITE and SDP_JUMP"
 	default 0x0
 
-# Selected by UDC drivers that support high-speed operation.
-config USB_GADGET_DUALSPEED
-	bool
-
 config USB_GADGET_DOWNLOAD
 	bool "Enable USB download gadget"
 	help
@@ -372,3 +368,11 @@ config SPL_SDP_USB_DEV
 	  so it can be used in compiled environment.
 
 endif # SPL_USB_GADGET
+
+if USB_GADGET || SPL_USB_GADGET
+
+# Selected by UDC drivers that support high-speed operation.
+config USB_GADGET_DUALSPEED
+	bool
+
+endif
Signature · 1 line
2.43.0
#15 lore raw
In reply to Tom Rini

Hi,

Quoted 8 lines · Tom Rini

As exposed by "make randconfig", we have an issue around USB_GADGET_DUALSPEED. It is possible to select this symbol (via SPL_USB_CDNS3_GADGET for example) and so have an unmet dependency due to how this symbol is placed today. Move this to it's own section of the file guarded by USB_GADGET || SPL_USB_GADGET.

[...]

Thanks, Applied to https://source.denx.de/u-boot/custodians/u-boot-dfu (u-boot-dfu)

[1/1] usb: gadget: Move USB_GADGET_DUALSPEED to be slightly more visible

      https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/ace0e8034982fedb4ef75b8adcd97c1af063a990

--
Mattijs