diff options
| author | 2009-12-05 15:22:26 -0800 | |
|---|---|---|
| committer | 2009-12-05 15:22:26 -0800 | |
| commit | 28b4d5cc17c20786848cdc07b7ea237a309776bb (patch) | |
| tree | bae406a4b17229dcce7c11be5073f7a67665e477 /arch/x86/kernel/pci-swiotlb.c | |
| parent | mac80211: fix reorder buffer release (diff) | |
| parent | Merge branch 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip (diff) | |
| download | linux-dev-28b4d5cc17c20786848cdc07b7ea237a309776bb.tar.xz linux-dev-28b4d5cc17c20786848cdc07b7ea237a309776bb.zip | |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Conflicts:
drivers/net/pcmcia/fmvj18x_cs.c
drivers/net/pcmcia/nmclan_cs.c
drivers/net/pcmcia/xirc2ps_cs.c
drivers/net/wireless/ray_cs.c
Diffstat (limited to 'arch/x86/kernel/pci-swiotlb.c')
| -rw-r--r-- | arch/x86/kernel/pci-swiotlb.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/arch/x86/kernel/pci-swiotlb.c b/arch/x86/kernel/pci-swiotlb.c index aaa6b7839f1e..e3c0a66b9e77 100644 --- a/arch/x86/kernel/pci-swiotlb.c +++ b/arch/x86/kernel/pci-swiotlb.c @@ -42,18 +42,28 @@ static struct dma_map_ops swiotlb_dma_ops = { .dma_supported = NULL, }; -void __init pci_swiotlb_init(void) +/* + * pci_swiotlb_init - initialize swiotlb if necessary + * + * This returns non-zero if we are forced to use swiotlb (by the boot + * option). + */ +int __init pci_swiotlb_init(void) { + int use_swiotlb = swiotlb | swiotlb_force; + /* don't initialize swiotlb if iommu=off (no_iommu=1) */ #ifdef CONFIG_X86_64 - if ((!iommu_detected && !no_iommu && max_pfn > MAX_DMA32_PFN)) + if (!no_iommu && max_pfn > MAX_DMA32_PFN) swiotlb = 1; #endif if (swiotlb_force) swiotlb = 1; + if (swiotlb) { - printk(KERN_INFO "PCI-DMA: Using software bounce buffering for IO (SWIOTLB)\n"); - swiotlb_init(); + swiotlb_init(0); dma_ops = &swiotlb_dma_ops; } + + return use_swiotlb; } |
