aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/kernel/pci_64.c9
-rw-r--r--arch/powerpc/platforms/cell/iommu.c4
-rw-r--r--arch/powerpc/platforms/celleb/iommu.c2
-rw-r--r--include/asm-powerpc/pci.h10
4 files changed, 16 insertions, 9 deletions
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 73d509343d5b..db1d40ef7d60 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -61,8 +61,7 @@ void iSeries_pcibios_init(void);
61 61
62LIST_HEAD(hose_list); 62LIST_HEAD(hose_list);
63 63
64struct dma_mapping_ops *pci_dma_ops; 64static struct dma_mapping_ops *pci_dma_ops;
65EXPORT_SYMBOL(pci_dma_ops);
66 65
67int global_phb_number; /* Global phb counter */ 66int global_phb_number; /* Global phb counter */
68 67
@@ -75,6 +74,12 @@ void set_pci_dma_ops(struct dma_mapping_ops *dma_ops)
75 pci_dma_ops = dma_ops; 74 pci_dma_ops = dma_ops;
76} 75}
77 76
77struct dma_mapping_ops *get_pci_dma_ops(void)
78{
79 return pci_dma_ops;
80}
81EXPORT_SYMBOL(get_pci_dma_ops);
82
78static void fixup_broken_pcnet32(struct pci_dev* dev) 83static void fixup_broken_pcnet32(struct pci_dev* dev)
79{ 84{
80 if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) { 85 if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index d0e02ea1d538..7c953cc022f6 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -496,7 +496,7 @@ static void cell_dma_dev_setup(struct device *dev)
496 struct dev_archdata *archdata = &dev->archdata; 496 struct dev_archdata *archdata = &dev->archdata;
497 497
498 /* If we run without iommu, no need to do anything */ 498 /* If we run without iommu, no need to do anything */
499 if (pci_dma_ops == &dma_direct_ops) 499 if (get_pci_dma_ops() == &dma_direct_ops)
500 return; 500 return;
501 501
502 /* Current implementation uses the first window available in that 502 /* Current implementation uses the first window available in that
@@ -530,7 +530,7 @@ static int cell_of_bus_notify(struct notifier_block *nb, unsigned long action,
530 return 0; 530 return 0;
531 531
532 /* We use the PCI DMA ops */ 532 /* We use the PCI DMA ops */
533 dev->archdata.dma_ops = pci_dma_ops; 533 dev->archdata.dma_ops = get_pci_dma_ops();
534 534
535 cell_dma_dev_setup(dev); 535 cell_dma_dev_setup(dev);
536 536
diff --git a/arch/powerpc/platforms/celleb/iommu.c b/arch/powerpc/platforms/celleb/iommu.c
index fecc4ffd475e..e94de6a24622 100644
--- a/arch/powerpc/platforms/celleb/iommu.c
+++ b/arch/powerpc/platforms/celleb/iommu.c
@@ -80,7 +80,7 @@ static int celleb_of_bus_notify(struct notifier_block *nb,
80 if (action != BUS_NOTIFY_ADD_DEVICE) 80 if (action != BUS_NOTIFY_ADD_DEVICE)
81 return 0; 81 return 0;
82 82
83 dev->archdata.dma_ops = pci_dma_ops; 83 dev->archdata.dma_ops = get_pci_dma_ops();
84 84
85 return 0; 85 return 0;
86} 86}
diff --git a/include/asm-powerpc/pci.h b/include/asm-powerpc/pci.h
index ebf31f1c5915..ce0f13e8eb14 100644
--- a/include/asm-powerpc/pci.h
+++ b/include/asm-powerpc/pci.h
@@ -71,17 +71,18 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
71#define PCI_DISABLE_MWI 71#define PCI_DISABLE_MWI
72 72
73#ifdef CONFIG_PCI 73#ifdef CONFIG_PCI
74extern struct dma_mapping_ops *pci_dma_ops;
75
76extern void set_pci_dma_ops(struct dma_mapping_ops *dma_ops); 74extern void set_pci_dma_ops(struct dma_mapping_ops *dma_ops);
75extern struct dma_mapping_ops *get_pci_dma_ops(void);
77 76
78/* For DAC DMA, we currently don't support it by default, but 77/* For DAC DMA, we currently don't support it by default, but
79 * we let 64-bit platforms override this. 78 * we let 64-bit platforms override this.
80 */ 79 */
81static inline int pci_dac_dma_supported(struct pci_dev *hwdev,u64 mask) 80static inline int pci_dac_dma_supported(struct pci_dev *hwdev,u64 mask)
82{ 81{
83 if (pci_dma_ops && pci_dma_ops->dac_dma_supported) 82 struct dma_mapping_ops *d = get_pci_dma_ops();
84 return pci_dma_ops->dac_dma_supported(&hwdev->dev, mask); 83
84 if (d && d->dac_dma_supported)
85 return d->dac_dma_supported(&hwdev->dev, mask);
85 return 0; 86 return 0;
86} 87}
87 88
@@ -103,6 +104,7 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
103} 104}
104#else /* CONFIG_PCI */ 105#else /* CONFIG_PCI */
105#define set_pci_dma_ops(d) 106#define set_pci_dma_ops(d)
107#define get_pci_dma_ops() NULL
106#endif 108#endif
107 109
108extern int pci_domain_nr(struct pci_bus *bus); 110extern int pci_domain_nr(struct pci_bus *bus);