diff options
author | Gavin Shan <shangw@linux.vnet.ibm.com> | 2012-03-20 17:30:28 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-03-27 20:31:57 -0400 |
commit | 39baadbf36cee3ede5fdb8a34006d9109e5e2570 (patch) | |
tree | 5640b9983e237cff95b1348dcef8659eba22c7f8 /arch/powerpc | |
parent | 2a0352fa4a78081c76be1e450b51a6aa27c92616 (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')
-rw-r--r-- | arch/powerpc/include/asm/pci-bridge.h | 8 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/iommu.c | 29 |
2 files changed, 13 insertions, 24 deletions
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h index 21f99aec41b9..ac39e6a3b25a 100644 --- a/arch/powerpc/include/asm/pci-bridge.h +++ b/arch/powerpc/include/asm/pci-bridge.h | |||
@@ -156,14 +156,6 @@ struct pci_dn { | |||
156 | struct pci_dev *pcidev; /* back-pointer to the pci device */ | 156 | struct pci_dev *pcidev; /* back-pointer to the pci device */ |
157 | #ifdef CONFIG_EEH | 157 | #ifdef CONFIG_EEH |
158 | struct eeh_dev *edev; /* eeh device */ | 158 | struct eeh_dev *edev; /* eeh device */ |
159 | int class_code; /* pci device class */ | ||
160 | int eeh_mode; /* See eeh.h for possible EEH_MODEs */ | ||
161 | int eeh_config_addr; | ||
162 | int eeh_pe_config_addr; /* new-style partition endpoint address */ | ||
163 | int eeh_check_count; /* # times driver ignored error */ | ||
164 | int eeh_freeze_count; /* # times this device froze up. */ | ||
165 | int eeh_false_positives; /* # times this device reported #ff's */ | ||
166 | u32 config_space[16]; /* saved PCI config space */ | ||
167 | #endif | 159 | #endif |
168 | #define IODA_INVALID_PE (-1) | 160 | #define IODA_INVALID_PE (-1) |
169 | #ifdef CONFIG_PPC_POWERNV | 161 | #ifdef CONFIG_PPC_POWERNV |
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); | |||
809 | static int query_ddw(struct pci_dev *dev, const u32 *ddw_avail, | 809 | static 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) */ |