diff mbox series

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

Message ID 20211014233534.2382-1-wcheng@codeaurora.org (mailing list archive)
State New, archived
Headers show
Series usb: dwc3: gadget: Remove dev_err() when queuing to inactive gadget/ep | expand

Commit Message

Wesley Cheng Oct. 14, 2021, 11:35 p.m. UTC
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.

Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
---
 drivers/usb/dwc3/gadget.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Greg KH Oct. 15, 2021, 6:38 a.m. UTC | #1
On Thu, Oct 14, 2021 at 04:35:34PM -0700, Wesley Cheng wrote:
> 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.
> 
> Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
> ---
>  drivers/usb/dwc3/gadget.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index 4845682a0408..674a9a527125 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -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
Felipe Balbi Oct. 15, 2021, 11:23 a.m. UTC | #2
Greg KH <gregkh@linuxfoundation.org> writes:

> On Thu, Oct 14, 2021 at 04:35:34PM -0700, Wesley Cheng wrote:
>> 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.
>> 
>> Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
>> ---
>>  drivers/usb/dwc3/gadget.c | 5 +----
>>  1 file changed, 1 insertion(+), 4 deletions(-)
>> 
>> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
>> index 4845682a0408..674a9a527125 100644
>> --- a/drivers/usb/dwc3/gadget.c
>> +++ b/drivers/usb/dwc3/gadget.c
>> @@ -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?

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.
Wesley Cheng Oct. 18, 2021, 6:55 p.m. UTC | #3
Hi,

On 10/15/2021 4:23 AM, Felipe Balbi wrote:
> 
> Greg KH <gregkh@linuxfoundation.org> writes:
> 
>> On Thu, Oct 14, 2021 at 04:35:34PM -0700, Wesley Cheng wrote:
>>> 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.
>>>
>>> Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
>>> ---
>>>  drivers/usb/dwc3/gadget.c | 5 +----
>>>  1 file changed, 1 insertion(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
>>> index 4845682a0408..674a9a527125 100644
>>> --- a/drivers/usb/dwc3/gadget.c
>>> +++ b/drivers/usb/dwc3/gadget.c
>>> @@ -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?
> 
> 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
diff mbox series

Patch

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 4845682a0408..674a9a527125 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -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))