1
0
Fork 0
alistair23-linux/arch/x86/pci
Akinobu Mita 9c5a362142 x86: enable DMA CMA with swiotlb
The DMA Contiguous Memory Allocator support on x86 is disabled when
swiotlb config option is enabled.  So DMA CMA is always disabled on
x86_64 because swiotlb is always enabled.  This attempts to support for
DMA CMA with enabling swiotlb config option.

The contiguous memory allocator on x86 is integrated in the function
dma_generic_alloc_coherent() which is .alloc callback in nommu_dma_ops
for dma_alloc_coherent().

x86_swiotlb_alloc_coherent() which is .alloc callback in swiotlb_dma_ops
tries to allocate with dma_generic_alloc_coherent() firstly and then
swiotlb_alloc_coherent() is called as a fallback.

The main part of supporting DMA CMA with swiotlb is that changing
x86_swiotlb_free_coherent() which is .free callback in swiotlb_dma_ops
for dma_free_coherent() so that it can distinguish memory allocated by
dma_generic_alloc_coherent() from one allocated by
swiotlb_alloc_coherent() and release it with dma_generic_free_coherent()
which can handle contiguous memory.  This change requires making
is_swiotlb_buffer() global function.

This also needs to change .free callback in the dma_map_ops for amd_gart
and sta2x11, because these dma_ops are also using
dma_generic_alloc_coherent().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Don Dutile <ddutile@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-06-04 16:53:57 -07:00
..
Makefile x86, platforms: Remove NUMAQ 2014-02-27 08:07:39 -08:00
acpi.c x86/PCI: Warn if we have to "guess" host bridge node information 2014-05-21 12:32:16 -06:00
amd_bus.c x86/PCI: Clean up and mark early_root_info_init() as deprecated 2014-05-27 10:47:49 -06:00
broadcom_bus.c x86/PCI: Fix Broadcom CNB20LE unintended sign extension 2014-04-25 11:01:08 -06:00
bus_numa.c x86/PCI: Remove unnecessary list_empty(&pci_root_infos) check 2014-02-03 10:38:52 -07:00
bus_numa.h x86/PCI: put busn resource in pci_root_info for native host bridge drivers 2012-06-13 15:42:24 -06:00
ce4100.c x86/ce4100: Fix PCI configuration register access for devices without interrupts 2012-10-30 10:16:47 +01:00
common.c Merge branch 'x86-nuke-platforms-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-04-02 13:15:58 -07:00
direct.c x86: constify PCI raw ops structures 2011-10-14 09:05:28 -07:00
early.c x86/PCI: remove early PCI pr_debug statements 2009-11-24 15:25:19 -08:00
fixup.c Merge branches 'pci/hotplug', 'pci/pci_is_bridge' and 'pci/virtualization' into next 2014-05-28 16:21:07 -06:00
i386.c x86/PCI: Move pcibios_assign_resources() annotation to definition 2014-05-23 10:47:19 -06:00
init.c x86, olpc: Use pci subarch init for OLPC 2010-02-25 19:26:23 -08:00
intel_mid_pci.c x86, intel-mid: Add Merrifield platform support 2014-01-15 14:38:58 -08:00
irq.c x86/PCI: Drop return value of pcibios_scan_root() 2014-02-03 10:38:29 -07:00
legacy.c x86/PCI: Use pcibios_scan_root() instead of pci_scan_bus_on_node() 2014-02-03 10:38:18 -07:00
mmconfig-shared.c SFI / ACPI: Fix warnings reported during builds with W=1 2013-12-07 01:24:33 +01:00
mmconfig_32.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
mmconfig_64.c X86: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
numachip.c x86/PCI: Add NumaChip remote PCI support 2012-12-07 14:24:32 -07:00
olpc.c x86: constify PCI raw ops structures 2011-10-14 09:05:28 -07:00
pcbios.c X86: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
sta2x11-fixup.c x86: enable DMA CMA with swiotlb 2014-06-04 16:53:57 -07:00
xen.c xen: add support for MSI message groups 2014-03-18 14:40:09 +00:00