diff options
Diffstat (limited to 'drivers/usb/host/xhci-mem.c')
-rw-r--r-- | drivers/usb/host/xhci-mem.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 7cf15ca854be..be5a05b2021c 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -220,6 +220,12 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) | |||
220 | dma_pool_destroy(xhci->segment_pool); | 220 | dma_pool_destroy(xhci->segment_pool); |
221 | xhci->segment_pool = NULL; | 221 | xhci->segment_pool = NULL; |
222 | xhci_dbg(xhci, "Freed segment pool\n"); | 222 | xhci_dbg(xhci, "Freed segment pool\n"); |
223 | xhci_writel(xhci, 0, &xhci->op_regs->dcbaa_ptr[1]); | ||
224 | xhci_writel(xhci, 0, &xhci->op_regs->dcbaa_ptr[0]); | ||
225 | if (xhci->dcbaa) | ||
226 | pci_free_consistent(pdev, sizeof(*xhci->dcbaa), | ||
227 | xhci->dcbaa, xhci->dcbaa->dma); | ||
228 | xhci->dcbaa = NULL; | ||
223 | xhci->page_size = 0; | 229 | xhci->page_size = 0; |
224 | xhci->page_shift = 0; | 230 | xhci->page_shift = 0; |
225 | } | 231 | } |
@@ -263,6 +269,21 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
263 | xhci_writel(xhci, val, &xhci->op_regs->config_reg); | 269 | xhci_writel(xhci, val, &xhci->op_regs->config_reg); |
264 | 270 | ||
265 | /* | 271 | /* |
272 | * Section 5.4.8 - doorbell array must be | ||
273 | * "physically contiguous and 64-byte (cache line) aligned". | ||
274 | */ | ||
275 | xhci->dcbaa = pci_alloc_consistent(to_pci_dev(dev), | ||
276 | sizeof(*xhci->dcbaa), &dma); | ||
277 | if (!xhci->dcbaa) | ||
278 | goto fail; | ||
279 | memset(xhci->dcbaa, 0, sizeof *(xhci->dcbaa)); | ||
280 | xhci->dcbaa->dma = dma; | ||
281 | xhci_dbg(xhci, "// Setting device context base array address to 0x%x\n", | ||
282 | xhci->dcbaa->dma); | ||
283 | xhci_writel(xhci, (u32) 0, &xhci->op_regs->dcbaa_ptr[1]); | ||
284 | xhci_writel(xhci, dma, &xhci->op_regs->dcbaa_ptr[0]); | ||
285 | |||
286 | /* | ||
266 | * Initialize the ring segment pool. The ring must be a contiguous | 287 | * Initialize the ring segment pool. The ring must be a contiguous |
267 | * structure comprised of TRBs. The TRBs must be 16 byte aligned, | 288 | * structure comprised of TRBs. The TRBs must be 16 byte aligned, |
268 | * however, the command ring segment needs 64-byte aligned segments, | 289 | * however, the command ring segment needs 64-byte aligned segments, |