linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: dwc3: gadget: Remove dev_err() when queuing to inactive gadget/ep
@ 2021-10-14 23:35 Wesley Cheng
  2021-10-15  6:38 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Wesley Cheng @ 2021-10-14 23:35 UTC (permalink / raw)
  To: balbi, gregkh; +Cc: linux-usb, linux-kernel, jackp, 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.

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);
+	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))
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


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

* Re: [PATCH] usb: dwc3: gadget: Remove dev_err() when queuing to inactive gadget/ep
  2021-10-14 23:35 [PATCH] usb: dwc3: gadget: Remove dev_err() when queuing to inactive gadget/ep Wesley Cheng
@ 2021-10-15  6:38 ` Greg KH
  2021-10-15 11:23   ` Felipe Balbi
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2021-10-15  6:38 UTC (permalink / raw)
  To: Wesley Cheng; +Cc: balbi, linux-usb, linux-kernel, jackp

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

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

* Re: [PATCH] usb: dwc3: gadget: Remove dev_err() when queuing to inactive gadget/ep
  2021-10-15  6:38 ` Greg KH
@ 2021-10-15 11:23   ` Felipe Balbi
  2021-10-18 18:55     ` Wesley Cheng
  0 siblings, 1 reply; 4+ messages in thread
From: Felipe Balbi @ 2021-10-15 11:23 UTC (permalink / raw)
  To: Greg KH; +Cc: Wesley Cheng, linux-usb, linux-kernel, jackp


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.

-- 
balbi

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

* Re: [PATCH] usb: dwc3: gadget: Remove dev_err() when queuing to inactive gadget/ep
  2021-10-15 11:23   ` Felipe Balbi
@ 2021-10-18 18:55     ` Wesley Cheng
  0 siblings, 0 replies; 4+ messages in thread
From: Wesley Cheng @ 2021-10-18 18:55 UTC (permalink / raw)
  To: Felipe Balbi, Greg KH; +Cc: linux-usb, linux-kernel, jackp

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

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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

end of thread, other threads:[~2021-10-18 18:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-14 23:35 [PATCH] usb: dwc3: gadget: Remove dev_err() when queuing to inactive gadget/ep Wesley Cheng
2021-10-15  6:38 ` Greg KH
2021-10-15 11:23   ` Felipe Balbi
2021-10-18 18:55     ` Wesley Cheng

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