Skip to content

Commit

Permalink
x86: Move swiotlb initialization before dma32_free_bootmem
Browse files Browse the repository at this point in the history
The commit 75f1cdf 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>
  • Loading branch information
FUJITA Tomonori authored and Ingo Molnar committed Dec 14, 2009
1 parent eba11d6 commit f4780ca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/x86/kernel/pci-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f4780ca

Please sign in to comment.