aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryuan linyu <yuanlinyu@hihonor.com>2024-03-15 10:01:44 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-03-26 14:58:36 +0100
commit2a587a035214fa1b5ef598aea0b81848c5b72e5e (patch)
tree3a22941d6146316aca895aa273f20a6dbfb2397c
parentf121531703ae442edc1dde4b56803680628bc5b7 (diff)
downloadcounter-2a587a035214fa1b5ef598aea0b81848c5b72e5e.tar.gz
usb: udc: remove warning when queue disabled ep
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>
-rw-r--r--drivers/usb/gadget/udc/core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c
index 9d4150124fdb82..b3a9d18a8dcd19 100644
--- a/drivers/usb/gadget/udc/core.c
+++ b/drivers/usb/gadget/udc/core.c
@@ -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;
}