From: Greg Kroah-Hartman Date: Tue, 8 Jul 2025 09:10:17 +0000 (+0200) Subject: 5.15-stable patches X-Git-Tag: v5.15.187~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d934d5e881fe3a5df10b8641e2ced678ff2396b;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: usb-cdnsp-do-not-disable-slot-for-disabled-slot.patch usb-dwc3-abort-suspend-on-soft-disconnect-failure.patch xhci-dbc-flush-queued-requests-before-stopping-dbc.patch xhci-dbctty-disable-echo-flag-by-default.patch --- diff --git a/queue-5.15/series b/queue-5.15/series index cf49673e0a..5fc0f8e69c 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -151,3 +151,7 @@ net-dpaa2-eth-rearrange-variable-in-dpaa2_eth_get_et.patch dpaa2-eth-fix-xdp_rxq_info-leak.patch platform-x86-think-lmi-fix-class-device-unregistrati.patch platform-x86-dell-wmi-sysman-fix-class-device-unregi.patch +xhci-dbctty-disable-echo-flag-by-default.patch +xhci-dbc-flush-queued-requests-before-stopping-dbc.patch +usb-cdnsp-do-not-disable-slot-for-disabled-slot.patch +usb-dwc3-abort-suspend-on-soft-disconnect-failure.patch diff --git a/queue-5.15/usb-cdnsp-do-not-disable-slot-for-disabled-slot.patch b/queue-5.15/usb-cdnsp-do-not-disable-slot-for-disabled-slot.patch new file mode 100644 index 0000000000..b666f3d978 --- /dev/null +++ b/queue-5.15/usb-cdnsp-do-not-disable-slot-for-disabled-slot.patch @@ -0,0 +1,36 @@ +From 7e2c421ef88e9da9c39e01496b7f5b0b354b42bc Mon Sep 17 00:00:00 2001 +From: Peter Chen +Date: Thu, 19 Jun 2025 09:34:13 +0800 +Subject: usb: cdnsp: do not disable slot for disabled slot + +From: Peter Chen + +commit 7e2c421ef88e9da9c39e01496b7f5b0b354b42bc upstream. + +It doesn't need to do it, and the related command event returns +'Slot Not Enabled Error' status. + +Fixes: 3d82904559f4 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver") +Cc: stable +Suggested-by: Hongliang Yang +Reviewed-by: Fugang Duan +Signed-off-by: Peter Chen +Link: https://lore.kernel.org/r/20250619013413.35817-1-peter.chen@cixtech.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/cdns3/cdnsp-ring.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/usb/cdns3/cdnsp-ring.c ++++ b/drivers/usb/cdns3/cdnsp-ring.c +@@ -772,7 +772,9 @@ static int cdnsp_update_port_id(struct c + } + + if (port_id != old_port) { +- cdnsp_disable_slot(pdev); ++ if (pdev->slot_id) ++ cdnsp_disable_slot(pdev); ++ + pdev->active_port = port; + cdnsp_enable_slot(pdev); + } diff --git a/queue-5.15/usb-dwc3-abort-suspend-on-soft-disconnect-failure.patch b/queue-5.15/usb-dwc3-abort-suspend-on-soft-disconnect-failure.patch new file mode 100644 index 0000000000..e81e5e78f7 --- /dev/null +++ b/queue-5.15/usb-dwc3-abort-suspend-on-soft-disconnect-failure.patch @@ -0,0 +1,100 @@ +From 630a1dec3b0eba2a695b9063f1c205d585cbfec9 Mon Sep 17 00:00:00 2001 +From: Kuen-Han Tsai +Date: Wed, 28 May 2025 18:03:11 +0800 +Subject: usb: dwc3: Abort suspend on soft disconnect failure + +From: Kuen-Han Tsai + +commit 630a1dec3b0eba2a695b9063f1c205d585cbfec9 upstream. + +When dwc3_gadget_soft_disconnect() fails, dwc3_suspend_common() keeps +going with the suspend, resulting in a period where the power domain is +off, but the gadget driver remains connected. Within this time frame, +invoking vbus_event_work() will cause an error as it attempts to access +DWC3 registers for endpoint disabling after the power domain has been +completely shut down. + +Abort the suspend sequence when dwc3_gadget_suspend() cannot halt the +controller and proceeds with a soft connect. + +Fixes: 9f8a67b65a49 ("usb: dwc3: gadget: fix gadget suspend/resume") +Cc: stable +Acked-by: Thinh Nguyen +Signed-off-by: Kuen-Han Tsai +Link: https://lore.kernel.org/r/20250528100315.2162699-1-khtsai@google.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/dwc3/core.c | 9 +++++++-- + drivers/usb/dwc3/gadget.c | 22 +++++++++------------- + 2 files changed, 16 insertions(+), 15 deletions(-) + +--- a/drivers/usb/dwc3/core.c ++++ b/drivers/usb/dwc3/core.c +@@ -880,6 +880,7 @@ static void dwc3_set_incr_burst_type(str + int ntype; + int ret; + int i; ++ int ret; + + cfg = dwc3_readl(dwc->regs, DWC3_GSBUSCFG0); + +@@ -1836,7 +1837,9 @@ static int dwc3_suspend_common(struct dw + case DWC3_GCTL_PRTCAP_DEVICE: + if (pm_runtime_suspended(dwc->dev)) + break; +- dwc3_gadget_suspend(dwc); ++ ret = dwc3_gadget_suspend(dwc); ++ if (ret) ++ return ret; + synchronize_irq(dwc->irq_gadget); + dwc3_core_exit(dwc); + break; +@@ -1867,7 +1870,9 @@ static int dwc3_suspend_common(struct dw + break; + + if (dwc->current_otg_role == DWC3_OTG_ROLE_DEVICE) { +- dwc3_gadget_suspend(dwc); ++ ret = dwc3_gadget_suspend(dwc); ++ if (ret) ++ return ret; + synchronize_irq(dwc->irq_gadget); + } + +--- a/drivers/usb/dwc3/gadget.c ++++ b/drivers/usb/dwc3/gadget.c +@@ -4580,26 +4580,22 @@ int dwc3_gadget_suspend(struct dwc3 *dwc + int ret; + + ret = dwc3_gadget_soft_disconnect(dwc); +- if (ret) +- goto err; +- +- spin_lock_irqsave(&dwc->lock, flags); +- if (dwc->gadget_driver) +- dwc3_disconnect_gadget(dwc); +- spin_unlock_irqrestore(&dwc->lock, flags); +- +- return 0; +- +-err: + /* + * Attempt to reset the controller's state. Likely no + * communication can be established until the host + * performs a port reset. + */ +- if (dwc->softconnect) ++ if (ret && dwc->softconnect) { + dwc3_gadget_soft_connect(dwc); ++ return -EAGAIN; ++ } + +- return ret; ++ spin_lock_irqsave(&dwc->lock, flags); ++ if (dwc->gadget_driver) ++ dwc3_disconnect_gadget(dwc); ++ spin_unlock_irqrestore(&dwc->lock, flags); ++ ++ return 0; + } + + int dwc3_gadget_resume(struct dwc3 *dwc) diff --git a/queue-5.15/xhci-dbc-flush-queued-requests-before-stopping-dbc.patch b/queue-5.15/xhci-dbc-flush-queued-requests-before-stopping-dbc.patch new file mode 100644 index 0000000000..5c0a6a7bfc --- /dev/null +++ b/queue-5.15/xhci-dbc-flush-queued-requests-before-stopping-dbc.patch @@ -0,0 +1,37 @@ +From efe3e3ae5a66cb38ef29c909e951b4039044bae9 Mon Sep 17 00:00:00 2001 +From: Mathias Nyman +Date: Fri, 27 Jun 2025 17:41:22 +0300 +Subject: xhci: dbc: Flush queued requests before stopping dbc + +From: Mathias Nyman + +commit efe3e3ae5a66cb38ef29c909e951b4039044bae9 upstream. + +Flush dbc requests when dbc is stopped and transfer rings are freed. +Failure to flush them lead to leaking memory and dbc completing odd +requests after resuming from suspend, leading to error messages such as: + +[ 95.344392] xhci_hcd 0000:00:0d.0: no matched request + +Cc: stable +Fixes: dfba2174dc42 ("usb: xhci: Add DbC support in xHCI driver") +Signed-off-by: Mathias Nyman +Link: https://lore.kernel.org/r/20250627144127.3889714-5-mathias.nyman@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/host/xhci-dbgcap.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/usb/host/xhci-dbgcap.c ++++ b/drivers/usb/host/xhci-dbgcap.c +@@ -639,6 +639,10 @@ static void xhci_dbc_stop(struct xhci_db + case DS_DISABLED: + return; + case DS_CONFIGURED: ++ spin_lock(&dbc->lock); ++ xhci_dbc_flush_requests(dbc); ++ spin_unlock(&dbc->lock); ++ + if (dbc->driver->disconnect) + dbc->driver->disconnect(dbc); + break; diff --git a/queue-5.15/xhci-dbctty-disable-echo-flag-by-default.patch b/queue-5.15/xhci-dbctty-disable-echo-flag-by-default.patch new file mode 100644 index 0000000000..30d1becda9 --- /dev/null +++ b/queue-5.15/xhci-dbctty-disable-echo-flag-by-default.patch @@ -0,0 +1,39 @@ +From 2b857d69a5e116150639a0c6c39c86cc329939ee Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C5=81ukasz=20Bartosik?= +Date: Fri, 27 Jun 2025 17:41:21 +0300 +Subject: xhci: dbctty: disable ECHO flag by default +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Łukasz Bartosik + +commit 2b857d69a5e116150639a0c6c39c86cc329939ee upstream. + +When /dev/ttyDBC0 device is created then by default ECHO flag +is set for the terminal device. However if data arrives from +a peer before application using /dev/ttyDBC0 applies its set +of terminal flags then the arriving data will be echoed which +might not be desired behavior. + +Fixes: 4521f1613940 ("xhci: dbctty: split dbc tty driver registration and unregistration functions.") +Cc: stable +Signed-off-by: Łukasz Bartosik +Signed-off-by: Mathias Nyman +Link: https://lore.kernel.org/stable/20250610111802.18742-1-ukaszb%40chromium.org +Link: https://lore.kernel.org/r/20250627144127.3889714-4-mathias.nyman@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/host/xhci-dbgtty.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/host/xhci-dbgtty.c ++++ b/drivers/usb/host/xhci-dbgtty.c +@@ -537,6 +537,7 @@ static int dbc_tty_init(void) + dbc_tty_driver->type = TTY_DRIVER_TYPE_SERIAL; + dbc_tty_driver->subtype = SERIAL_TYPE_NORMAL; + dbc_tty_driver->init_termios = tty_std_termios; ++ dbc_tty_driver->init_termios.c_lflag &= ~ECHO; + dbc_tty_driver->init_termios.c_cflag = + B9600 | CS8 | CREAD | HUPCL | CLOCAL; + dbc_tty_driver->init_termios.c_ispeed = 9600;