Skip to contentSkip to conversation

Revert "usb: gadget: Quieten gadget config message"

PATCH In review Albert Wang 4 participants 5 messages Jan 7, 2021 – Jan 8, 2021 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "usb: gadget: Quieten gadget config message"

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.

---
 drivers/usb/gadget/composite.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/usb/gadget/composite.c +3 -3
index c6d455f2bb92..5b0d6103a63d 100644
@@ -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;
Signature · 1 line
2.29.2.684.gfbc64c5ab5-goog
#1 lore raw

Hi,

Quoted 7 lines · Albert Wang

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.

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

Signature · 1 line
balbi
maintainer
#2 lore raw
In reply to Albert Wang
Quoted 16 lines · 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.

---
 drivers/usb/gadget/composite.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/usb/gadget/composite.c +0 -0
index c6d455f2bb92..5b0d6103a63d 100644

drivers/usb/gadget/composite.c static int set_config(struct usb_composite_dev *cdev, · line 845

Quoted 9 lines
drivers/usb/gadget/composite.c +3 -3
@@ -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

#3 lore raw
Quoted 20 lines · Greg KH
Quoted 19 lines · 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.

---
 drivers/usb/gadget/composite.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/usb/gadget/composite.c +0 -0
index c6d455f2bb92..5b0d6103a63d 100644
@@ -840,9 +840,9 @@ static int set_config(struct usb_composite_dev *cdev,
 		result = 0;
 	}
 
Quoted 11 lines

drivers/usb/gadget/composite.c static int set_config(struct usb_composite_dev *cdev, · line 845

Quoted 6 lines
drivers/usb/gadget/composite.c +3 -3
-	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.

Quoted 4 lines

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.

Signature · 2 lines
Thanks,
Peter Chen
#4 lore raw
Quoted 4 lines

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.

Quoted 1 line

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

Quoted 56 lines · Peter Chen
Quoted 20 lines · Greg KH
Quoted 19 lines · 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.

---
 drivers/usb/gadget/composite.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/usb/gadget/composite.c +0 -0
index c6d455f2bb92..5b0d6103a63d 100644
@@ -840,9 +840,9 @@ static int set_config(struct usb_composite_dev *cdev,
            result = 0;
    }
 
Quoted 11 lines

drivers/usb/gadget/composite.c static int set_config(struct usb_composite_dev *cdev, · line 845

Quoted 6 lines
drivers/usb/gadget/composite.c +3 -3
-   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.

Quoted 4 lines

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