diff options
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh.c | 26 | ||||
-rw-r--r-- | include/asm-powerpc/eeh.h | 10 |
2 files changed, 36 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index c8d2a40dc5b4..7fbfd16d72b7 100644 --- a/arch/powerpc/platforms/pseries/eeh.c +++ b/arch/powerpc/platforms/pseries/eeh.c | |||
@@ -1093,6 +1093,15 @@ void eeh_add_device_early(struct device_node *dn) | |||
1093 | } | 1093 | } |
1094 | EXPORT_SYMBOL_GPL(eeh_add_device_early); | 1094 | EXPORT_SYMBOL_GPL(eeh_add_device_early); |
1095 | 1095 | ||
1096 | void eeh_add_device_tree_early(struct device_node *dn) | ||
1097 | { | ||
1098 | struct device_node *sib; | ||
1099 | for (sib = dn->child; sib; sib = sib->sibling) | ||
1100 | eeh_add_device_tree_early(sib); | ||
1101 | eeh_add_device_early(dn); | ||
1102 | } | ||
1103 | EXPORT_SYMBOL_GPL(eeh_add_device_tree_early); | ||
1104 | |||
1096 | /** | 1105 | /** |
1097 | * eeh_add_device_late - perform EEH initialization for the indicated pci device | 1106 | * eeh_add_device_late - perform EEH initialization for the indicated pci device |
1098 | * @dev: pci device for which to set up EEH | 1107 | * @dev: pci device for which to set up EEH |
@@ -1147,6 +1156,23 @@ void eeh_remove_device(struct pci_dev *dev) | |||
1147 | } | 1156 | } |
1148 | EXPORT_SYMBOL_GPL(eeh_remove_device); | 1157 | EXPORT_SYMBOL_GPL(eeh_remove_device); |
1149 | 1158 | ||
1159 | void eeh_remove_bus_device(struct pci_dev *dev) | ||
1160 | { | ||
1161 | eeh_remove_device(dev); | ||
1162 | if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { | ||
1163 | struct pci_bus *bus = dev->subordinate; | ||
1164 | struct list_head *ln; | ||
1165 | if (!bus) | ||
1166 | return; | ||
1167 | for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) { | ||
1168 | struct pci_dev *pdev = pci_dev_b(ln); | ||
1169 | if (pdev) | ||
1170 | eeh_remove_bus_device(pdev); | ||
1171 | } | ||
1172 | } | ||
1173 | } | ||
1174 | EXPORT_SYMBOL_GPL(eeh_remove_bus_device); | ||
1175 | |||
1150 | static int proc_eeh_show(struct seq_file *m, void *v) | 1176 | static int proc_eeh_show(struct seq_file *m, void *v) |
1151 | { | 1177 | { |
1152 | unsigned int cpu; | 1178 | unsigned int cpu; |
diff --git a/include/asm-powerpc/eeh.h b/include/asm-powerpc/eeh.h index f8633aafe4ba..e4ca35ad3338 100644 --- a/include/asm-powerpc/eeh.h +++ b/include/asm-powerpc/eeh.h | |||
@@ -57,6 +57,7 @@ void __init pci_addr_cache_build(void); | |||
57 | * to finish the eeh setup for this device. | 57 | * to finish the eeh setup for this device. |
58 | */ | 58 | */ |
59 | void eeh_add_device_early(struct device_node *); | 59 | void eeh_add_device_early(struct device_node *); |
60 | void eeh_add_device_tree_early(struct device_node *); | ||
60 | void eeh_add_device_late(struct pci_dev *); | 61 | void eeh_add_device_late(struct pci_dev *); |
61 | 62 | ||
62 | /** | 63 | /** |
@@ -72,6 +73,15 @@ void eeh_add_device_late(struct pci_dev *); | |||
72 | void eeh_remove_device(struct pci_dev *); | 73 | void eeh_remove_device(struct pci_dev *); |
73 | 74 | ||
74 | /** | 75 | /** |
76 | * eeh_remove_device_recursive - undo EEH for device & children. | ||
77 | * @dev: pci device to be removed | ||
78 | * | ||
79 | * As above, this removes the device; it also removes child | ||
80 | * pci devices as well. | ||
81 | */ | ||
82 | void eeh_remove_bus_device(struct pci_dev *); | ||
83 | |||
84 | /** | ||
75 | * EEH_POSSIBLE_ERROR() -- test for possible MMIO failure. | 85 | * EEH_POSSIBLE_ERROR() -- test for possible MMIO failure. |
76 | * | 86 | * |
77 | * If this macro yields TRUE, the caller relays to eeh_check_failure() | 87 | * If this macro yields TRUE, the caller relays to eeh_check_failure() |