From: Mathias Nyman Date: Mon, 13 Oct 2025 22:55:42 +0000 (+0300) Subject: xhci: dbc: enable back DbC in resume if it was enabled before suspend X-Git-Tag: v6.18-rc3~4^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2bbd38fcd29670e46c0fdb9cd0e90507a8a1bf6a;p=thirdparty%2Flinux.git xhci: dbc: enable back DbC in resume if it was enabled before suspend DbC is currently only enabled back if it's in configured state during suspend. If system is suspended after DbC is enabled, but before the device is properly enumerated by the host, then DbC would not be enabled back in resume. Always enable DbC back in resume if it's suspended in enabled, connected, or configured state Cc: stable Fixes: dfba2174dc42 ("usb: xhci: Add DbC support in xHCI driver") Tested-by: Ɓukasz Bartosik Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/host/xhci-dbgcap.c b/drivers/usb/host/xhci-dbgcap.c index 023a8ec6f305f..ecda964e018ac 100644 --- a/drivers/usb/host/xhci-dbgcap.c +++ b/drivers/usb/host/xhci-dbgcap.c @@ -1392,8 +1392,15 @@ int xhci_dbc_suspend(struct xhci_hcd *xhci) if (!dbc) return 0; - if (dbc->state == DS_CONFIGURED) + switch (dbc->state) { + case DS_ENABLED: + case DS_CONNECTED: + case DS_CONFIGURED: dbc->resume_required = 1; + break; + default: + break; + } xhci_dbc_stop(dbc);