diff options
Diffstat (limited to 'drivers/usb/host/xhci-mem.c')
-rw-r--r-- | drivers/usb/host/xhci-mem.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index cae4c6f2845a..68eaa908ac8e 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -1796,11 +1796,6 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) | |||
1796 | int i; | 1796 | int i; |
1797 | 1797 | ||
1798 | /* Free the Event Ring Segment Table and the actual Event Ring */ | 1798 | /* Free the Event Ring Segment Table and the actual Event Ring */ |
1799 | if (xhci->ir_set) { | ||
1800 | xhci_writel(xhci, 0, &xhci->ir_set->erst_size); | ||
1801 | xhci_write_64(xhci, 0, &xhci->ir_set->erst_base); | ||
1802 | xhci_write_64(xhci, 0, &xhci->ir_set->erst_dequeue); | ||
1803 | } | ||
1804 | size = sizeof(struct xhci_erst_entry)*(xhci->erst.num_entries); | 1799 | size = sizeof(struct xhci_erst_entry)*(xhci->erst.num_entries); |
1805 | if (xhci->erst.entries) | 1800 | if (xhci->erst.entries) |
1806 | dma_free_coherent(&pdev->dev, size, | 1801 | dma_free_coherent(&pdev->dev, size, |
@@ -1812,7 +1807,6 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) | |||
1812 | xhci->event_ring = NULL; | 1807 | xhci->event_ring = NULL; |
1813 | xhci_dbg(xhci, "Freed event ring\n"); | 1808 | xhci_dbg(xhci, "Freed event ring\n"); |
1814 | 1809 | ||
1815 | xhci_write_64(xhci, 0, &xhci->op_regs->cmd_ring); | ||
1816 | if (xhci->cmd_ring) | 1810 | if (xhci->cmd_ring) |
1817 | xhci_ring_free(xhci, xhci->cmd_ring); | 1811 | xhci_ring_free(xhci, xhci->cmd_ring); |
1818 | xhci->cmd_ring = NULL; | 1812 | xhci->cmd_ring = NULL; |
@@ -1841,7 +1835,6 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) | |||
1841 | xhci->medium_streams_pool = NULL; | 1835 | xhci->medium_streams_pool = NULL; |
1842 | xhci_dbg(xhci, "Freed medium stream array pool\n"); | 1836 | xhci_dbg(xhci, "Freed medium stream array pool\n"); |
1843 | 1837 | ||
1844 | xhci_write_64(xhci, 0, &xhci->op_regs->dcbaa_ptr); | ||
1845 | if (xhci->dcbaa) | 1838 | if (xhci->dcbaa) |
1846 | dma_free_coherent(&pdev->dev, sizeof(*xhci->dcbaa), | 1839 | dma_free_coherent(&pdev->dev, sizeof(*xhci->dcbaa), |
1847 | xhci->dcbaa, xhci->dcbaa->dma); | 1840 | xhci->dcbaa, xhci->dcbaa->dma); |
@@ -2459,6 +2452,8 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
2459 | 2452 | ||
2460 | fail: | 2453 | fail: |
2461 | xhci_warn(xhci, "Couldn't initialize memory\n"); | 2454 | xhci_warn(xhci, "Couldn't initialize memory\n"); |
2455 | xhci_halt(xhci); | ||
2456 | xhci_reset(xhci); | ||
2462 | xhci_mem_cleanup(xhci); | 2457 | xhci_mem_cleanup(xhci); |
2463 | return -ENOMEM; | 2458 | return -ENOMEM; |
2464 | } | 2459 | } |