Revert "xhci: track port suspend state correctly in unsuccessful resume cases"

This reverts commit 6538b6d13c which is
commit d7cdfc319b upstream.

It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.

Bug: 161946584
Change-Id: Idab0edccdf4d6b57fddcca069ad44a8381befa48
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2024-04-19 13:43:02 +00:00
parent 792aa870d5
commit d6a30b0b4e

View File

@@ -1043,19 +1043,19 @@ static void xhci_get_usb3_port_status(struct xhci_port *port, u32 *status,
*status |= USB_PORT_STAT_C_CONFIG_ERROR << 16;
/* USB3 specific wPortStatus bits */
if (portsc & PORT_POWER)
if (portsc & PORT_POWER) {
*status |= USB_SS_PORT_STAT_POWER;
/* link state handling */
if (link_state == XDEV_U0)
bus_state->suspended_ports &= ~(1 << portnum);
}
/* no longer suspended or resuming */
if (link_state != XDEV_U3 &&
/* remote wake resume signaling complete */
if (bus_state->port_remote_wakeup & (1 << portnum) &&
link_state != XDEV_RESUME &&
link_state != XDEV_RECOVERY) {
/* remote wake resume signaling complete */
if (bus_state->port_remote_wakeup & (1 << portnum)) {
bus_state->port_remote_wakeup &= ~(1 << portnum);
usb_hcd_end_port_resume(&hcd->self, portnum);
}
bus_state->suspended_ports &= ~(1 << portnum);
bus_state->port_remote_wakeup &= ~(1 << portnum);
usb_hcd_end_port_resume(&hcd->self, portnum);
}
xhci_hub_report_usb3_link_state(xhci, status, portsc);
@@ -1112,7 +1112,6 @@ static void xhci_get_usb2_port_status(struct xhci_port *port, u32 *status,
usb_hcd_end_port_resume(&port->rhub->hcd->self, portnum);
}
port->rexit_active = 0;
bus_state->suspended_ports &= ~(1 << portnum);
}
}