Skip to contentSkip to conversation

usb: dwc2: more precise and helpful message for dr_mode config issues

PATCH Applied Enrico Jorns 3 participants 3 messages May 17, 2021 – May 18, 2021

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

PATCH 1/1 usb: dwc2: more precise and helpful message for dr_mode config issues

With the previous message I misunderstood that the 'configuration mismatch' was caused by any entity forcing the dr_mode to 'host'/'device'.
The actual intention however is to tell the user that the selected 'dr_mode' does not match the capabilities provided by the controller or the selected driver parts (USB_DWC2_HOST/USB_DWC2_GADGET).

The updated warning message attempts to reflect this more explicitly.

Also rename 'device' to 'peripheral' as it is named both in dtb and in macros that way.

---
 drivers/usb/dwc2/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/dwc2/core.c +2 -2
index cc5729ed92..6dfe14f174 100644
@@ -672,8 +672,8 @@ int dwc2_get_dr_mode(struct dwc2 *dwc2)
 
 	if (mode != dwc2->dr_mode) {
 		dwc2_warn(dwc2,
-			 "Configuration mismatch. dr_mode forced to %s\n",
-			mode == USB_DR_MODE_HOST ? "host" : "device");
+			 "Selected dr_mode not supported by controller/driver. Enforcing '%s' mode.\n",
+			mode == USB_DR_MODE_HOST ? "host" : "peripheral");
 
 		dwc2->dr_mode = mode;
 	}
Signature · 7 lines
2.29.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Enrico Jorns

With the previous message I misunderstood that the 'configuration mismatch' was caused by any entity forcing the dr_mode to 'host'/'device'.
The actual intention however is to tell the user that the selected 'dr_mode' does not match the capabilities provided by the controller or the selected driver parts (USB_DWC2_HOST/USB_DWC2_GADGET).

Quoted 6 lines

The updated warning message attempts to reflect this more explicitly.

Also rename 'device' to 'peripheral' as it is named both in dtb and in macros that way.

Quoted 20 lines
---
 drivers/usb/dwc2/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/dwc2/core.c +2 -2
index cc5729ed92..6dfe14f174 100644
@@ -672,8 +672,8 @@ int dwc2_get_dr_mode(struct dwc2 *dwc2)
 
 	if (mode != dwc2->dr_mode) {
 		dwc2_warn(dwc2,
-			 "Configuration mismatch. dr_mode forced to %s\n",
-			mode == USB_DR_MODE_HOST ? "host" : "device");
+			 "Selected dr_mode not supported by controller/driver. Enforcing '%s' mode.\n",
+			mode == USB_DR_MODE_HOST ? "host" : "peripheral");
 
 		dwc2->dr_mode = mode;
 	}
Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#2 lore raw
In reply to Enrico Jorns
Quoted 9 lines · Enrico Jorns

With the previous message I misunderstood that the 'configuration mismatch' was caused by any entity forcing the dr_mode to 'host'/'device'.
The actual intention however is to tell the user that the selected 'dr_mode' does not match the capabilities provided by the controller or the selected driver parts (USB_DWC2_HOST/USB_DWC2_GADGET).

The updated warning message attempts to reflect this more explicitly.

Quoted 7 lines

Also rename 'device' to 'peripheral' as it is named both in dtb and in macros that way.

---
 drivers/usb/dwc2/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox