linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Revert "usb: gadget: Quieten gadget config message"
@ 2021-01-07  9:06 Albert Wang
  2021-01-07  9:17 ` Felipe Balbi
  2021-01-07  9:50 ` Greg KH
  0 siblings, 2 replies; 5+ messages in thread
From: Albert Wang @ 2021-01-07  9:06 UTC (permalink / raw)
  To: balbi, gregkh, linux-usb, linux-kernel; +Cc: Albert Wang

This reverts commit 1cbfb8c4f62d667f6b8b3948949737edb92992cc.

The log of USB enumeration result is a useful log and only occupies
one line especially when USB3 enumeration failed and then downgrade
to USB2.

Signed-off-by: Albert Wang <albertccwang@google.com>
---
 drivers/usb/gadget/composite.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index c6d455f2bb92..5b0d6103a63d 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -840,9 +840,9 @@ static int set_config(struct usb_composite_dev *cdev,
 		result = 0;
 	}
 
-	DBG(cdev, "%s config #%d: %s\n",
-	    usb_speed_string(gadget->speed),
-	    number, c ? c->label : "unconfigured");
+	INFO(cdev, "%s config #%d: %s\n",
+	     usb_speed_string(gadget->speed),
+	     number, c ? c->label : "unconfigured");
 
 	if (!c)
 		goto done;
-- 
2.29.2.684.gfbc64c5ab5-goog


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

* Re: [PATCH] Revert "usb: gadget: Quieten gadget config message"
  2021-01-07  9:06 [PATCH] Revert "usb: gadget: Quieten gadget config message" Albert Wang
@ 2021-01-07  9:17 ` Felipe Balbi
  2021-01-07  9:50 ` Greg KH
  1 sibling, 0 replies; 5+ messages in thread
From: Felipe Balbi @ 2021-01-07  9:17 UTC (permalink / raw)
  To: Albert Wang, gregkh, linux-usb, linux-kernel; +Cc: Albert Wang

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


Hi,

Albert Wang <albertccwang@google.com> writes:
> This reverts commit 1cbfb8c4f62d667f6b8b3948949737edb92992cccd.
>
> The log of USB enumeration result is a useful log and only occupies
> one line especially when USB3 enumeration failed and then downgrade
> to USB2.
>
> Signed-off-by: Albert Wang <albertccwang@google.com>

you can use dynamic debug to enable it whenever you're testing.

-- 
balbi

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

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

* Re: [PATCH] Revert "usb: gadget: Quieten gadget config message"
  2021-01-07  9:06 [PATCH] Revert "usb: gadget: Quieten gadget config message" Albert Wang
  2021-01-07  9:17 ` Felipe Balbi
@ 2021-01-07  9:50 ` Greg KH
  2021-01-08  2:16   ` Peter Chen
  1 sibling, 1 reply; 5+ messages in thread
From: Greg KH @ 2021-01-07  9:50 UTC (permalink / raw)
  To: Albert Wang; +Cc: balbi, linux-usb, linux-kernel

On Thu, Jan 07, 2021 at 09:06:04AM +0000, Albert Wang wrote:
> This reverts commit 1cbfb8c4f62d667f6b8b3948949737edb92992cc.
> 
> The log of USB enumeration result is a useful log and only occupies
> one line especially when USB3 enumeration failed and then downgrade
> to USB2.
> 
> Signed-off-by: Albert Wang <albertccwang@google.com>
> ---
>  drivers/usb/gadget/composite.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
> index c6d455f2bb92..5b0d6103a63d 100644
> --- a/drivers/usb/gadget/composite.c
> +++ b/drivers/usb/gadget/composite.c
> @@ -840,9 +840,9 @@ static int set_config(struct usb_composite_dev *cdev,
>  		result = 0;
>  	}
>  
> -	DBG(cdev, "%s config #%d: %s\n",
> -	    usb_speed_string(gadget->speed),
> -	    number, c ? c->label : "unconfigured");
> +	INFO(cdev, "%s config #%d: %s\n",
> +	     usb_speed_string(gadget->speed),
> +	     number, c ? c->label : "unconfigured");

When everything is working properly, the kernel should be quiet.  If you
have to see this message, you can turn it on at runtime, as Felipe
pointed out, to enable it for your system.  But it's not a good default
thing to have.

What do you need to see this message for?  What tool relies on it?  Who
reads it?

thanks,

greg k-h

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

* Re: [PATCH] Revert "usb: gadget: Quieten gadget config message"
  2021-01-07  9:50 ` Greg KH
@ 2021-01-08  2:16   ` Peter Chen
  2021-01-08  3:43     ` Albert Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Chen @ 2021-01-08  2:16 UTC (permalink / raw)
  To: Greg KH; +Cc: Albert Wang, balbi, linux-usb, linux-kernel

On 21-01-07 10:50:38, Greg KH wrote:
> On Thu, Jan 07, 2021 at 09:06:04AM +0000, Albert Wang wrote:
> > This reverts commit 1cbfb8c4f62d667f6b8b3948949737edb92992cc.
> > 
> > The log of USB enumeration result is a useful log and only occupies
> > one line especially when USB3 enumeration failed and then downgrade
> > to USB2.
> > 
> > Signed-off-by: Albert Wang <albertccwang@google.com>
> > ---
> >  drivers/usb/gadget/composite.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
> > index c6d455f2bb92..5b0d6103a63d 100644
> > --- a/drivers/usb/gadget/composite.c
> > +++ b/drivers/usb/gadget/composite.c
> > @@ -840,9 +840,9 @@ static int set_config(struct usb_composite_dev *cdev,
> >  		result = 0;
> >  	}
> >  
> > -	DBG(cdev, "%s config #%d: %s\n",
> > -	    usb_speed_string(gadget->speed),
> > -	    number, c ? c->label : "unconfigured");
> > +	INFO(cdev, "%s config #%d: %s\n",
> > +	     usb_speed_string(gadget->speed),
> > +	     number, c ? c->label : "unconfigured");
> 
> When everything is working properly, the kernel should be quiet.  If you
> have to see this message, you can turn it on at runtime, as Felipe
> pointed out, to enable it for your system.  But it's not a good default
> thing to have.

For most production kernel (or kernel ready for customers), it may not enable
CONFIG_DYNAMIC_DEBUG.

> 
> What do you need to see this message for?  What tool relies on it?  Who
> reads it?
> 

Usually, the developer him(her)self wants to read it to know if current
USB gadget enumerated and what speed is recognized, reading from the
console by eyes is the quickest way. Without this message, there is no
any messages when the USB gadget connects to host.

If enable debug message, there are too many messages, but I think most
developers may only need one information message to know if enumeration
is established correctly.

-- 

Thanks,
Peter Chen


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

* Re: [PATCH] Revert "usb: gadget: Quieten gadget config message"
  2021-01-08  2:16   ` Peter Chen
@ 2021-01-08  3:43     ` Albert Wang
  0 siblings, 0 replies; 5+ messages in thread
From: Albert Wang @ 2021-01-08  3:43 UTC (permalink / raw)
  To: Peter Chen; +Cc: Greg KH, balbi, linux-usb, linux-kernel

> Usually, the developer him(her)self wants to read it to know if current
> USB gadget enumerated and what speed is recognized, reading from the
> console by eyes is the quickest way. Without this message, there is no
> any messages when the USB gadget connects to host.
Yes, especially when enumeration USB3 failed then downgrade to USB2.

> If enable debug message, there are too many messages,
This is the reason why it is not a good solution, when I just need to
confirm what the enumeration result is.

--
Thanks,
Albert

On Fri, Jan 8, 2021 at 10:16 AM Peter Chen <hzpeterchen@gmail.com> wrote:
>
> On 21-01-07 10:50:38, Greg KH wrote:
> > On Thu, Jan 07, 2021 at 09:06:04AM +0000, Albert Wang wrote:
> > > This reverts commit 1cbfb8c4f62d667f6b8b3948949737edb92992cc.
> > >
> > > The log of USB enumeration result is a useful log and only occupies
> > > one line especially when USB3 enumeration failed and then downgrade
> > > to USB2.
> > >
> > > Signed-off-by: Albert Wang <albertccwang@google.com>
> > > ---
> > >  drivers/usb/gadget/composite.c | 6 +++---
> > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
> > > index c6d455f2bb92..5b0d6103a63d 100644
> > > --- a/drivers/usb/gadget/composite.c
> > > +++ b/drivers/usb/gadget/composite.c
> > > @@ -840,9 +840,9 @@ static int set_config(struct usb_composite_dev *cdev,
> > >             result = 0;
> > >     }
> > >
> > > -   DBG(cdev, "%s config #%d: %s\n",
> > > -       usb_speed_string(gadget->speed),
> > > -       number, c ? c->label : "unconfigured");
> > > +   INFO(cdev, "%s config #%d: %s\n",
> > > +        usb_speed_string(gadget->speed),
> > > +        number, c ? c->label : "unconfigured");
> >
> > When everything is working properly, the kernel should be quiet.  If you
> > have to see this message, you can turn it on at runtime, as Felipe
> > pointed out, to enable it for your system.  But it's not a good default
> > thing to have.
>
> For most production kernel (or kernel ready for customers), it may not enable
> CONFIG_DYNAMIC_DEBUG.
>
> >
> > What do you need to see this message for?  What tool relies on it?  Who
> > reads it?
> >
>
> Usually, the developer him(her)self wants to read it to know if current
> USB gadget enumerated and what speed is recognized, reading from the
> console by eyes is the quickest way. Without this message, there is no
> any messages when the USB gadget connects to host.
>
> If enable debug message, there are too many messages, but I think most
> developers may only need one information message to know if enumeration
> is established correctly.
>
> --
>
> Thanks,
> Peter Chen
>

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

end of thread, other threads:[~2021-01-08  3:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-07  9:06 [PATCH] Revert "usb: gadget: Quieten gadget config message" Albert Wang
2021-01-07  9:17 ` Felipe Balbi
2021-01-07  9:50 ` Greg KH
2021-01-08  2:16   ` Peter Chen
2021-01-08  3:43     ` Albert Wang

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