summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powernv/eeh-powernv.c
diff options
context:
space:
mode:
authorGavin Shan <shangw@linux.vnet.ibm.com>2013-06-27 07:46:48 +0200
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-07-01 03:10:33 +0200
commit9bf41be6737327b7c06cd3f210a0cb599f4aa790 (patch)
tree5b1975aad28df78f6d0dbf58e37f67cc94e808fa /arch/powerpc/platforms/powernv/eeh-powernv.c
parentpowerpc/eeh: Avoid build warnings (diff)
downloadlinux-9bf41be6737327b7c06cd3f210a0cb599f4aa790.tar.xz
linux-9bf41be6737327b7c06cd3f210a0cb599f4aa790.zip
powerpc/powernv: Use dev-node in PCI config accessors
Currently, we're using the combo (PCI bus + devfn) in the PCI config accessors and PCI config accessors in EEH depends on them. However, it's not safe to refer the PCI bus which might have been removed during hotplug. So we're using device node in the PCI config accessors and the corresponding backends just reuse them. The patch also fix one potential risk: We possiblly have frozen PE during the early PCI probe time, but we haven't setup the PE mapping yet. So the errors should be counted to PE#0. 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/powernv/eeh-powernv.c')
-rw-r--r--arch/powerpc/platforms/powernv/eeh-powernv.c44
1 files changed, 2 insertions, 42 deletions
diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c
index 9559115424d6..969cce73055a 100644
--- a/arch/powerpc/platforms/powernv/eeh-powernv.c
+++ b/arch/powerpc/platforms/powernv/eeh-powernv.c
@@ -315,46 +315,6 @@ static int powernv_eeh_configure_bridge(struct eeh_pe *pe)
}
/**
- * powernv_eeh_read_config - Read PCI config space
- * @dn: device node
- * @where: PCI address
- * @size: size to read
- * @val: return value
- *
- * Read config space from the speicifed device
- */
-static int powernv_eeh_read_config(struct device_node *dn, int where,
- int size, u32 *val)
-{
- struct eeh_dev *edev = of_node_to_eeh_dev(dn);
- struct pci_dev *dev = eeh_dev_to_pci_dev(edev);
- struct pci_controller *hose = edev->phb;
-
- return hose->ops->read(dev->bus, dev->devfn, where, size, val);
-}
-
-/**
- * powernv_eeh_write_config - Write PCI config space
- * @dn: device node
- * @where: PCI address
- * @size: size to write
- * @val: value to be written
- *
- * Write config space to the specified device
- */
-static int powernv_eeh_write_config(struct device_node *dn, int where,
- int size, u32 val)
-{
- struct eeh_dev *edev = of_node_to_eeh_dev(dn);
- struct pci_dev *dev = eeh_dev_to_pci_dev(edev);
- struct pci_controller *hose = edev->phb;
-
- hose = pci_bus_to_host(dev->bus);
-
- return hose->ops->write(dev->bus, dev->devfn, where, size, val);
-}
-
-/**
* powernv_eeh_next_error - Retrieve next EEH error to handle
* @pe: Affected PE
*
@@ -389,8 +349,8 @@ static struct eeh_ops powernv_eeh_ops = {
.wait_state = powernv_eeh_wait_state,
.get_log = powernv_eeh_get_log,
.configure_bridge = powernv_eeh_configure_bridge,
- .read_config = powernv_eeh_read_config,
- .write_config = powernv_eeh_write_config,
+ .read_config = pnv_pci_cfg_read,
+ .write_config = pnv_pci_cfg_write,
.next_error = powernv_eeh_next_error
};