aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/Kconfig2
-rw-r--r--drivers/usb/host/ehci-hcd.c2
-rw-r--r--drivers/usb/host/xhci-hub.c8
-rw-r--r--drivers/usb/host/xhci-mem.c3
-rw-r--r--drivers/usb/host/xhci.c12
5 files changed, 18 insertions, 9 deletions
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 82800a775501..56f4336ffa86 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -126,7 +126,7 @@ config XPS_USB_HCD_XILINX
126 select USB_EHCI_BIG_ENDIAN_DESC 126 select USB_EHCI_BIG_ENDIAN_DESC
127 select USB_EHCI_BIG_ENDIAN_MMIO 127 select USB_EHCI_BIG_ENDIAN_MMIO
128 ---help--- 128 ---help---
129 Xilinx xps USB host controller core is EHCI compilant and has 129 Xilinx xps USB host controller core is EHCI compliant and has
130 transaction translator built-in. It can be configured to either 130 transaction translator built-in. It can be configured to either
131 support both high speed and full speed devices, or high speed 131 support both high speed and full speed devices, or high speed
132 devices only. 132 devices only.
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 81cda09b47e3..488a30836c36 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -965,8 +965,6 @@ rescan:
965 } 965 }
966 966
967 qh->exception = 1; 967 qh->exception = 1;
968 if (ehci->rh_state < EHCI_RH_RUNNING)
969 qh->qh_state = QH_STATE_IDLE;
970 switch (qh->qh_state) { 968 switch (qh->qh_state) {
971 case QH_STATE_LINKED: 969 case QH_STATE_LINKED:
972 WARN_ON(!list_empty(&qh->qtd_list)); 970 WARN_ON(!list_empty(&qh->qtd_list));
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index aa79e8749040..69aece31143a 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -468,7 +468,8 @@ static void xhci_hub_report_usb2_link_state(u32 *status, u32 status_reg)
468} 468}
469 469
470/* Updates Link Status for super Speed port */ 470/* Updates Link Status for super Speed port */
471static void xhci_hub_report_usb3_link_state(u32 *status, u32 status_reg) 471static void xhci_hub_report_usb3_link_state(struct xhci_hcd *xhci,
472 u32 *status, u32 status_reg)
472{ 473{
473 u32 pls = status_reg & PORT_PLS_MASK; 474 u32 pls = status_reg & PORT_PLS_MASK;
474 475
@@ -507,7 +508,8 @@ static void xhci_hub_report_usb3_link_state(u32 *status, u32 status_reg)
507 * in which sometimes the port enters compliance mode 508 * in which sometimes the port enters compliance mode
508 * caused by a delay on the host-device negotiation. 509 * caused by a delay on the host-device negotiation.
509 */ 510 */
510 if (pls == USB_SS_PORT_LS_COMP_MOD) 511 if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) &&
512 (pls == USB_SS_PORT_LS_COMP_MOD))
511 pls |= USB_PORT_STAT_CONNECTION; 513 pls |= USB_PORT_STAT_CONNECTION;
512 } 514 }
513 515
@@ -666,7 +668,7 @@ static u32 xhci_get_port_status(struct usb_hcd *hcd,
666 } 668 }
667 /* Update Port Link State */ 669 /* Update Port Link State */
668 if (hcd->speed == HCD_USB3) { 670 if (hcd->speed == HCD_USB3) {
669 xhci_hub_report_usb3_link_state(&status, raw_port_status); 671 xhci_hub_report_usb3_link_state(xhci, &status, raw_port_status);
670 /* 672 /*
671 * Verify if all USB3 Ports Have entered U0 already. 673 * Verify if all USB3 Ports Have entered U0 already.
672 * Delete Compliance Mode Timer if so. 674 * Delete Compliance Mode Timer if so.
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 8056d90690ee..8936211b161d 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1812,6 +1812,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
1812 1812
1813 if (xhci->lpm_command) 1813 if (xhci->lpm_command)
1814 xhci_free_command(xhci, xhci->lpm_command); 1814 xhci_free_command(xhci, xhci->lpm_command);
1815 xhci->lpm_command = NULL;
1815 if (xhci->cmd_ring) 1816 if (xhci->cmd_ring)
1816 xhci_ring_free(xhci, xhci->cmd_ring); 1817 xhci_ring_free(xhci, xhci->cmd_ring);
1817 xhci->cmd_ring = NULL; 1818 xhci->cmd_ring = NULL;
@@ -1819,7 +1820,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
1819 xhci_cleanup_command_queue(xhci); 1820 xhci_cleanup_command_queue(xhci);
1820 1821
1821 num_ports = HCS_MAX_PORTS(xhci->hcs_params1); 1822 num_ports = HCS_MAX_PORTS(xhci->hcs_params1);
1822 for (i = 0; i < num_ports; i++) { 1823 for (i = 0; i < num_ports && xhci->rh_bw; i++) {
1823 struct xhci_interval_bw_table *bwt = &xhci->rh_bw[i].bw_table; 1824 struct xhci_interval_bw_table *bwt = &xhci->rh_bw[i].bw_table;
1824 for (j = 0; j < XHCI_MAX_INTERVAL; j++) { 1825 for (j = 0; j < XHCI_MAX_INTERVAL; j++) {
1825 struct list_head *ep = &bwt->interval_bw[j].endpoints; 1826 struct list_head *ep = &bwt->interval_bw[j].endpoints;
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index c020b094fe7d..c4a8fca8ae93 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -3971,13 +3971,21 @@ static int __maybe_unused xhci_change_max_exit_latency(struct xhci_hcd *xhci,
3971 int ret; 3971 int ret;
3972 3972
3973 spin_lock_irqsave(&xhci->lock, flags); 3973 spin_lock_irqsave(&xhci->lock, flags);
3974 if (max_exit_latency == xhci->devs[udev->slot_id]->current_mel) { 3974
3975 virt_dev = xhci->devs[udev->slot_id];
3976
3977 /*
3978 * virt_dev might not exists yet if xHC resumed from hibernate (S4) and
3979 * xHC was re-initialized. Exit latency will be set later after
3980 * hub_port_finish_reset() is done and xhci->devs[] are re-allocated
3981 */
3982
3983 if (!virt_dev || max_exit_latency == virt_dev->current_mel) {
3975 spin_unlock_irqrestore(&xhci->lock, flags); 3984 spin_unlock_irqrestore(&xhci->lock, flags);
3976 return 0; 3985 return 0;
3977 } 3986 }
3978 3987
3979 /* Attempt to issue an Evaluate Context command to change the MEL. */ 3988 /* Attempt to issue an Evaluate Context command to change the MEL. */
3980 virt_dev = xhci->devs[udev->slot_id];
3981 command = xhci->lpm_command; 3989 command = xhci->lpm_command;
3982 ctrl_ctx = xhci_get_input_control_ctx(xhci, command->in_ctx); 3990 ctrl_ctx = xhci_get_input_control_ctx(xhci, command->in_ctx);
3983 if (!ctrl_ctx) { 3991 if (!ctrl_ctx) {