aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-pci.c
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2010-07-30 01:13:22 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-10 17:35:45 -0400
commit006d5820b41b298328e6b6085e4d58129fbc78f0 (patch)
tree553c36401c2442ac8f08311a9a7e2bdf2e0d5edb /drivers/usb/host/xhci-pci.c
parented3f24539209826235debaec66ca0da708b5bb89 (diff)
USB: xhci: Set DMA mask for host.
Tell the USB core that we can do DMA directly (instead of needing it to memory-map the buffers for PIO). If the xHCI host supports 64-bit addresses, set the DMA mask accordingly. Otherwise indicate the host can handle 32-bit DMA addresses. This improves performance because the USB core doesn't have to spend time remapping buffers in high memory into the 32-bit address range. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/xhci-pci.c')
-rw-r--r--drivers/usb/host/xhci-pci.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 11482b6b9381..f7efe025beda 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -53,6 +53,7 @@ static int xhci_pci_setup(struct usb_hcd *hcd)
53 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 53 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
54 struct pci_dev *pdev = to_pci_dev(hcd->self.controller); 54 struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
55 int retval; 55 int retval;
56 u32 temp;
56 57
57 hcd->self.sg_tablesize = TRBS_PER_SEGMENT - 2; 58 hcd->self.sg_tablesize = TRBS_PER_SEGMENT - 2;
58 59
@@ -93,6 +94,14 @@ static int xhci_pci_setup(struct usb_hcd *hcd)
93 return retval; 94 return retval;
94 xhci_dbg(xhci, "Reset complete\n"); 95 xhci_dbg(xhci, "Reset complete\n");
95 96
97 temp = xhci_readl(xhci, &xhci->cap_regs->hcc_params);
98 if (HCC_64BIT_ADDR(temp)) {
99 xhci_dbg(xhci, "Enabling 64-bit DMA addresses.\n");
100 dma_set_mask(hcd->self.controller, DMA_BIT_MASK(64));
101 } else {
102 dma_set_mask(hcd->self.controller, DMA_BIT_MASK(32));
103 }
104
96 xhci_dbg(xhci, "Calling HCD init\n"); 105 xhci_dbg(xhci, "Calling HCD init\n");
97 /* Initialize HCD and host controller data structures. */ 106 /* Initialize HCD and host controller data structures. */
98 retval = xhci_init(hcd); 107 retval = xhci_init(hcd);