aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/xhci.c')
-rw-r--r--drivers/usb/host/xhci.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index b6f21175b872..c4a8fca8ae93 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -2880,6 +2880,9 @@ void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci,
2880 ep_index, ep->stopped_stream, ep->stopped_td, 2880 ep_index, ep->stopped_stream, ep->stopped_td,
2881 &deq_state); 2881 &deq_state);
2882 2882
2883 if (!deq_state.new_deq_ptr || !deq_state.new_deq_seg)
2884 return;
2885
2883 /* HW with the reset endpoint quirk will use the saved dequeue state to 2886 /* HW with the reset endpoint quirk will use the saved dequeue state to
2884 * issue a configure endpoint command later. 2887 * issue a configure endpoint command later.
2885 */ 2888 */
@@ -3968,13 +3971,21 @@ static int __maybe_unused xhci_change_max_exit_latency(struct xhci_hcd *xhci,
3968 int ret; 3971 int ret;
3969 3972
3970 spin_lock_irqsave(&xhci->lock, flags); 3973 spin_lock_irqsave(&xhci->lock, flags);
3971 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) {
3972 spin_unlock_irqrestore(&xhci->lock, flags); 3984 spin_unlock_irqrestore(&xhci->lock, flags);
3973 return 0; 3985 return 0;
3974 } 3986 }
3975 3987
3976 /* Attempt to issue an Evaluate Context command to change the MEL. */ 3988 /* Attempt to issue an Evaluate Context command to change the MEL. */
3977 virt_dev = xhci->devs[udev->slot_id];
3978 command = xhci->lpm_command; 3989 command = xhci->lpm_command;
3979 ctrl_ctx = xhci_get_input_control_ctx(xhci, command->in_ctx); 3990 ctrl_ctx = xhci_get_input_control_ctx(xhci, command->in_ctx);
3980 if (!ctrl_ctx) { 3991 if (!ctrl_ctx) {