Revert "xhci: rename resume_done to resume_timestamp"

This reverts commit a99c8f1abe which is
commit a909d629ae 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: Ic40510cd8c94739404a7e3c2532fa460bf7f7fb4
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2024-04-19 13:43:06 +00:00
parent 4e98a48adc
commit f7f70f0d86
3 changed files with 13 additions and 13 deletions

View File

@@ -924,7 +924,7 @@ static int xhci_handle_usb2_port_link_resume(struct xhci_port *port,
return -EINVAL;
}
/* did port event handler already start resume timing? */
if (!port->resume_timestamp) {
if (!port->resume_done) {
/* If not, maybe we are in a host initated resume? */
if (test_bit(wIndex, &bus_state->resuming_ports)) {
/* Host initated resume doesn't time the resume
@@ -941,18 +941,18 @@ static int xhci_handle_usb2_port_link_resume(struct xhci_port *port,
msecs_to_jiffies(USB_RESUME_TIMEOUT);
set_bit(wIndex, &bus_state->resuming_ports);
port->resume_timestamp = timeout;
port->resume_done = timeout;
mod_timer(&hcd->rh_timer, timeout);
usb_hcd_start_port_resume(&hcd->self, wIndex);
}
/* Has resume been signalled for USB_RESUME_TIME yet? */
} else if (time_after_eq(jiffies, port->resume_timestamp)) {
} else if (time_after_eq(jiffies, port->resume_done)) {
int time_left;
xhci_dbg(xhci, "resume USB2 port %d-%d\n",
hcd->self.busnum, wIndex + 1);
port->resume_timestamp = 0;
port->resume_done = 0;
clear_bit(wIndex, &bus_state->resuming_ports);
port->rexit_active = true;
@@ -1087,10 +1087,10 @@ static void xhci_get_usb2_port_status(struct xhci_port *port, u32 *status,
if (link_state == XDEV_U2)
*status |= USB_PORT_STAT_L1;
if (link_state == XDEV_U0) {
if (port->resume_timestamp)
if (port->resume_done)
usb_hcd_end_port_resume(&port->rhub->hcd->self,
portnum);
port->resume_timestamp = 0;
port->resume_done = 0;
clear_bit(portnum, &bus_state->resuming_ports);
if (bus_state->suspended_ports & (1 << portnum)) {
bus_state->suspended_ports &= ~(1 << portnum);
@@ -1162,11 +1162,11 @@ static u32 xhci_get_port_status(struct usb_hcd *hcd,
* Clear stale usb2 resume signalling variables in case port changed
* state during resume signalling. For example on error
*/
if ((port->resume_timestamp ||
if ((port->resume_done ||
test_bit(wIndex, &bus_state->resuming_ports)) &&
(raw_port_status & PORT_PLS_MASK) != XDEV_U3 &&
(raw_port_status & PORT_PLS_MASK) != XDEV_RESUME) {
port->resume_timestamp = 0;
port->resume_done = 0;
clear_bit(wIndex, &bus_state->resuming_ports);
usb_hcd_end_port_resume(&hcd->self, wIndex);
}
@@ -1674,8 +1674,8 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf)
if ((temp & mask) != 0 ||
(bus_state->port_c_suspend & 1 << i) ||
(ports[i]->resume_timestamp && time_after_eq(
jiffies, ports[i]->resume_timestamp))) {
(ports[i]->resume_done && time_after_eq(
jiffies, ports[i]->resume_done))) {
buf[(i + 1) / 8] |= 1 << (i + 1) % 8;
status = 1;
}

View File

@@ -1989,7 +1989,7 @@ static void handle_port_status(struct xhci_hcd *xhci,
goto cleanup;
} else if (!test_bit(hcd_portnum, &bus_state->resuming_ports)) {
xhci_dbg(xhci, "resume HS port %d\n", port_id);
port->resume_timestamp = jiffies +
port->resume_done = jiffies +
msecs_to_jiffies(USB_RESUME_TIMEOUT);
set_bit(hcd_portnum, &bus_state->resuming_ports);
/* Do the rest in GetPortStatus after resume time delay.
@@ -1998,7 +1998,7 @@ static void handle_port_status(struct xhci_hcd *xhci,
*/
set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
mod_timer(&hcd->rh_timer,
port->resume_timestamp);
port->resume_done);
usb_hcd_start_port_resume(&hcd->self, hcd_portnum);
bogus_port_status = true;
}

View File

@@ -1744,7 +1744,7 @@ struct xhci_port {
struct xhci_hub *rhub;
struct xhci_port_cap *port_cap;
unsigned int lpm_incapable:1;
unsigned long resume_timestamp;
unsigned long resume_done;
bool rexit_active;
struct completion rexit_done;
struct completion u3exit_done;