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>
This commit is contained in:
Gavin Shan 2012-03-20 21:30:28 +00:00 committed by Benjamin Herrenschmidt
parent 2a0352fa4a
commit 39baadbf36
2 changed files with 13 additions and 24 deletions

View file

@ -156,14 +156,6 @@ struct pci_dn {
struct pci_dev *pcidev; /* back-pointer to the pci device */ struct pci_dev *pcidev; /* back-pointer to the pci device */
#ifdef CONFIG_EEH #ifdef CONFIG_EEH
struct eeh_dev *edev; /* eeh device */ struct eeh_dev *edev; /* eeh device */
int class_code; /* pci device class */
int eeh_mode; /* See eeh.h for possible EEH_MODEs */
int eeh_config_addr;
int eeh_pe_config_addr; /* new-style partition endpoint address */
int eeh_check_count; /* # times driver ignored error */
int eeh_freeze_count; /* # times this device froze up. */
int eeh_false_positives; /* # times this device reported #ff's */
u32 config_space[16]; /* saved PCI config space */
#endif #endif
#define IODA_INVALID_PE (-1) #define IODA_INVALID_PE (-1)
#ifdef CONFIG_PPC_POWERNV #ifdef CONFIG_PPC_POWERNV

View file

@ -809,8 +809,7 @@ machine_arch_initcall(pseries, find_existing_ddw_windows);
static int query_ddw(struct pci_dev *dev, const u32 *ddw_avail, static int query_ddw(struct pci_dev *dev, const u32 *ddw_avail,
struct ddw_query_response *query) struct ddw_query_response *query)
{ {
struct device_node *dn; struct eeh_dev *edev;
struct pci_dn *pcidn;
u32 cfg_addr; u32 cfg_addr;
u64 buid; u64 buid;
int ret; int ret;
@ -821,12 +820,12 @@ static int query_ddw(struct pci_dev *dev, const u32 *ddw_avail,
* Retrieve them from the pci device, not the node with the * Retrieve them from the pci device, not the node with the
* dma-window property * dma-window property
*/ */
dn = pci_device_to_OF_node(dev); edev = pci_dev_to_eeh_dev(dev);
pcidn = PCI_DN(dn); cfg_addr = edev->config_addr;
cfg_addr = pcidn->eeh_config_addr; if (edev->pe_config_addr)
if (pcidn->eeh_pe_config_addr) cfg_addr = edev->pe_config_addr;
cfg_addr = pcidn->eeh_pe_config_addr; buid = edev->phb->buid;
buid = pcidn->phb->buid;
ret = rtas_call(ddw_avail[0], 3, 5, (u32 *)query, ret = rtas_call(ddw_avail[0], 3, 5, (u32 *)query,
cfg_addr, BUID_HI(buid), BUID_LO(buid)); cfg_addr, BUID_HI(buid), BUID_LO(buid));
dev_info(&dev->dev, "ibm,query-pe-dma-windows(%x) %x %x %x" 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,
struct ddw_create_response *create, int page_shift, struct ddw_create_response *create, int page_shift,
int window_shift) int window_shift)
{ {
struct device_node *dn; struct eeh_dev *edev;
struct pci_dn *pcidn;
u32 cfg_addr; u32 cfg_addr;
u64 buid; u64 buid;
int ret; int ret;
@ -851,12 +849,11 @@ static int create_ddw(struct pci_dev *dev, const u32 *ddw_avail,
* Retrieve them from the pci device, not the node with the * Retrieve them from the pci device, not the node with the
* dma-window property * dma-window property
*/ */
dn = pci_device_to_OF_node(dev); edev = pci_dev_to_eeh_dev(dev);
pcidn = PCI_DN(dn); cfg_addr = edev->config_addr;
cfg_addr = pcidn->eeh_config_addr; if (edev->pe_config_addr)
if (pcidn->eeh_pe_config_addr) cfg_addr = edev->pe_config_addr;
cfg_addr = pcidn->eeh_pe_config_addr; buid = edev->phb->buid;
buid = pcidn->phb->buid;
do { do {
/* extra outputs are LIOBN and dma-addr (hi, lo) */ /* extra outputs are LIOBN and dma-addr (hi, lo) */