aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Rothwell x <sfr@canb.auug.org.au>2009-05-06 10:07:52 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-05-15 02:43:41 -0400
commit397717c578a5e02cf76b6c99c68f50fee94b59f8 (patch)
treec4b02725a662150a9ba7129bd6cbfaa98a4adcd0
parent93f1cc609c702a83e44da51cabdd353b20c24f79 (diff)
powerpc/iseries: Fix pci breakage due to bad dma_data initialization
Commit 4fc665b88a79a45bae8bbf3a05563c27c7337c3d "powerpc: Merge 32 and 64-bit dma code" made changes to the PCI initialisation code that added an assignment to archdata.dma_data but only for 32 bit code. Commit 7eef440a545c7f812ed10b49d4a10a351df9cad6 "powerpc/pci: Cosmetic cleanups of pci-common.c" removed the conditional compilation. Unfortunately, the iSeries code setup the archdata.dma_data before that assignment was done - effectively overwriting the dma_data with NULL. Fix this up by moving the iSeries setup of dma_data into a pci_dma_dev_setup callback. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--arch/powerpc/include/asm/iseries/iommu.h4
-rw-r--r--arch/powerpc/platforms/iseries/iommu.c6
-rw-r--r--arch/powerpc/platforms/iseries/pci.c1
3 files changed, 5 insertions, 6 deletions
diff --git a/arch/powerpc/include/asm/iseries/iommu.h b/arch/powerpc/include/asm/iseries/iommu.h
index c59ee7e4bed1..1b9692c60899 100644
--- a/arch/powerpc/include/asm/iseries/iommu.h
+++ b/arch/powerpc/include/asm/iseries/iommu.h
@@ -26,10 +26,6 @@ struct vio_dev;
26struct device_node; 26struct device_node;
27struct iommu_table; 27struct iommu_table;
28 28
29/* Creates table for an individual device node */
30extern void iommu_devnode_init_iSeries(struct pci_dev *pdev,
31 struct device_node *dn);
32
33/* Get table parameters from HV */ 29/* Get table parameters from HV */
34extern void iommu_table_getparms_iSeries(unsigned long busno, 30extern void iommu_table_getparms_iSeries(unsigned long busno,
35 unsigned char slotno, unsigned char virtbus, 31 unsigned char slotno, unsigned char virtbus,
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c
index ff43f1fd8343..40219823d9b0 100644
--- a/arch/powerpc/platforms/iseries/iommu.c
+++ b/arch/powerpc/platforms/iseries/iommu.c
@@ -174,9 +174,10 @@ static struct iommu_table *iommu_table_find(struct iommu_table * tbl)
174} 174}
175 175
176 176
177void iommu_devnode_init_iSeries(struct pci_dev *pdev, struct device_node *dn) 177static void pci_dma_dev_setup_iseries(struct pci_dev *pdev)
178{ 178{
179 struct iommu_table *tbl; 179 struct iommu_table *tbl;
180 struct device_node *dn = pdev->sysdata;
180 struct pci_dn *pdn = PCI_DN(dn); 181 struct pci_dn *pdn = PCI_DN(dn);
181 const u32 *lsn = of_get_property(dn, "linux,logical-slot-number", NULL); 182 const u32 *lsn = of_get_property(dn, "linux,logical-slot-number", NULL);
182 183
@@ -194,6 +195,8 @@ void iommu_devnode_init_iSeries(struct pci_dev *pdev, struct device_node *dn)
194 kfree(tbl); 195 kfree(tbl);
195 pdev->dev.archdata.dma_data = pdn->iommu_table; 196 pdev->dev.archdata.dma_data = pdn->iommu_table;
196} 197}
198#else
199#define pci_dma_dev_setup_iseries NULL
197#endif 200#endif
198 201
199static struct iommu_table veth_iommu_table; 202static struct iommu_table veth_iommu_table;
@@ -251,5 +254,6 @@ void iommu_init_early_iSeries(void)
251 ppc_md.tce_build = tce_build_iSeries; 254 ppc_md.tce_build = tce_build_iSeries;
252 ppc_md.tce_free = tce_free_iSeries; 255 ppc_md.tce_free = tce_free_iSeries;
253 256
257 ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_iseries;
254 set_pci_dma_ops(&dma_iommu_ops); 258 set_pci_dma_ops(&dma_iommu_ops);
255} 259}
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index 02a634faedbe..21cddc30220b 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -444,7 +444,6 @@ void __init iSeries_pcibios_fixup_resources(struct pci_dev *pdev)
444 pdev->sysdata = node; 444 pdev->sysdata = node;
445 allocate_device_bars(pdev); 445 allocate_device_bars(pdev);
446 iseries_device_information(pdev, bus, *sub_bus); 446 iseries_device_information(pdev, bus, *sub_bus);
447 iommu_devnode_init_iSeries(pdev, node);
448} 447}
449 448
450/* 449/*