Skip to contentSkip to conversation

usb: core: Kconfig: refine the description for CONFIG_USB_OTG

PATCH New Peter Chen 3 participants 6 messages May 13, 2014 – May 14, 2014 USB

lore
Share & tools
lore

Peter Chen

author
#0 lore raw

PATCH 1/1 usb: core: Kconfig: refine the description for CONFIG_USB_OTG

the user should only select it when the board supports HNP and SRP, it should NOT be selected if the board only supports dual-role switch through ID pin.

There is a discussion for it:
http://marc.info/?l=linux-arm-kernel&m=139994896101516&w=2
http://marc.info/?l=linux-usb&m=139994881701504&w=2

---
 drivers/usb/core/Kconfig |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
drivers/usb/core/Kconfig +7 -5
index cb8e991..158048b 100644
@@ -54,13 +54,15 @@ config USB_OTG
 	default n
 	help
 	  The most notable feature of USB OTG is support for a
-	  "Dual-Role" device, which can act as either a device
-	  or a host. The initial role is decided by the type of
-	  plug inserted and can be changed later when two dual
-	  role devices talk to each other.
+	  otg device, which can act as either a device or a host.
+	  The initial role is decided by the type of plug inserted
+	  and can be changed using HNP (Host Negotiation Protocol)
+	  later when two otg devices talk to each other.
 
 	  Select this only if your board has Mini-AB/Micro-AB
-	  connector.
+	  connector and supports HNP and SRP (Session Request Protocol).
+	  If the board only supports dual-role switch through ID
+	  pin, this configuration should not be selected.
 
 config USB_OTG_WHITELIST
 	bool "Rely on OTG Targeted Peripherals List"
Signature · 1 line
1.7.8
maintainer
#1 lore raw

PATCH 1/1 usb: core: Kconfig: refine the description for CONFIG_USB_OTG

Quoted 25 lines · Peter Chen

the user should only select it when the board supports HNP and SRP, it should NOT be selected if the board only supports dual-role switch through ID pin.

There is a discussion for it:
http://marc.info/?l=linux-arm-kernel&m=139994896101516&w=2
http://marc.info/?l=linux-usb&m=139994881701504&w=2

---
 drivers/usb/core/Kconfig |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
drivers/usb/core/Kconfig +0 -4
index cb8e991..158048b 100644
@@ -54,13 +54,15 @@ config USB_OTG
 	default n
 	help
 	  The most notable feature of USB OTG is support for a
-	  "Dual-Role" device, which can act as either a device
-	  or a host. The initial role is decided by the type of
-	  plug inserted and can be changed later when two dual
-	  role devices talk to each other.

drivers/usb/core/Kconfig config USB_OTG · line 65

Quoted 10 lines
drivers/usb/core/Kconfig +7 -1
+	  otg device, which can act as either a device or a host.
+	  The initial role is decided by the type of plug inserted
+	  and can be changed using HNP (Host Negotiation Protocol)
+	  later when two otg devices talk to each other.
 
 	  Select this only if your board has Mini-AB/Micro-AB
-	  connector.
+	  connector and supports HNP and SRP (Session Request Protocol).
+	  If the board only supports dual-role switch through ID
+	  pin, this configuration should not be selected.

That's really lame. What happened to our "all modconfig should work" goal? Why can't you dynamically detect that this is not a config that works and handle it?

And this is just the OTG "core", not any specific hardware, so why should it matter?

greg k-h

#2 lore raw

PATCH 1/1 usb: core: Kconfig: refine the description for CONFIG_USB_OTG

Quoted 41 lines · Greg KH
Quoted 25 lines · Peter Chen

the user should only select it when the board supports HNP and SRP, it should NOT be selected if the board only supports dual-role switch through ID pin.

There is a discussion for it:
http://marc.info/?l=linux-arm-kernel&m=139994896101516&w=2
http://marc.info/?l=linux-usb&m=139994881701504&w=2

---
 drivers/usb/core/Kconfig |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
drivers/usb/core/Kconfig +0 -4
index cb8e991..158048b 100644
@@ -54,13 +54,15 @@ config USB_OTG
 	default n
 	help
 	  The most notable feature of USB OTG is support for a
-	  "Dual-Role" device, which can act as either a device
-	  or a host. The initial role is decided by the type of
-	  plug inserted and can be changed later when two dual
-	  role devices talk to each other.

drivers/usb/core/Kconfig config USB_OTG · line 65

Quoted 10 lines
drivers/usb/core/Kconfig +7 -1
+	  otg device, which can act as either a device or a host.
+	  The initial role is decided by the type of plug inserted
+	  and can be changed using HNP (Host Negotiation Protocol)
+	  later when two otg devices talk to each other.
 
 	  Select this only if your board has Mini-AB/Micro-AB
-	  connector.
+	  connector and supports HNP and SRP (Session Request Protocol).
+	  If the board only supports dual-role switch through ID
+	  pin, this configuration should not be selected.

That's really lame. What happened to our "all modconfig should work" goal? Why can't you dynamically detect that this is not a config that works and handle it?

Quoted 2 lines

And this is just the OTG "core", not any specific hardware, so why should it matter?

yeah, I'm with Greg here... we should find a better way to sort this out.

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

PATCH 1/1 usb: core: Kconfig: refine the description for CONFIG_USB_OTG

Quoted 34 lines · Greg KH
Quoted 31 lines · Peter Chen
Quoted 30 lines

the user should only select it when the board supports HNP and SRP, it should NOT be selected if the board only supports dual-role switch through ID pin.

There is a discussion for it:
http://marc.info/?l=linux-arm-kernel&m=139994896101516&w=2
http://marc.info/?l=linux-usb&m=139994881701504&w=2

---
 drivers/usb/core/Kconfig |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
drivers/usb/core/Kconfig +4 -4
index cb8e991..158048b 100644
@@ -54,13 +54,15 @@ config USB_OTG
 	default n
 	help
 	  The most notable feature of USB OTG is support for a
-	  "Dual-Role" device, which can act as either a device
-	  or a host. The initial role is decided by the type of
-	  plug inserted and can be changed later when two dual
-	  role devices talk to each other.
+	  otg device, which can act as either a device or a host.
+	  The initial role is decided by the type of plug inserted
+	  and can be changed using HNP (Host Negotiation Protocol)
+	  later when two otg devices talk to each other.
 
Quoted 10 lines
Quoted 10 lines

drivers/usb/core/Kconfig config USB_OTG · line 65

Quoted 5 lines
drivers/usb/core/Kconfig +3 -1
 	  Select this only if your board has Mini-AB/Micro-AB
-	  connector.
+	  connector and supports HNP and SRP (Session Request Protocol).
+	  If the board only supports dual-role switch through ID
+	  pin, this configuration should not be selected.

That's really lame. What happened to our "all modconfig should work" goal? Why can't you dynamically detect that this is not a config that works and handle it?

If CONFIG_USB_OTG and CONFIG_USB_OTG_WHITELIST are set, most of usb devices will not work when connect to host for current code.

So, we need a feature flag for hcd and gadget, and set this OTG feature flag if the platform supports it (using dtb or platform data).

Peter

Quoted 7 lines
Quoted 2 lines

And this is just the OTG "core", not any specific hardware, so why should it matter?

yeah, I'm with Greg here... we should find a better way to sort this out.

--
balbi

maintainer
#4 lore raw

PATCH 1/1 usb: core: Kconfig: refine the description for CONFIG_USB_OTG

Quoted 45 lines · Peter Chen
Quoted 34 lines · Greg KH
Quoted 31 lines · Peter Chen
Quoted 30 lines

the user should only select it when the board supports HNP and SRP, it should NOT be selected if the board only supports dual-role switch through ID pin.

There is a discussion for it:
http://marc.info/?l=linux-arm-kernel&m=139994896101516&w=2
http://marc.info/?l=linux-usb&m=139994881701504&w=2

---
 drivers/usb/core/Kconfig |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
drivers/usb/core/Kconfig +4 -4
index cb8e991..158048b 100644
@@ -54,13 +54,15 @@ config USB_OTG
 	default n
 	help
 	  The most notable feature of USB OTG is support for a
-	  "Dual-Role" device, which can act as either a device
-	  or a host. The initial role is decided by the type of
-	  plug inserted and can be changed later when two dual
-	  role devices talk to each other.
+	  otg device, which can act as either a device or a host.
+	  The initial role is decided by the type of plug inserted
+	  and can be changed using HNP (Host Negotiation Protocol)
+	  later when two otg devices talk to each other.
 
Quoted 10 lines
Quoted 10 lines

drivers/usb/core/Kconfig config USB_OTG · line 65

Quoted 5 lines
drivers/usb/core/Kconfig +3 -1
 	  Select this only if your board has Mini-AB/Micro-AB
-	  connector.
+	  connector and supports HNP and SRP (Session Request Protocol).
+	  If the board only supports dual-role switch through ID
+	  pin, this configuration should not be selected.

That's really lame. What happened to our "all modconfig should work" goal? Why can't you dynamically detect that this is not a config that works and handle it?

Quoted 5 lines

If CONFIG_USB_OTG and CONFIG_USB_OTG_WHITELIST are set, most of usb devices will not work when connect to host for current code.

So, we need a feature flag for hcd and gadget, and set this OTG feature flag if the platform supports it (using dtb or platform data).

Sounds reasonable, and much nicer than just trying to point to a help configuration file that no one will ever read :)

greg k-h

#5 lore raw

PATCH 1/1 usb: core: Kconfig: refine the description for CONFIG_USB_OTG

Quoted 46 lines · Greg KH
Quoted 45 lines · Peter Chen
Quoted 44 lines · Greg KH
Quoted 41 lines · Peter Chen
Quoted 25 lines

the user should only select it when the board supports HNP and SRP, it should NOT be selected if the board only supports dual-role switch through ID pin.

There is a discussion for it:
http://marc.info/?l=linux-arm-kernel&m=139994896101516&w=2
http://marc.info/?l=linux-usb&m=139994881701504&w=2

---
 drivers/usb/core/Kconfig |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
drivers/usb/core/Kconfig +0 -4
index cb8e991..158048b 100644
@@ -54,13 +54,15 @@ config USB_OTG
 	default n
 	help
 	  The most notable feature of USB OTG is support for a
-	  "Dual-Role" device, which can act as either a device
-	  or a host. The initial role is decided by the type of
-	  plug inserted and can be changed later when two dual
-	  role devices talk to each other.

drivers/usb/core/Kconfig config USB_OTG · line 65

Quoted 10 lines
drivers/usb/core/Kconfig +7 -1
+	  otg device, which can act as either a device or a host.
+	  The initial role is decided by the type of plug inserted
+	  and can be changed using HNP (Host Negotiation Protocol)
+	  later when two otg devices talk to each other.
 
 	  Select this only if your board has Mini-AB/Micro-AB
-	  connector.
+	  connector and supports HNP and SRP (Session Request Protocol).
+	  If the board only supports dual-role switch through ID
+	  pin, this configuration should not be selected.

That's really lame. What happened to our "all modconfig should work" goal? Why can't you dynamically detect that this is not a config that works and handle it?

Quoted 8 lines
Quoted 5 lines

If CONFIG_USB_OTG and CONFIG_USB_OTG_WHITELIST are set, most of usb devices will not work when connect to host for current code.

So, we need a feature flag for hcd and gadget, and set this OTG feature flag if the platform supports it (using dtb or platform data).

Sounds reasonable, and much nicer than just trying to point to a help configuration file that no one will ever read :)

yeah, the way OTG Whitelist was implemented is pretty brain dead because it prevents anybody from e.g. making an accessory to a smartphone and shipping a driver together with an app.

That part of the code needs a complete rewrite, what we need is to use the bus match to notify that a device is compatible, then everytime a new driver is installed, that new device will just work.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140514/2ca59049/attachment.sig>