Commit 794e085e authored by Nathan Fontenot's avatar Nathan Fontenot Committed by Paul Mackerras

[PATCH] powerpc/pseries: EEH Cleanup

This patch removes unnecessary exports, marks functions as static when
possible, and simplifies some list-related code.
Signed-off-by: default avatarNathan Fontenot <nfont@austin.ibm.com>
Signed-off-by: default avatarLinas Vepstas <linas@austin.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 34422fed
...@@ -865,7 +865,7 @@ void __init eeh_init(void) ...@@ -865,7 +865,7 @@ void __init eeh_init(void)
* on the CEC architecture, type of the device, on earlier boot * on the CEC architecture, type of the device, on earlier boot
* command-line arguments & etc. * command-line arguments & etc.
*/ */
void eeh_add_device_early(struct device_node *dn) static void eeh_add_device_early(struct device_node *dn)
{ {
struct pci_controller *phb; struct pci_controller *phb;
struct eeh_early_enable_info info; struct eeh_early_enable_info info;
...@@ -882,7 +882,6 @@ void eeh_add_device_early(struct device_node *dn) ...@@ -882,7 +882,6 @@ void eeh_add_device_early(struct device_node *dn)
info.buid_lo = BUID_LO(phb->buid); info.buid_lo = BUID_LO(phb->buid);
early_enable_eeh(dn, &info); early_enable_eeh(dn, &info);
} }
EXPORT_SYMBOL_GPL(eeh_add_device_early);
void eeh_add_device_tree_early(struct device_node *dn) void eeh_add_device_tree_early(struct device_node *dn)
{ {
...@@ -893,20 +892,6 @@ void eeh_add_device_tree_early(struct device_node *dn) ...@@ -893,20 +892,6 @@ void eeh_add_device_tree_early(struct device_node *dn)
} }
EXPORT_SYMBOL_GPL(eeh_add_device_tree_early); EXPORT_SYMBOL_GPL(eeh_add_device_tree_early);
void eeh_add_device_tree_late(struct pci_bus *bus)
{
struct pci_dev *dev;
list_for_each_entry(dev, &bus->devices, bus_list) {
eeh_add_device_late(dev);
if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
struct pci_bus *subbus = dev->subordinate;
if (subbus)
eeh_add_device_tree_late(subbus);
}
}
}
/** /**
* eeh_add_device_late - perform EEH initialization for the indicated pci device * eeh_add_device_late - perform EEH initialization for the indicated pci device
* @dev: pci device for which to set up EEH * @dev: pci device for which to set up EEH
...@@ -914,7 +899,7 @@ void eeh_add_device_tree_late(struct pci_bus *bus) ...@@ -914,7 +899,7 @@ void eeh_add_device_tree_late(struct pci_bus *bus)
* This routine must be used to complete EEH initialization for PCI * This routine must be used to complete EEH initialization for PCI
* devices that were added after system boot (e.g. hotplug, dlpar). * devices that were added after system boot (e.g. hotplug, dlpar).
*/ */
void eeh_add_device_late(struct pci_dev *dev) static void eeh_add_device_late(struct pci_dev *dev)
{ {
struct device_node *dn; struct device_node *dn;
struct pci_dn *pdn; struct pci_dn *pdn;
...@@ -933,16 +918,33 @@ void eeh_add_device_late(struct pci_dev *dev) ...@@ -933,16 +918,33 @@ void eeh_add_device_late(struct pci_dev *dev)
pci_addr_cache_insert_device (dev); pci_addr_cache_insert_device (dev);
} }
EXPORT_SYMBOL_GPL(eeh_add_device_late);
void eeh_add_device_tree_late(struct pci_bus *bus)
{
struct pci_dev *dev;
list_for_each_entry(dev, &bus->devices, bus_list) {
eeh_add_device_late(dev);
if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
struct pci_bus *subbus = dev->subordinate;
if (subbus)
eeh_add_device_tree_late(subbus);
}
}
}
EXPORT_SYMBOL_GPL(eeh_add_device_tree_late);
/** /**
* eeh_remove_device - undo EEH setup for the indicated pci device * eeh_remove_device - undo EEH setup for the indicated pci device
* @dev: pci device to be removed * @dev: pci device to be removed
* *
* This routine should be when a device is removed from a running * This routine should be called when a device is removed from
* system (e.g. by hotplug or dlpar). * a running system (e.g. by hotplug or dlpar). It unregisters
* the PCI device from the EEH subsystem. I/O errors affecting
* this device will no longer be detected after this call; thus,
* i/o errors affecting this slot may leave this device unusable.
*/ */
void eeh_remove_device(struct pci_dev *dev) static void eeh_remove_device(struct pci_dev *dev)
{ {
struct device_node *dn; struct device_node *dn;
if (!dev || !eeh_subsystem_enabled) if (!dev || !eeh_subsystem_enabled)
...@@ -958,21 +960,17 @@ void eeh_remove_device(struct pci_dev *dev) ...@@ -958,21 +960,17 @@ void eeh_remove_device(struct pci_dev *dev)
PCI_DN(dn)->pcidev = NULL; PCI_DN(dn)->pcidev = NULL;
pci_dev_put (dev); pci_dev_put (dev);
} }
EXPORT_SYMBOL_GPL(eeh_remove_device);
void eeh_remove_bus_device(struct pci_dev *dev) void eeh_remove_bus_device(struct pci_dev *dev)
{ {
struct pci_bus *bus = dev->subordinate;
struct pci_dev *child, *tmp;
eeh_remove_device(dev); eeh_remove_device(dev);
if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
struct pci_bus *bus = dev->subordinate; if (bus && dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
struct list_head *ln; list_for_each_entry_safe(child, tmp, &bus->devices, bus_list)
if (!bus) eeh_remove_bus_device(child);
return;
for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) {
struct pci_dev *pdev = pci_dev_b(ln);
if (pdev)
eeh_remove_bus_device(pdev);
}
} }
} }
EXPORT_SYMBOL_GPL(eeh_remove_bus_device); EXPORT_SYMBOL_GPL(eeh_remove_bus_device);
......
...@@ -60,23 +60,9 @@ void __init pci_addr_cache_build(void); ...@@ -60,23 +60,9 @@ void __init pci_addr_cache_build(void);
* device (including config space i/o). Call eeh_add_device_late * device (including config space i/o). Call eeh_add_device_late
* to finish the eeh setup for this device. * to finish the eeh setup for this device.
*/ */
void eeh_add_device_early(struct device_node *);
void eeh_add_device_late(struct pci_dev *dev);
void eeh_add_device_tree_early(struct device_node *); void eeh_add_device_tree_early(struct device_node *);
void eeh_add_device_tree_late(struct pci_bus *); void eeh_add_device_tree_late(struct pci_bus *);
/**
* eeh_remove_device - undo EEH setup for the indicated pci device
* @dev: pci device to be removed
*
* This routine should be called when a device is removed from
* a running system (e.g. by hotplug or dlpar). It unregisters
* the PCI device from the EEH subsystem. I/O errors affecting
* this device will no longer be detected after this call; thus,
* i/o errors affecting this slot may leave this device unusable.
*/
void eeh_remove_device(struct pci_dev *);
/** /**
* eeh_remove_device_recursive - undo EEH for device & children. * eeh_remove_device_recursive - undo EEH for device & children.
* @dev: pci device to be removed * @dev: pci device to be removed
...@@ -116,12 +102,6 @@ static inline int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *d ...@@ -116,12 +102,6 @@ static inline int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *d
static inline void pci_addr_cache_build(void) { } static inline void pci_addr_cache_build(void) { }
static inline void eeh_add_device_early(struct device_node *dn) { }
static inline void eeh_add_device_late(struct pci_dev *dev) { }
static inline void eeh_remove_device(struct pci_dev *dev) { }
static inline void eeh_add_device_tree_early(struct device_node *dn) { } static inline void eeh_add_device_tree_early(struct device_node *dn) { }
static inline void eeh_add_device_tree_late(struct pci_bus *bus) { } static inline void eeh_add_device_tree_late(struct pci_bus *bus) { }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment