Skip to content

Commit

Permalink
x86: Set dma_ops to nommu_dma_ops by default
Browse files Browse the repository at this point in the history
We set dma_ops to nommu_dma_ops at two different places for
x86_32 and x86_64. This unifies them by setting dma_ops to
nommu_dma_ops by default.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
LKML-Reference: <1258199198-16657-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 Nov 15, 2009
1 parent b18485e commit a3b28ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions arch/x86/kernel/pci-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

static int forbid_dac __read_mostly;

struct dma_map_ops *dma_ops;
struct dma_map_ops *dma_ops = &nommu_dma_ops;
EXPORT_SYMBOL(dma_ops);

static int iommu_sac_force __read_mostly;
Expand Down Expand Up @@ -128,8 +128,6 @@ void __init pci_iommu_alloc(void)
#ifdef CONFIG_X86_64
/* free the range so iommu could get some range less than 4G */
dma32_free_bootmem();
#else
dma_ops = &nommu_dma_ops;
#endif
if (pci_swiotlb_init())
return;
Expand Down
3 changes: 1 addition & 2 deletions arch/x86/kernel/pci-swiotlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ int __init pci_swiotlb_init(void)
if (swiotlb) {
swiotlb_init(0);
dma_ops = &swiotlb_dma_ops;
} else
dma_ops = &nommu_dma_ops;
}

return swiotlb_force;
}

0 comments on commit a3b28ee

Please sign in to comment.