diff options
Diffstat (limited to 'drivers/usb/host/xhci-mem.c')
-rw-r--r-- | drivers/usb/host/xhci-mem.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 2cfc465925bd..fbf75e57628b 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -1827,6 +1827,9 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) | |||
1827 | } | 1827 | } |
1828 | spin_unlock_irqrestore(&xhci->lock, flags); | 1828 | spin_unlock_irqrestore(&xhci->lock, flags); |
1829 | 1829 | ||
1830 | if (!xhci->rh_bw) | ||
1831 | goto no_bw; | ||
1832 | |||
1830 | num_ports = HCS_MAX_PORTS(xhci->hcs_params1); | 1833 | num_ports = HCS_MAX_PORTS(xhci->hcs_params1); |
1831 | for (i = 0; i < num_ports; i++) { | 1834 | for (i = 0; i < num_ports; i++) { |
1832 | struct xhci_interval_bw_table *bwt = &xhci->rh_bw[i].bw_table; | 1835 | struct xhci_interval_bw_table *bwt = &xhci->rh_bw[i].bw_table; |
@@ -1845,6 +1848,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) | |||
1845 | } | 1848 | } |
1846 | } | 1849 | } |
1847 | 1850 | ||
1851 | no_bw: | ||
1848 | xhci->num_usb2_ports = 0; | 1852 | xhci->num_usb2_ports = 0; |
1849 | xhci->num_usb3_ports = 0; | 1853 | xhci->num_usb3_ports = 0; |
1850 | xhci->num_active_eps = 0; | 1854 | xhci->num_active_eps = 0; |
@@ -2256,6 +2260,9 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
2256 | u32 page_size, temp; | 2260 | u32 page_size, temp; |
2257 | int i; | 2261 | int i; |
2258 | 2262 | ||
2263 | INIT_LIST_HEAD(&xhci->lpm_failed_devs); | ||
2264 | INIT_LIST_HEAD(&xhci->cancel_cmd_list); | ||
2265 | |||
2259 | page_size = xhci_readl(xhci, &xhci->op_regs->page_size); | 2266 | page_size = xhci_readl(xhci, &xhci->op_regs->page_size); |
2260 | xhci_dbg(xhci, "Supported page size register = 0x%x\n", page_size); | 2267 | xhci_dbg(xhci, "Supported page size register = 0x%x\n", page_size); |
2261 | for (i = 0; i < 16; i++) { | 2268 | for (i = 0; i < 16; i++) { |
@@ -2334,7 +2341,6 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
2334 | xhci->cmd_ring = xhci_ring_alloc(xhci, 1, 1, TYPE_COMMAND, flags); | 2341 | xhci->cmd_ring = xhci_ring_alloc(xhci, 1, 1, TYPE_COMMAND, flags); |
2335 | if (!xhci->cmd_ring) | 2342 | if (!xhci->cmd_ring) |
2336 | goto fail; | 2343 | goto fail; |
2337 | INIT_LIST_HEAD(&xhci->cancel_cmd_list); | ||
2338 | xhci_dbg(xhci, "Allocated command ring at %p\n", xhci->cmd_ring); | 2344 | xhci_dbg(xhci, "Allocated command ring at %p\n", xhci->cmd_ring); |
2339 | xhci_dbg(xhci, "First segment DMA is 0x%llx\n", | 2345 | xhci_dbg(xhci, "First segment DMA is 0x%llx\n", |
2340 | (unsigned long long)xhci->cmd_ring->first_seg->dma); | 2346 | (unsigned long long)xhci->cmd_ring->first_seg->dma); |
@@ -2445,8 +2451,6 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
2445 | if (xhci_setup_port_arrays(xhci, flags)) | 2451 | if (xhci_setup_port_arrays(xhci, flags)) |
2446 | goto fail; | 2452 | goto fail; |
2447 | 2453 | ||
2448 | INIT_LIST_HEAD(&xhci->lpm_failed_devs); | ||
2449 | |||
2450 | /* Enable USB 3.0 device notifications for function remote wake, which | 2454 | /* Enable USB 3.0 device notifications for function remote wake, which |
2451 | * is necessary for allowing USB 3.0 devices to do remote wakeup from | 2455 | * is necessary for allowing USB 3.0 devices to do remote wakeup from |
2452 | * U3 (device suspend). | 2456 | * U3 (device suspend). |