From 3441ef057321d95f9aa449a392ba0e97cff1d1da Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Apr 19 2024 16:28:36 +0000 Subject: usb: udc: remove warning when queue disabled ep (stable-fixes). --- diff --git a/patches.suse/usb-udc-remove-warning-when-queue-disabled-ep.patch b/patches.suse/usb-udc-remove-warning-when-queue-disabled-ep.patch new file mode 100644 index 0000000..28ceef6 --- /dev/null +++ b/patches.suse/usb-udc-remove-warning-when-queue-disabled-ep.patch @@ -0,0 +1,50 @@ +From 2a587a035214fa1b5ef598aea0b81848c5b72e5e Mon Sep 17 00:00:00 2001 +From: yuan linyu +Date: Fri, 15 Mar 2024 10:01:44 +0800 +Subject: [PATCH] usb: udc: remove warning when queue disabled ep +Git-commit: 2a587a035214fa1b5ef598aea0b81848c5b72e5e +Patch-mainline: v6.9-rc2 +References: stable-fixes + +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 +Cc: stable@vger.kernel.org +Signed-off-by: yuan linyu +Reviewed-by: Alan Stern +Link: https://lore.kernel.org/r/20240315020144.2715575-1-yuanlinyu@hihonor.com +Signed-off-by: Greg Kroah-Hartman +Acked-by: Takashi Iwai + +--- + drivers/usb/gadget/udc/core.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c +index 9d4150124fdb..b3a9d18a8dcd 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; + } +-- +2.43.0 + diff --git a/series.conf b/series.conf index 394a96b..dff2162 100644 --- a/series.conf +++ b/series.conf @@ -46231,6 +46231,7 @@ patches.suse/usb-cdc-wdm-close-race-between-read-and-workqueue.patch patches.suse/Revert-usb-phy-generic-Get-the-vbus-supply.patch patches.suse/usb-dwc3-Properly-set-system-wakeup.patch + patches.suse/usb-udc-remove-warning-when-queue-disabled-ep.patch patches.suse/usb-typec-Return-size-of-buffer-if-pd_set-operation-.patch patches.suse/usb-typec-ucsi-Clear-EVENT_PENDING-under-PPM-lock.patch patches.suse/usb-typec-ucsi-Check-for-notifications-after-init.patch