aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-hub.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/xhci-hub.c')
-rw-r--r--drivers/usb/host/xhci-hub.c44
1 files changed, 27 insertions, 17 deletions
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index 96a740543183..3abe70ff1b1e 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -487,8 +487,8 @@ static void xhci_disable_port(struct usb_hcd *hcd, struct xhci_hcd *xhci,
487 /* Write 1 to disable the port */ 487 /* Write 1 to disable the port */
488 writel(port_status | PORT_PE, addr); 488 writel(port_status | PORT_PE, addr);
489 port_status = readl(addr); 489 port_status = readl(addr);
490 xhci_dbg(xhci, "disable port, actual port %d status = 0x%x\n", 490 xhci_dbg(xhci, "disable port %d-%d, portsc: 0x%x\n",
491 wIndex, port_status); 491 hcd->self.busnum, wIndex + 1, port_status);
492} 492}
493 493
494static void xhci_clear_port_change_bit(struct xhci_hcd *xhci, u16 wValue, 494static void xhci_clear_port_change_bit(struct xhci_hcd *xhci, u16 wValue,
@@ -537,8 +537,9 @@ static void xhci_clear_port_change_bit(struct xhci_hcd *xhci, u16 wValue,
537 /* Change bits are all write 1 to clear */ 537 /* Change bits are all write 1 to clear */
538 writel(port_status | status, addr); 538 writel(port_status | status, addr);
539 port_status = readl(addr); 539 port_status = readl(addr);
540 xhci_dbg(xhci, "clear port %s change, actual port %d status = 0x%x\n", 540
541 port_change_bit, wIndex, port_status); 541 xhci_dbg(xhci, "clear port%d %s change, portsc: 0x%x\n",
542 wIndex + 1, port_change_bit, port_status);
542} 543}
543 544
544struct xhci_hub *xhci_get_rhub(struct usb_hcd *hcd) 545struct xhci_hub *xhci_get_rhub(struct usb_hcd *hcd)
@@ -565,13 +566,16 @@ static void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd,
565 rhub = xhci_get_rhub(hcd); 566 rhub = xhci_get_rhub(hcd);
566 port = rhub->ports[index]; 567 port = rhub->ports[index];
567 temp = readl(port->addr); 568 temp = readl(port->addr);
569
570 xhci_dbg(xhci, "set port power %d-%d %s, portsc: 0x%x\n",
571 hcd->self.busnum, index + 1, on ? "ON" : "OFF", temp);
572
568 temp = xhci_port_state_to_neutral(temp); 573 temp = xhci_port_state_to_neutral(temp);
574
569 if (on) { 575 if (on) {
570 /* Power on */ 576 /* Power on */
571 writel(temp | PORT_POWER, port->addr); 577 writel(temp | PORT_POWER, port->addr);
572 temp = readl(port->addr); 578 readl(port->addr);
573 xhci_dbg(xhci, "set port power, actual port %d status = 0x%x\n",
574 index, temp);
575 } else { 579 } else {
576 /* Power off */ 580 /* Power off */
577 writel(temp & ~PORT_POWER, port->addr); 581 writel(temp & ~PORT_POWER, port->addr);
@@ -666,12 +670,17 @@ void xhci_set_link_state(struct xhci_hcd *xhci, struct xhci_port *port,
666 u32 link_state) 670 u32 link_state)
667{ 671{
668 u32 temp; 672 u32 temp;
673 u32 portsc;
669 674
670 temp = readl(port->addr); 675 portsc = readl(port->addr);
671 temp = xhci_port_state_to_neutral(temp); 676 temp = xhci_port_state_to_neutral(portsc);
672 temp &= ~PORT_PLS_MASK; 677 temp &= ~PORT_PLS_MASK;
673 temp |= PORT_LINK_STROBE | link_state; 678 temp |= PORT_LINK_STROBE | link_state;
674 writel(temp, port->addr); 679 writel(temp, port->addr);
680
681 xhci_dbg(xhci, "Set port %d-%d link state, portsc: 0x%x, write 0x%x",
682 port->rhub->hcd->self.busnum, port->hcd_portnum + 1,
683 portsc, temp);
675} 684}
676 685
677static void xhci_set_remote_wake_mask(struct xhci_hcd *xhci, 686static void xhci_set_remote_wake_mask(struct xhci_hcd *xhci,
@@ -840,7 +849,9 @@ static int xhci_handle_usb2_port_link_resume(struct xhci_port *port,
840 } else if (time_after_eq(jiffies, bus_state->resume_done[wIndex])) { 849 } else if (time_after_eq(jiffies, bus_state->resume_done[wIndex])) {
841 int time_left; 850 int time_left;
842 851
843 xhci_dbg(xhci, "Resume USB2 port %d\n", wIndex + 1); 852 xhci_dbg(xhci, "resume USB2 port %d-%d\n",
853 hcd->self.busnum, wIndex + 1);
854
844 bus_state->resume_done[wIndex] = 0; 855 bus_state->resume_done[wIndex] = 0;
845 clear_bit(wIndex, &bus_state->resuming_ports); 856 clear_bit(wIndex, &bus_state->resuming_ports);
846 857
@@ -867,9 +878,8 @@ static int xhci_handle_usb2_port_link_resume(struct xhci_port *port,
867 } else { 878 } else {
868 int port_status = readl(port->addr); 879 int port_status = readl(port->addr);
869 880
870 xhci_warn(xhci, "Port resume %i msec timed out, portsc = 0x%x\n", 881 xhci_warn(xhci, "Port resume timed out, port %d-%d: 0x%x\n",
871 XHCI_MAX_REXIT_TIMEOUT_MS, 882 hcd->self.busnum, wIndex + 1, port_status);
872 port_status);
873 *status |= USB_PORT_STAT_SUSPEND; 883 *status |= USB_PORT_STAT_SUSPEND;
874 clear_bit(wIndex, &bus_state->rexit_ports); 884 clear_bit(wIndex, &bus_state->rexit_ports);
875 } 885 }
@@ -1124,9 +1134,8 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
1124 if (status == 0xffffffff) 1134 if (status == 0xffffffff)
1125 goto error; 1135 goto error;
1126 1136
1127 xhci_dbg(xhci, "get port status, actual port %d status = 0x%x\n", 1137 xhci_dbg(xhci, "Get port status %d-%d read: 0x%x, return 0x%x",
1128 wIndex, temp); 1138 hcd->self.busnum, wIndex + 1, temp, status);
1129 xhci_dbg(xhci, "Get port status returned 0x%x\n", status);
1130 1139
1131 put_unaligned(cpu_to_le32(status), (__le32 *) buf); 1140 put_unaligned(cpu_to_le32(status), (__le32 *) buf);
1132 /* if USB 3.1 extended port status return additional 4 bytes */ 1141 /* if USB 3.1 extended port status return additional 4 bytes */
@@ -1182,7 +1191,8 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
1182 temp = readl(ports[wIndex]->addr); 1191 temp = readl(ports[wIndex]->addr);
1183 if ((temp & PORT_PE) == 0 || (temp & PORT_RESET) 1192 if ((temp & PORT_PE) == 0 || (temp & PORT_RESET)
1184 || (temp & PORT_PLS_MASK) >= XDEV_U3) { 1193 || (temp & PORT_PLS_MASK) >= XDEV_U3) {
1185 xhci_warn(xhci, "USB core suspending device not in U0/U1/U2.\n"); 1194 xhci_warn(xhci, "USB core suspending port %d-%d not in U0/U1/U2\n",
1195 hcd->self.busnum, wIndex + 1);
1186 goto error; 1196 goto error;
1187 } 1197 }
1188 1198