aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries/iommu.c
diff options
context:
space:
mode:
authorGavin Shan <shangw@linux.vnet.ibm.com>2012-03-20 17:30:28 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-03-27 20:31:57 -0400
commit39baadbf36cee3ede5fdb8a34006d9109e5e2570 (patch)
tree5640b9983e237cff95b1348dcef8659eba22c7f8 /arch/powerpc/platforms/pseries/iommu.c
parent2a0352fa4a78081c76be1e450b51a6aa27c92616 (diff)
powerpc/eeh: Remove eeh information from pci_dn
The patch removes the eeh information from pci_dn since the eeh device (struct eeh_dev) already contained those information and the copy in pci_dn is no longer used except for the pseries iommu mapping code, which we change to retrieve the PE address from eeh device instead. Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries/iommu.c')
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index c442f2b1980f..0915b1ad66ce 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -809,8 +809,7 @@ machine_arch_initcall(pseries, find_existing_ddw_windows);
809static int query_ddw(struct pci_dev *dev, const u32 *ddw_avail, 809static int query_ddw(struct pci_dev *dev, const u32 *ddw_avail,
810 struct ddw_query_response *query) 810 struct ddw_query_response *query)
811{ 811{
812 struct device_node *dn; 812 struct eeh_dev *edev;
813 struct pci_dn *pcidn;
814 u32 cfg_addr; 813 u32 cfg_addr;
815 u64 buid; 814 u64 buid;
816 int ret; 815 int ret;
@@ -821,12 +820,12 @@ static int query_ddw(struct pci_dev *dev, const u32 *ddw_avail,
821 * Retrieve them from the pci device, not the node with the 820 * Retrieve them from the pci device, not the node with the
822 * dma-window property 821 * dma-window property
823 */ 822 */
824 dn = pci_device_to_OF_node(dev); 823 edev = pci_dev_to_eeh_dev(dev);
825 pcidn = PCI_DN(dn); 824 cfg_addr = edev->config_addr;
826 cfg_addr = pcidn->eeh_config_addr; 825 if (edev->pe_config_addr)
827 if (pcidn->eeh_pe_config_addr) 826 cfg_addr = edev->pe_config_addr;
828 cfg_addr = pcidn->eeh_pe_config_addr; 827 buid = edev->phb->buid;
829 buid = pcidn->phb->buid; 828
830 ret = rtas_call(ddw_avail[0], 3, 5, (u32 *)query, 829 ret = rtas_call(ddw_avail[0], 3, 5, (u32 *)query,
831 cfg_addr, BUID_HI(buid), BUID_LO(buid)); 830 cfg_addr, BUID_HI(buid), BUID_LO(buid));
832 dev_info(&dev->dev, "ibm,query-pe-dma-windows(%x) %x %x %x" 831 dev_info(&dev->dev, "ibm,query-pe-dma-windows(%x) %x %x %x"
@@ -839,8 +838,7 @@ static int create_ddw(struct pci_dev *dev, const u32 *ddw_avail,
839 struct ddw_create_response *create, int page_shift, 838 struct ddw_create_response *create, int page_shift,
840 int window_shift) 839 int window_shift)
841{ 840{
842 struct device_node *dn; 841 struct eeh_dev *edev;
843 struct pci_dn *pcidn;
844 u32 cfg_addr; 842 u32 cfg_addr;
845 u64 buid; 843 u64 buid;
846 int ret; 844 int ret;
@@ -851,12 +849,11 @@ static int create_ddw(struct pci_dev *dev, const u32 *ddw_avail,
851 * Retrieve them from the pci device, not the node with the 849 * Retrieve them from the pci device, not the node with the
852 * dma-window property 850 * dma-window property
853 */ 851 */
854 dn = pci_device_to_OF_node(dev); 852 edev = pci_dev_to_eeh_dev(dev);
855 pcidn = PCI_DN(dn); 853 cfg_addr = edev->config_addr;
856 cfg_addr = pcidn->eeh_config_addr; 854 if (edev->pe_config_addr)
857 if (pcidn->eeh_pe_config_addr) 855 cfg_addr = edev->pe_config_addr;
858 cfg_addr = pcidn->eeh_pe_config_addr; 856 buid = edev->phb->buid;
859 buid = pcidn->phb->buid;
860 857
861 do { 858 do {
862 /* extra outputs are LIOBN and dma-addr (hi, lo) */ 859 /* extra outputs are LIOBN and dma-addr (hi, lo) */