summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/pci-dma.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2009-12-14 11:52:14 +0900
committerIngo Molnar <mingo@elte.hu>2009-12-14 08:57:40 +0100
commitf4780ca005404166cc40af77ef0e86132ab98a81 (patch)
treedf6ee598c8d9bd45b60652082ac2284ea922ad6b /arch/x86/kernel/pci-dma.c
parenteba11d6da7a983cedb0acf32a38e4d0daa8b5d0e (diff)
downloadop-kernel-dev-f4780ca005404166cc40af77ef0e86132ab98a81.zip
op-kernel-dev-f4780ca005404166cc40af77ef0e86132ab98a81.tar.gz
x86: Move swiotlb initialization before dma32_free_bootmem
The commit 75f1cdf1dda92cae037ec848ae63690d91913eac introduced a bug that we initialize SWIOTLB right after dma32_free_bootmem so we wrongly steal memory area allocated for GART with broken BIOS earlier. This moves swiotlb initialization before dma32_free_bootmem(). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: yinghai@kernel.org LKML-Reference: <1260759135-6450-2-git-send-email-fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/pci-dma.c')
-rw-r--r--arch/x86/kernel/pci-dma.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index afcc58b..fcc2f2b 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -120,11 +120,14 @@ static void __init dma32_free_bootmem(void)
void __init pci_iommu_alloc(void)
{
+ int use_swiotlb;
+
+ use_swiotlb = pci_swiotlb_init();
#ifdef CONFIG_X86_64
/* free the range so iommu could get some range less than 4G */
dma32_free_bootmem();
#endif
- if (pci_swiotlb_init())
+ if (use_swiotlb)
return;
gart_iommu_hole_init();
OpenPOWER on IntegriCloud