aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Nyman <mathias.nyman@linux.intel.com>2015-10-01 11:40:36 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-04 05:34:17 -0400
commit2338b9e47fba0cd35e1e59f09838a8b9b339a55a (patch)
tree39ba3b58c75952927b90fcc215062721aadabfb9
parent5693e0b77f82cddf322bdc3eb50f26d3c707f61e (diff)
xhci: define the new default speed ID for SuperSpeedPlus used by xhci hw
USB 3.1 capable xhci controllers use a new default speed ID "5" in the PORTSC register to represent a 10Gbps connection speed of a SuperSpeedPlus device Make sure the xhci driver can handle the returned SuperSpeedPlus speed ID properly Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/host/xhci-hub.c6
-rw-r--r--drivers/usb/host/xhci-ring.c6
-rw-r--r--drivers/usb/host/xhci.h4
3 files changed, 10 insertions, 6 deletions
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index a7a0c64d17ab..483b5f8cb951 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -713,7 +713,7 @@ static u32 xhci_get_port_status(struct usb_hcd *hcd,
713 status |= USB_PORT_STAT_SUSPEND; 713 status |= USB_PORT_STAT_SUSPEND;
714 } 714 }
715 if ((raw_port_status & PORT_PLS_MASK) == XDEV_RESUME && 715 if ((raw_port_status & PORT_PLS_MASK) == XDEV_RESUME &&
716 !DEV_SUPERSPEED(raw_port_status)) { 716 !DEV_SUPERSPEED_ANY(raw_port_status)) {
717 if ((raw_port_status & PORT_RESET) || 717 if ((raw_port_status & PORT_RESET) ||
718 !(raw_port_status & PORT_PE)) 718 !(raw_port_status & PORT_PE))
719 return 0xffffffff; 719 return 0xffffffff;
@@ -1311,14 +1311,14 @@ int xhci_bus_resume(struct usb_hcd *hcd)
1311 u32 temp; 1311 u32 temp;
1312 1312
1313 temp = readl(port_array[port_index]); 1313 temp = readl(port_array[port_index]);
1314 if (DEV_SUPERSPEED(temp)) 1314 if (DEV_SUPERSPEED_ANY(temp))
1315 temp &= ~(PORT_RWC_BITS | PORT_CEC | PORT_WAKE_BITS); 1315 temp &= ~(PORT_RWC_BITS | PORT_CEC | PORT_WAKE_BITS);
1316 else 1316 else
1317 temp &= ~(PORT_RWC_BITS | PORT_WAKE_BITS); 1317 temp &= ~(PORT_RWC_BITS | PORT_WAKE_BITS);
1318 if (test_bit(port_index, &bus_state->bus_suspended) && 1318 if (test_bit(port_index, &bus_state->bus_suspended) &&
1319 (temp & PORT_PLS_MASK)) { 1319 (temp & PORT_PLS_MASK)) {
1320 set_bit(port_index, &port_was_suspended); 1320 set_bit(port_index, &port_was_suspended);
1321 if (!DEV_SUPERSPEED(temp)) { 1321 if (!DEV_SUPERSPEED_ANY(temp)) {
1322 xhci_set_link_state(xhci, port_array, 1322 xhci_set_link_state(xhci, port_array,
1323 port_index, XDEV_RESUME); 1323 port_index, XDEV_RESUME);
1324 need_usb2_u3_exit = true; 1324 need_usb2_u3_exit = true;
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 43291f93afeb..0e5aa8751c05 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1567,7 +1567,7 @@ static void handle_port_status(struct xhci_hcd *xhci,
1567 goto cleanup; 1567 goto cleanup;
1568 } 1568 }
1569 1569
1570 if (DEV_SUPERSPEED(temp)) { 1570 if (DEV_SUPERSPEED_ANY(temp)) {
1571 xhci_dbg(xhci, "remote wake SS port %d\n", port_id); 1571 xhci_dbg(xhci, "remote wake SS port %d\n", port_id);
1572 /* Set a flag to say the port signaled remote wakeup, 1572 /* Set a flag to say the port signaled remote wakeup,
1573 * so we can tell the difference between the end of 1573 * so we can tell the difference between the end of
@@ -1595,7 +1595,7 @@ static void handle_port_status(struct xhci_hcd *xhci,
1595 } 1595 }
1596 1596
1597 if ((temp & PORT_PLC) && (temp & PORT_PLS_MASK) == XDEV_U0 && 1597 if ((temp & PORT_PLC) && (temp & PORT_PLS_MASK) == XDEV_U0 &&
1598 DEV_SUPERSPEED(temp)) { 1598 DEV_SUPERSPEED_ANY(temp)) {
1599 xhci_dbg(xhci, "resume SS port %d finished\n", port_id); 1599 xhci_dbg(xhci, "resume SS port %d finished\n", port_id);
1600 /* We've just brought the device into U0 through either the 1600 /* We've just brought the device into U0 through either the
1601 * Resume state after a device remote wakeup, or through the 1601 * Resume state after a device remote wakeup, or through the
@@ -1625,7 +1625,7 @@ static void handle_port_status(struct xhci_hcd *xhci,
1625 * RExit to a disconnect state). If so, let the the driver know it's 1625 * RExit to a disconnect state). If so, let the the driver know it's
1626 * out of the RExit state. 1626 * out of the RExit state.
1627 */ 1627 */
1628 if (!DEV_SUPERSPEED(temp) && 1628 if (!DEV_SUPERSPEED_ANY(temp) &&
1629 test_and_clear_bit(faked_port_index, 1629 test_and_clear_bit(faked_port_index,
1630 &bus_state->rexit_ports)) { 1630 &bus_state->rexit_ports)) {
1631 complete(&bus_state->rexit_done[faked_port_index]); 1631 complete(&bus_state->rexit_done[faked_port_index]);
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index cd4a6e795329..e2c76e210817 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -327,11 +327,15 @@ struct xhci_op_regs {
327#define XDEV_LS (0x2 << 10) 327#define XDEV_LS (0x2 << 10)
328#define XDEV_HS (0x3 << 10) 328#define XDEV_HS (0x3 << 10)
329#define XDEV_SS (0x4 << 10) 329#define XDEV_SS (0x4 << 10)
330#define XDEV_SSP (0x5 << 10)
330#define DEV_UNDEFSPEED(p) (((p) & DEV_SPEED_MASK) == (0x0<<10)) 331#define DEV_UNDEFSPEED(p) (((p) & DEV_SPEED_MASK) == (0x0<<10))
331#define DEV_FULLSPEED(p) (((p) & DEV_SPEED_MASK) == XDEV_FS) 332#define DEV_FULLSPEED(p) (((p) & DEV_SPEED_MASK) == XDEV_FS)
332#define DEV_LOWSPEED(p) (((p) & DEV_SPEED_MASK) == XDEV_LS) 333#define DEV_LOWSPEED(p) (((p) & DEV_SPEED_MASK) == XDEV_LS)
333#define DEV_HIGHSPEED(p) (((p) & DEV_SPEED_MASK) == XDEV_HS) 334#define DEV_HIGHSPEED(p) (((p) & DEV_SPEED_MASK) == XDEV_HS)
334#define DEV_SUPERSPEED(p) (((p) & DEV_SPEED_MASK) == XDEV_SS) 335#define DEV_SUPERSPEED(p) (((p) & DEV_SPEED_MASK) == XDEV_SS)
336#define DEV_SUPERSPEEDPLUS(p) (((p) & DEV_SPEED_MASK) == XDEV_SSP)
337#define DEV_SUPERSPEED_ANY(p) (((p) & DEV_SPEED_MASK) >= XDEV_SS)
338
335/* Bits 20:23 in the Slot Context are the speed for the device */ 339/* Bits 20:23 in the Slot Context are the speed for the device */
336#define SLOT_SPEED_FS (XDEV_FS << 10) 340#define SLOT_SPEED_FS (XDEV_FS << 10)
337#define SLOT_SPEED_LS (XDEV_LS << 10) 341#define SLOT_SPEED_LS (XDEV_LS << 10)