All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.34] ehci-hcd: add option to enable 64-bit DMA support
@ 2010-02-18  3:10 Robert Hancock
  2010-02-18  4:26 ` Greg KH
  2010-02-23  6:28 ` [PATCH 2.6.34] ehci-hcd: add option to enable 64-bit DMA support Yuhong Bao
  0 siblings, 2 replies; 36+ messages in thread
From: Robert Hancock @ 2010-02-18  3:10 UTC (permalink / raw)
  To: linux-kernel, Linux-usb, Linux USB

Add a module parameter to allow the user to enable 64-bit DMA support in EHCI,
which has been forcibly disabled since 2003 - see:

http://www.mail-archive.com/linux-usb-devel@lists.sourceforge.net/msg17230.html

At that time the comment was "it'd only matter on a few big Intel boxes anyway",
however the situation is much different today when many new machines have 4GB
or more of RAM and IOMMU/SWIOTLB are thus needlessly required for USB transfers.
For now, the support remains disabled by default and is controlled by an
allow_64bit module parameter.

Note that some USB device drivers may require updates to pass the DMA
capabilities up to their higher layers to avoid unnecessary IOMMU or bounce-
buffer use (i.e. networking layer NETIF_F_HIGHDMA). Some of these checks were
disabled by the patch listed above, and more may be required again today.
However, those previous checks were done incorrectly using dma_supported,
which checks to see whether a device's DMA mask can be validly set to a given
mask, not whether its previously set mask will accomodate the mask passed in.

Signed-off-by: Robert Hancock <hancockrwd@gmail.com>

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 1ec3857..f527e15 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -101,6 +101,10 @@ static int ignore_oc = 0;
 module_param (ignore_oc, bool, S_IRUGO);
 MODULE_PARM_DESC (ignore_oc, "ignore bogus hardware overcurrent indications");
 
+static int allow_64bit;
+module_param(allow_64bit, bool, S_IRUGO);
+MODULE_PARM_DESC(allow_64bit, "allow 64-bit DMA");
+
 #define	INTR_MASK (STS_IAA | STS_FATAL | STS_PCD | STS_ERR | STS_INT)
 
 /*-------------------------------------------------------------------------*/
@@ -644,11 +648,9 @@ static int ehci_run (struct usb_hcd *hcd)
 	hcc_params = ehci_readl(ehci, &ehci->caps->hcc_params);
 	if (HCC_64BIT_ADDR(hcc_params)) {
 		ehci_writel(ehci, 0, &ehci->regs->segment);
-#if 0
-// this is deeply broken on almost all architectures
-		if (!dma_set_mask(hcd->self.controller, DMA_BIT_MASK(64)))
+		if (allow_64bit &&
+		    !dma_set_mask(hcd->self.controller, DMA_BIT_MASK(64)))
 			ehci_info(ehci, "enabled 64bit DMA\n");
-#endif
 	}
 
 

^ permalink raw reply related	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2010-02-26  7:01 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-18  3:10 [PATCH 2.6.34] ehci-hcd: add option to enable 64-bit DMA support Robert Hancock
2010-02-18  4:26 ` Greg KH
2010-02-18  5:13   ` Robert Hancock
2010-02-18  5:22     ` Greg KH
2010-02-19  0:33       ` Robert Hancock
2010-02-19  0:47         ` Greg KH
2010-02-19  3:46           ` Robert Hancock
2010-02-19  3:54             ` Greg KH
2010-02-20  1:30               ` Robert Hancock
2010-02-20  4:26                 ` Greg KH
2010-02-20  5:39         ` David Brownell
2010-02-20  7:15           ` Robert Hancock
2010-02-20  8:07             ` David Brownell
2010-02-20 18:13               ` Robert Hancock
2010-02-23  6:48             ` Yuhong Bao
2010-02-24  0:26               ` Robert Hancock
2010-02-25  2:28                 ` Tejun Heo
2010-02-25  2:41                   ` Yuhong Bao
2010-02-25  2:58                     ` Tejun Heo
2010-02-25  3:15                   ` Yuhong Bao
2010-02-25  3:29                     ` Tejun Heo
2010-02-25  4:03                       ` Oliver Neukum
2010-02-25  5:25                         ` Tejun Heo
2010-02-25 16:14                           ` Greg KH
2010-02-25 23:15                             ` Robert Hancock
2010-02-25 23:25                               ` Greg KH
2010-02-26  7:01                                 ` Oliver Neukum
2010-02-24  3:53     ` SB600 64-bit DMA BIOS misconfiguration (formerly RE: [PATCH 2.6.34] ehci-hcd: add option to enable 64-bit DMA support) Yuhong Bao
2010-02-24  3:53       ` Yuhong Bao
2010-02-24  4:30       ` Robert Hancock
2010-02-24  4:30         ` Robert Hancock
2010-02-24  4:33         ` Yuhong Bao
2010-02-24  4:33           ` Yuhong Bao
2010-02-24 13:30         ` Huang, Shane
2010-02-24 13:30           ` Huang, Shane
2010-02-23  6:28 ` [PATCH 2.6.34] ehci-hcd: add option to enable 64-bit DMA support Yuhong Bao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.