aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/ehci-hcd.c4
-rw-r--r--drivers/usb/host/max3421-hcd.c2
-rw-r--r--drivers/usb/host/xhci-hub.c3
-rw-r--r--drivers/usb/host/xhci-pci.c3
-rw-r--r--drivers/usb/host/xhci-ring.c16
5 files changed, 17 insertions, 11 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index a962b89b65a6..1e5f529d51a2 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -332,11 +332,11 @@ static void ehci_turn_off_all_ports(struct ehci_hcd *ehci)
332 int port = HCS_N_PORTS(ehci->hcs_params); 332 int port = HCS_N_PORTS(ehci->hcs_params);
333 333
334 while (port--) { 334 while (port--) {
335 ehci_writel(ehci, PORT_RWC_BITS,
336 &ehci->regs->port_status[port]);
337 spin_unlock_irq(&ehci->lock); 335 spin_unlock_irq(&ehci->lock);
338 ehci_port_power(ehci, port, false); 336 ehci_port_power(ehci, port, false);
339 spin_lock_irq(&ehci->lock); 337 spin_lock_irq(&ehci->lock);
338 ehci_writel(ehci, PORT_RWC_BITS,
339 &ehci->regs->port_status[port]);
340 } 340 }
341} 341}
342 342
diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c
index c369c29e496d..2f7690092a7f 100644
--- a/drivers/usb/host/max3421-hcd.c
+++ b/drivers/usb/host/max3421-hcd.c
@@ -1675,7 +1675,7 @@ max3421_gpout_set_value(struct usb_hcd *hcd, u8 pin_number, u8 value)
1675 if (pin_number > 7) 1675 if (pin_number > 7)
1676 return; 1676 return;
1677 1677
1678 mask = 1u << pin_number; 1678 mask = 1u << (pin_number % 4);
1679 idx = pin_number / 4; 1679 idx = pin_number / 4;
1680 1680
1681 if (value) 1681 if (value)
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index d61fcc48099e..730b9fd26685 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -386,6 +386,9 @@ static int xhci_stop_device(struct xhci_hcd *xhci, int slot_id, int suspend)
386 386
387 ret = 0; 387 ret = 0;
388 virt_dev = xhci->devs[slot_id]; 388 virt_dev = xhci->devs[slot_id];
389 if (!virt_dev)
390 return -ENODEV;
391
389 cmd = xhci_alloc_command(xhci, false, true, GFP_NOIO); 392 cmd = xhci_alloc_command(xhci, false, true, GFP_NOIO);
390 if (!cmd) { 393 if (!cmd) {
391 xhci_dbg(xhci, "Couldn't allocate command structure.\n"); 394 xhci_dbg(xhci, "Couldn't allocate command structure.\n");
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 4fd041bec332..d7b0f97abbad 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -314,11 +314,12 @@ static void xhci_pci_remove(struct pci_dev *dev)
314 usb_remove_hcd(xhci->shared_hcd); 314 usb_remove_hcd(xhci->shared_hcd);
315 usb_put_hcd(xhci->shared_hcd); 315 usb_put_hcd(xhci->shared_hcd);
316 } 316 }
317 usb_hcd_pci_remove(dev);
318 317
319 /* Workaround for spurious wakeups at shutdown with HSW */ 318 /* Workaround for spurious wakeups at shutdown with HSW */
320 if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) 319 if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
321 pci_set_power_state(dev, PCI_D3hot); 320 pci_set_power_state(dev, PCI_D3hot);
321
322 usb_hcd_pci_remove(dev);
322} 323}
323 324
324#ifdef CONFIG_PM 325#ifdef CONFIG_PM
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 918e0c739b79..fd9fd12e4861 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1334,12 +1334,6 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
1334 1334
1335 cmd = list_entry(xhci->cmd_list.next, struct xhci_command, cmd_list); 1335 cmd = list_entry(xhci->cmd_list.next, struct xhci_command, cmd_list);
1336 1336
1337 if (cmd->command_trb != xhci->cmd_ring->dequeue) {
1338 xhci_err(xhci,
1339 "Command completion event does not match command\n");
1340 return;
1341 }
1342
1343 del_timer(&xhci->cmd_timer); 1337 del_timer(&xhci->cmd_timer);
1344 1338
1345 trace_xhci_cmd_completion(cmd_trb, (struct xhci_generic_trb *) event); 1339 trace_xhci_cmd_completion(cmd_trb, (struct xhci_generic_trb *) event);
@@ -1351,6 +1345,13 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
1351 xhci_handle_stopped_cmd_ring(xhci, cmd); 1345 xhci_handle_stopped_cmd_ring(xhci, cmd);
1352 return; 1346 return;
1353 } 1347 }
1348
1349 if (cmd->command_trb != xhci->cmd_ring->dequeue) {
1350 xhci_err(xhci,
1351 "Command completion event does not match command\n");
1352 return;
1353 }
1354
1354 /* 1355 /*
1355 * Host aborted the command ring, check if the current command was 1356 * Host aborted the command ring, check if the current command was
1356 * supposed to be aborted, otherwise continue normally. 1357 * supposed to be aborted, otherwise continue normally.
@@ -3243,7 +3244,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
3243 send_addr = addr; 3244 send_addr = addr;
3244 3245
3245 /* Queue the TRBs, even if they are zero-length */ 3246 /* Queue the TRBs, even if they are zero-length */
3246 for (enqd_len = 0; enqd_len < full_len; enqd_len += trb_buff_len) { 3247 for (enqd_len = 0; first_trb || enqd_len < full_len;
3248 enqd_len += trb_buff_len) {
3247 field = TRB_TYPE(TRB_NORMAL); 3249 field = TRB_TYPE(TRB_NORMAL);
3248 3250
3249 /* TRB buffer should not cross 64KB boundaries */ 3251 /* TRB buffer should not cross 64KB boundaries */