Skip to contentSkip to conversation

usb: dwc3: gadget: Remove dev_err() when queuing to inactive gadget/ep

PATCH Superseded Wesley Cheng 3 participants 4 messages Oct 14, 2021 – Oct 18, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: dwc3: gadget: Remove dev_err() when queuing to inactive gadget/ep

Since function drivers will still be active until dwc3_disconnect_gadget() is called, some applications will continue to queue packets to DWC3 gadget. This can lead to a flood of messages regarding failed ep queue, as the endpoint is in the process of being disabled. Remove the print as function drivers will likely log queuing errors as well.

---
 drivers/usb/dwc3/gadget.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/usb/dwc3/gadget.c +1 -4
index 4845682a0408..674a9a527125 100644
@@ -1812,11 +1812,8 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
 {
 	struct dwc3		*dwc = dep->dwc;
 
-	if (!dep->endpoint.desc || !dwc->pullups_connected || !dwc->connected) {
-		dev_err(dwc->dev, "%s: can't queue to disabled endpoint\n",
-				dep->name);
+	if (!dep->endpoint.desc || !dwc->pullups_connected || !dwc->connected)
 		return -ESHUTDOWN;
-	}
 
 	if (WARN(req->dep != dep, "request %pK belongs to '%s'\n",
 				&req->request, req->dep->name))
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
maintainer
#1 lore raw
Quoted 16 lines · Wesley Cheng

Since function drivers will still be active until dwc3_disconnect_gadget() is called, some applications will continue to queue packets to DWC3 gadget. This can lead to a flood of messages regarding failed ep queue, as the endpoint is in the process of being disabled. Remove the print as function drivers will likely log queuing errors as well.

---
 drivers/usb/dwc3/gadget.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/usb/dwc3/gadget.c +0 -0
index 4845682a0408..674a9a527125 100644

drivers/usb/dwc3/gadget.c static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) · line 1817

Quoted 6 lines
drivers/usb/dwc3/gadget.c +0 -3
@@ -1812,11 +1812,8 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
 {
 	struct dwc3		*dwc = dep->dwc;
 
-	if (!dep->endpoint.desc || !dwc->pullups_connected || !dwc->connected) {
-		dev_err(dwc->dev, "%s: can't queue to disabled endpoint\n",
-				dep->name);

Why not just change this to dev_dbg() instead?

thanks,

greg k-h

#2 lore raw
Quoted 20 lines · Greg KH
Quoted 19 lines · Wesley Cheng

Since function drivers will still be active until dwc3_disconnect_gadget() is called, some applications will continue to queue packets to DWC3 gadget. This can lead to a flood of messages regarding failed ep queue, as the endpoint is in the process of being disabled. Remove the print as function drivers will likely log queuing errors as well.

---
 drivers/usb/dwc3/gadget.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/usb/dwc3/gadget.c +0 -0
index 4845682a0408..674a9a527125 100644
@@ -1812,11 +1812,8 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
 {
 	struct dwc3		*dwc = dep->dwc;
 
Quoted 5 lines

drivers/usb/dwc3/gadget.c static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) · line 1817

Quoted 3 lines
drivers/usb/dwc3/gadget.c +0 -3
-	if (!dep->endpoint.desc || !dwc->pullups_connected || !dwc->connected) {
-		dev_err(dwc->dev, "%s: can't queue to disabled endpoint\n",
-				dep->name);

Why not just change this to dev_dbg() instead?

I agree. A dev_dbg() would be better here. We don't want to loose this message forever as it may prevent us from finding buggy function drivers.

Signature · 1 line
balbi
#3 lore raw

Hi,

Quoted 29 lines · Felipe Balbi
Quoted 20 lines · Greg KH
Quoted 19 lines · Wesley Cheng

Since function drivers will still be active until dwc3_disconnect_gadget() is called, some applications will continue to queue packets to DWC3 gadget. This can lead to a flood of messages regarding failed ep queue, as the endpoint is in the process of being disabled. Remove the print as function drivers will likely log queuing errors as well.

---
 drivers/usb/dwc3/gadget.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/usb/dwc3/gadget.c +0 -0
index 4845682a0408..674a9a527125 100644
@@ -1812,11 +1812,8 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
 {
 	struct dwc3		*dwc = dep->dwc;
 
Quoted 5 lines

drivers/usb/dwc3/gadget.c static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) · line 1817

Quoted 3 lines
drivers/usb/dwc3/gadget.c +0 -3
-	if (!dep->endpoint.desc || !dwc->pullups_connected || !dwc->connected) {
-		dev_err(dwc->dev, "%s: can't queue to disabled endpoint\n",
-				dep->name);

Why not just change this to dev_dbg() instead?

Quoted 4 lines

I agree. A dev_dbg() would be better here. We don't want to loose this message forever as it may prevent us from finding buggy function drivers.

Thanks Greg/Felipe, will change it to a dev_dbg().

Thanks
Wesley Cheng

Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project