Skip to content

Commit

Permalink
usb: udc: remove warning when queue disabled ep
Browse files Browse the repository at this point in the history
It is possible trigger below warning message from mass storage function,

WARNING: CPU: 6 PID: 3839 at drivers/usb/gadget/udc/core.c:294 usb_ep_queue+0x7c/0x104
pc : usb_ep_queue+0x7c/0x104
lr : fsg_main_thread+0x494/0x1b3c

Root cause is mass storage function try to queue request from main thread,
but other thread may already disable ep when function disable.

As there is no function failure in the driver, in order to avoid effort
to fix warning, change WARN_ON_ONCE() in usb_ep_queue() to pr_debug().

Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable@vger.kernel.org
Signed-off-by: yuan linyu <yuanlinyu@hihonor.com>
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20240315020144.2715575-1-yuanlinyu@hihonor.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
yuan linyu authored and gregkh committed Mar 26, 2024
1 parent f121531 commit 2a587a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/usb/gadget/udc/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,9 @@ int usb_ep_queue(struct usb_ep *ep,
{
int ret = 0;

if (WARN_ON_ONCE(!ep->enabled && ep->address)) {
if (!ep->enabled && ep->address) {
pr_debug("USB gadget: queue request to disabled ep 0x%x (%s)\n",
ep->address, ep->name);
ret = -ESHUTDOWN;
goto out;
}
Expand Down

0 comments on commit 2a587a0

Please sign in to comment.