mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] usb: dwc2: more precise and helpful message for dr_mode config issues
@ 2021-05-17 12:49 Enrico Jorns
  2021-05-17 12:51 ` Ahmad Fatoum
  2021-05-18  6:34 ` Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Enrico Jorns @ 2021-05-17 12:49 UTC (permalink / raw)
  To: barebox; +Cc: Enrico Jörns, afa

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.

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
---
 drivers/usb/dwc2/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c
index cc5729ed92..6dfe14f174 100644
--- a/drivers/usb/dwc2/core.c
+++ b/drivers/usb/dwc2/core.c
@@ -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;
 	}
-- 
2.29.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [PATCH] usb: dwc2: more precise and helpful message for dr_mode config issues
  2021-05-17 12:49 [PATCH] usb: dwc2: more precise and helpful message for dr_mode config issues Enrico Jorns
@ 2021-05-17 12:51 ` Ahmad Fatoum
  2021-05-18  6:34 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2021-05-17 12:51 UTC (permalink / raw)
  To: Enrico Jorns, barebox; +Cc: afa

On 17.05.21 14:49, Enrico Jorns wrote:
> 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.
> 
> Signed-off-by: Enrico Jorns <ejo@pengutronix.de>

Acked-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

> ---
>  drivers/usb/dwc2/core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c
> index cc5729ed92..6dfe14f174 100644
> --- a/drivers/usb/dwc2/core.c
> +++ b/drivers/usb/dwc2/core.c
> @@ -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;
>  	}
> 

-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [PATCH] usb: dwc2: more precise and helpful message for dr_mode config issues
  2021-05-17 12:49 [PATCH] usb: dwc2: more precise and helpful message for dr_mode config issues Enrico Jorns
  2021-05-17 12:51 ` Ahmad Fatoum
@ 2021-05-18  6:34 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2021-05-18  6:34 UTC (permalink / raw)
  To: Enrico Jorns; +Cc: barebox, afa

On Mon, May 17, 2021 at 02:49:41PM +0200, Enrico Jorns wrote:
> 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.
> 
> Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
> ---
>  drivers/usb/dwc2/core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks

Sascha

-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

end of thread, other threads:[~2021-05-18  6:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-17 12:49 [PATCH] usb: dwc2: more precise and helpful message for dr_mode config issues Enrico Jorns
2021-05-17 12:51 ` Ahmad Fatoum
2021-05-18  6:34 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox