diff options
| -rw-r--r-- | drivers/usb/host/xhci-ring.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 882875465301..ec2681918682 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
| @@ -1599,14 +1599,20 @@ static void handle_port_status(struct xhci_hcd *xhci, | |||
| 1599 | max_ports = HCS_MAX_PORTS(xhci->hcs_params1); | 1599 | max_ports = HCS_MAX_PORTS(xhci->hcs_params1); |
| 1600 | if ((port_id <= 0) || (port_id > max_ports)) { | 1600 | if ((port_id <= 0) || (port_id > max_ports)) { |
| 1601 | xhci_warn(xhci, "Invalid port id %d\n", port_id); | 1601 | xhci_warn(xhci, "Invalid port id %d\n", port_id); |
| 1602 | bogus_port_status = true; | 1602 | inc_deq(xhci, xhci->event_ring); |
| 1603 | goto cleanup; | 1603 | return; |
| 1604 | } | 1604 | } |
| 1605 | 1605 | ||
| 1606 | /* Figure out which usb_hcd this port is attached to: | 1606 | /* Figure out which usb_hcd this port is attached to: |
| 1607 | * is it a USB 3.0 port or a USB 2.0/1.1 port? | 1607 | * is it a USB 3.0 port or a USB 2.0/1.1 port? |
| 1608 | */ | 1608 | */ |
| 1609 | major_revision = xhci->port_array[port_id - 1]; | 1609 | major_revision = xhci->port_array[port_id - 1]; |
| 1610 | |||
| 1611 | /* Find the right roothub. */ | ||
| 1612 | hcd = xhci_to_hcd(xhci); | ||
| 1613 | if ((major_revision == 0x03) != (hcd->speed == HCD_USB3)) | ||
| 1614 | hcd = xhci->shared_hcd; | ||
| 1615 | |||
| 1610 | if (major_revision == 0) { | 1616 | if (major_revision == 0) { |
| 1611 | xhci_warn(xhci, "Event for port %u not in " | 1617 | xhci_warn(xhci, "Event for port %u not in " |
| 1612 | "Extended Capabilities, ignoring.\n", | 1618 | "Extended Capabilities, ignoring.\n", |
| @@ -1629,10 +1635,6 @@ static void handle_port_status(struct xhci_hcd *xhci, | |||
| 1629 | * into the index into the ports on the correct split roothub, and the | 1635 | * into the index into the ports on the correct split roothub, and the |
| 1630 | * correct bus_state structure. | 1636 | * correct bus_state structure. |
| 1631 | */ | 1637 | */ |
| 1632 | /* Find the right roothub. */ | ||
| 1633 | hcd = xhci_to_hcd(xhci); | ||
| 1634 | if ((major_revision == 0x03) != (hcd->speed == HCD_USB3)) | ||
| 1635 | hcd = xhci->shared_hcd; | ||
| 1636 | bus_state = &xhci->bus_state[hcd_index(hcd)]; | 1638 | bus_state = &xhci->bus_state[hcd_index(hcd)]; |
| 1637 | if (hcd->speed == HCD_USB3) | 1639 | if (hcd->speed == HCD_USB3) |
| 1638 | port_array = xhci->usb3_ports; | 1640 | port_array = xhci->usb3_ports; |
