aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorDaniel Axtens <dja@axtens.net>2015-04-09 23:15:47 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2015-04-11 06:49:17 -0400
commit97884e00e29ad6654b8b6939bb805b9d6303427c (patch)
treec9c154d1927be0cc17353d51c2e7ba47c81b3375 /arch/powerpc/kernel
parent19124d6deed32c5c7096f1892dd9f3882cef4605 (diff)
powerpc: fsl_pci, swiotlb: Move controller ops from ppc_md to controller_ops
Move the installation of DMA operations out of swiotlb's subsys initcall, and into the generic PCI controller operations struct. These ops are installed conditionally, based on the ppc_swiotlb_enable global. The global can be set in two places: - swiotlb_detect_4g, which is always called at the arch initcall level - setup_pci_atmu, which is called as part of the fsl_add_bridge and fsl_pci_syscore_do_resume. fsl_pci_syscore_do_resume is called late enough that any changes as a result of that call will have no effect. As such, if we test the global and set the operations as part of fsl_add_bridge, after the call to setup_pci_atmu, we can be confident that it will cover all the PCI implementations affected by the changes to dma-swiotlb.c. Signed-off-by: Daniel Axtens <dja@axtens.net> Acked-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/dma-swiotlb.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/arch/powerpc/kernel/dma-swiotlb.c b/arch/powerpc/kernel/dma-swiotlb.c
index 735979764cd4..6e8d764ce47b 100644
--- a/arch/powerpc/kernel/dma-swiotlb.c
+++ b/arch/powerpc/kernel/dma-swiotlb.c
@@ -116,16 +116,13 @@ void __init swiotlb_detect_4g(void)
116 } 116 }
117} 117}
118 118
119static int __init swiotlb_late_init(void) 119static int __init check_swiotlb_enabled(void)
120{ 120{
121 if (ppc_swiotlb_enable) { 121 if (ppc_swiotlb_enable)
122 swiotlb_print_info(); 122 swiotlb_print_info();
123 set_pci_dma_ops(&swiotlb_dma_ops); 123 else
124 ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
125 } else {
126 swiotlb_free(); 124 swiotlb_free();
127 }
128 125
129 return 0; 126 return 0;
130} 127}
131subsys_initcall(swiotlb_late_init); 128subsys_initcall(check_swiotlb_enabled);