summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorMathias Nyman <mathias.nyman@linux.intel.com>2025-06-27 17:41:22 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-07-10 16:05:10 +0200
commit8bfd11dae3fb3c202c831183d1849df0e8af4632 (patch)
treea0e33aaf4bc0b3290f82a43596f7219a73e6b8ff /drivers/usb
parent9f3b2e497debf3843fde794488920861c4e3a921 (diff)
downloadlinux-8bfd11dae3fb3c202c831183d1849df0e8af4632.tar.gz
linux-8bfd11dae3fb3c202c831183d1849df0e8af4632.tar.bz2
linux-8bfd11dae3fb3c202c831183d1849df0e8af4632.zip
xhci: dbc: Flush queued requests before stopping dbc
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 <stable@kernel.org> Fixes: dfba2174dc42 ("usb: xhci: Add DbC support in xHCI driver") Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20250627144127.3889714-5-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/xhci-dbgcap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-dbgcap.c b/drivers/usb/host/xhci-dbgcap.c
index d35f3a18dd13..bdc664ad6a93 100644
--- a/drivers/usb/host/xhci-dbgcap.c
+++ b/drivers/usb/host/xhci-dbgcap.c
@@ -651,6 +651,10 @@ static void xhci_dbc_stop(struct xhci_dbc *dbc)
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;