Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: xhci: relocate Restore/Controller error check

A Restore Error or Host Controller Error indicates that the host controller
failed to resume after suspend. In such cases, the xhci driver is fully
re-initialized, similar to a post-hibernation scenario.

The existing error check is only relevant when 'power_lost' is false.
If 'power_lost' is true, a Restore or Controller error has no effect:
no warning is printed and the 'power_lost' state remains unchanged.

Move the entire error check into the if '!power_lost' condition
to make this dependency explicit and simplify the resume logic.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Niklas Neronin <niklas.neronin@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://patch.msgid.link/20260402131342.2628648-6-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Niklas Neronin and committed by
Greg Kroah-Hartman
ab915ec9 5ef760cf

+5 -8
+5 -8
drivers/usb/host/xhci.c
··· 1140 1140 spin_unlock_irq(&xhci->lock); 1141 1141 return -ETIMEDOUT; 1142 1142 } 1143 - } 1144 1143 1145 - temp = readl(&xhci->op_regs->status); 1146 - 1147 - /* re-initialize the HC on Restore Error, or Host Controller Error */ 1148 - if ((temp & (STS_SRE | STS_HCE)) && 1149 - !(xhci->xhc_state & XHCI_STATE_REMOVING)) { 1150 - if (!power_lost) 1144 + /* re-initialize the HC on Restore Error, or Host Controller Error */ 1145 + temp = readl(&xhci->op_regs->status); 1146 + if ((temp & (STS_SRE | STS_HCE)) && !(xhci->xhc_state & XHCI_STATE_REMOVING)) { 1151 1147 xhci_warn(xhci, "xHC error in resume, USBSTS 0x%x, Reinit\n", temp); 1152 - power_lost = true; 1148 + power_lost = true; 1149 + } 1153 1150 } 1154 1151 1155 1152 if (power_lost) {