aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@us.ibm.com>2011-05-09 08:58:03 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-05-19 00:30:43 -0400
commiteb0dd411bd90dd5ad3f1936930d3e83d9ef95561 (patch)
treeafb5a630b5ea5e9fb0bc869106759fb0b120630c /arch/powerpc/platforms
parent40f1ce7fb7e8b5d4d0821c0f3dc866cb1d47d99c (diff)
pseries/iommu: Restore iommu table pointer when restoring iommu ops
When we swtich to direct dma ops, we set the dma data union to have the dma offset. When we switch back to iommu table ops because of a later dma_set_mask, we need to restore the iommu table pointer. Without this change, crashes have been observed on kexec where (for reasons still being investigated) we fall back to a 32-bit dma mask on a particular device and then panic because the table pointer is not valid. The easiset way to find this value is to call pci_dma_dev_setup_pSeriesLP which will search up the pci tree until it finds the node with the table. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Cc: Milton Miller <miltonm@bga.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Anton Blanchard <anton@samba.org> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index 019009b10e62..48eec3b87026 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -1029,10 +1029,10 @@ static int dma_set_mask_pSeriesLP(struct device *dev, u64 dma_mask)
1029 if (!dev->dma_mask || !dma_supported(dev, dma_mask)) 1029 if (!dev->dma_mask || !dma_supported(dev, dma_mask))
1030 return -EIO; 1030 return -EIO;
1031 1031
1032 pdev = to_pci_dev(dev);
1033
1032 /* only attempt to use a new window if 64-bit DMA is requested */ 1034 /* only attempt to use a new window if 64-bit DMA is requested */
1033 if (!disable_ddw && dma_mask == DMA_BIT_MASK(64)) { 1035 if (!disable_ddw && dma_mask == DMA_BIT_MASK(64)) {
1034 pdev = to_pci_dev(dev);
1035
1036 dn = pci_device_to_OF_node(pdev); 1036 dn = pci_device_to_OF_node(pdev);
1037 dev_dbg(dev, "node is %s\n", dn->full_name); 1037 dev_dbg(dev, "node is %s\n", dn->full_name);
1038 1038
@@ -1063,6 +1063,7 @@ static int dma_set_mask_pSeriesLP(struct device *dev, u64 dma_mask)
1063 if (!ddw_enabled) { 1063 if (!ddw_enabled) {
1064 dev_info(dev, "Using 32-bit DMA via iommu\n"); 1064 dev_info(dev, "Using 32-bit DMA via iommu\n");
1065 set_dma_ops(dev, &dma_iommu_ops); 1065 set_dma_ops(dev, &dma_iommu_ops);
1066 pci_dma_dev_setup_pSeriesLP(pdev);
1066 } 1067 }
1067 1068
1068 *dev->dma_mask = dma_mask; 1069 *dev->dma_mask = dma_mask;