diff options
| -rw-r--r-- | arch/powerpc/platforms/pseries/eeh.c | 62 | ||||
| -rw-r--r-- | include/asm-powerpc/eeh.h | 20 |
2 files changed, 30 insertions, 52 deletions
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index 9b2b1cb117b3..780fb27a0099 100644 --- a/arch/powerpc/platforms/pseries/eeh.c +++ b/arch/powerpc/platforms/pseries/eeh.c | |||
| @@ -865,7 +865,7 @@ void __init eeh_init(void) | |||
| 865 | * on the CEC architecture, type of the device, on earlier boot | 865 | * on the CEC architecture, type of the device, on earlier boot |
| 866 | * command-line arguments & etc. | 866 | * command-line arguments & etc. |
| 867 | */ | 867 | */ |
| 868 | void eeh_add_device_early(struct device_node *dn) | 868 | static void eeh_add_device_early(struct device_node *dn) |
| 869 | { | 869 | { |
| 870 | struct pci_controller *phb; | 870 | struct pci_controller *phb; |
| 871 | struct eeh_early_enable_info info; | 871 | struct eeh_early_enable_info info; |
| @@ -882,7 +882,6 @@ void eeh_add_device_early(struct device_node *dn) | |||
| 882 | info.buid_lo = BUID_LO(phb->buid); | 882 | info.buid_lo = BUID_LO(phb->buid); |
| 883 | early_enable_eeh(dn, &info); | 883 | early_enable_eeh(dn, &info); |
| 884 | } | 884 | } |
| 885 | EXPORT_SYMBOL_GPL(eeh_add_device_early); | ||
| 886 | 885 | ||
| 887 | void eeh_add_device_tree_early(struct device_node *dn) | 886 | void eeh_add_device_tree_early(struct device_node *dn) |
| 888 | { | 887 | { |
| @@ -893,20 +892,6 @@ void eeh_add_device_tree_early(struct device_node *dn) | |||
| 893 | } | 892 | } |
| 894 | EXPORT_SYMBOL_GPL(eeh_add_device_tree_early); | 893 | EXPORT_SYMBOL_GPL(eeh_add_device_tree_early); |
| 895 | 894 | ||
| 896 | void eeh_add_device_tree_late(struct pci_bus *bus) | ||
| 897 | { | ||
| 898 | struct pci_dev *dev; | ||
| 899 | |||
| 900 | list_for_each_entry(dev, &bus->devices, bus_list) { | ||
| 901 | eeh_add_device_late(dev); | ||
| 902 | if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { | ||
| 903 | struct pci_bus *subbus = dev->subordinate; | ||
| 904 | if (subbus) | ||
| 905 | eeh_add_device_tree_late(subbus); | ||
| 906 | } | ||
| 907 | } | ||
| 908 | } | ||
| 909 | |||
| 910 | /** | 895 | /** |
| 911 | * eeh_add_device_late - perform EEH initialization for the indicated pci device | 896 | * eeh_add_device_late - perform EEH initialization for the indicated pci device |
| 912 | * @dev: pci device for which to set up EEH | 897 | * @dev: pci device for which to set up EEH |
| @@ -914,7 +899,7 @@ void eeh_add_device_tree_late(struct pci_bus *bus) | |||
| 914 | * This routine must be used to complete EEH initialization for PCI | 899 | * This routine must be used to complete EEH initialization for PCI |
| 915 | * devices that were added after system boot (e.g. hotplug, dlpar). | 900 | * devices that were added after system boot (e.g. hotplug, dlpar). |
| 916 | */ | 901 | */ |
| 917 | void eeh_add_device_late(struct pci_dev *dev) | 902 | static void eeh_add_device_late(struct pci_dev *dev) |
| 918 | { | 903 | { |
| 919 | struct device_node *dn; | 904 | struct device_node *dn; |
| 920 | struct pci_dn *pdn; | 905 | struct pci_dn *pdn; |
| @@ -933,16 +918,33 @@ void eeh_add_device_late(struct pci_dev *dev) | |||
| 933 | 918 | ||
| 934 | pci_addr_cache_insert_device (dev); | 919 | pci_addr_cache_insert_device (dev); |
| 935 | } | 920 | } |
| 936 | EXPORT_SYMBOL_GPL(eeh_add_device_late); | 921 | |
| 922 | void eeh_add_device_tree_late(struct pci_bus *bus) | ||
| 923 | { | ||
| 924 | struct pci_dev *dev; | ||
| 925 | |||
| 926 | list_for_each_entry(dev, &bus->devices, bus_list) { | ||
| 927 | eeh_add_device_late(dev); | ||
| 928 | if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { | ||
| 929 | struct pci_bus *subbus = dev->subordinate; | ||
| 930 | if (subbus) | ||
| 931 | eeh_add_device_tree_late(subbus); | ||
| 932 | } | ||
| 933 | } | ||
| 934 | } | ||
| 935 | EXPORT_SYMBOL_GPL(eeh_add_device_tree_late); | ||
| 937 | 936 | ||
| 938 | /** | 937 | /** |
| 939 | * eeh_remove_device - undo EEH setup for the indicated pci device | 938 | * eeh_remove_device - undo EEH setup for the indicated pci device |
| 940 | * @dev: pci device to be removed | 939 | * @dev: pci device to be removed |
| 941 | * | 940 | * |
| 942 | * This routine should be when a device is removed from a running | 941 | * This routine should be called when a device is removed from |
| 943 | * system (e.g. by hotplug or dlpar). | 942 | * a running system (e.g. by hotplug or dlpar). It unregisters |
| 943 | * the PCI device from the EEH subsystem. I/O errors affecting | ||
| 944 | * this device will no longer be detected after this call; thus, | ||
| 945 | * i/o errors affecting this slot may leave this device unusable. | ||
| 944 | */ | 946 | */ |
| 945 | void eeh_remove_device(struct pci_dev *dev) | 947 | static void eeh_remove_device(struct pci_dev *dev) |
| 946 | { | 948 | { |
| 947 | struct device_node *dn; | 949 | struct device_node *dn; |
| 948 | if (!dev || !eeh_subsystem_enabled) | 950 | if (!dev || !eeh_subsystem_enabled) |
| @@ -958,21 +960,17 @@ void eeh_remove_device(struct pci_dev *dev) | |||
| 958 | PCI_DN(dn)->pcidev = NULL; | 960 | PCI_DN(dn)->pcidev = NULL; |
| 959 | pci_dev_put (dev); | 961 | pci_dev_put (dev); |
| 960 | } | 962 | } |
| 961 | EXPORT_SYMBOL_GPL(eeh_remove_device); | ||
| 962 | 963 | ||
| 963 | void eeh_remove_bus_device(struct pci_dev *dev) | 964 | void eeh_remove_bus_device(struct pci_dev *dev) |
| 964 | { | 965 | { |
| 966 | struct pci_bus *bus = dev->subordinate; | ||
| 967 | struct pci_dev *child, *tmp; | ||
| 968 | |||
| 965 | eeh_remove_device(dev); | 969 | eeh_remove_device(dev); |
| 966 | if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { | 970 | |
| 967 | struct pci_bus *bus = dev->subordinate; | 971 | if (bus && dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { |
| 968 | struct list_head *ln; | 972 | list_for_each_entry_safe(child, tmp, &bus->devices, bus_list) |
| 969 | if (!bus) | 973 | eeh_remove_bus_device(child); |
| 970 | return; | ||
| 971 | for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) { | ||
| 972 | struct pci_dev *pdev = pci_dev_b(ln); | ||
| 973 | if (pdev) | ||
| 974 | eeh_remove_bus_device(pdev); | ||
| 975 | } | ||
| 976 | } | 974 | } |
| 977 | } | 975 | } |
| 978 | EXPORT_SYMBOL_GPL(eeh_remove_bus_device); | 976 | EXPORT_SYMBOL_GPL(eeh_remove_bus_device); |
diff --git a/include/asm-powerpc/eeh.h b/include/asm-powerpc/eeh.h index 5207758a6dd9..868c7139dbff 100644 --- a/include/asm-powerpc/eeh.h +++ b/include/asm-powerpc/eeh.h | |||
| @@ -60,24 +60,10 @@ void __init pci_addr_cache_build(void); | |||
| 60 | * device (including config space i/o). Call eeh_add_device_late | 60 | * device (including config space i/o). Call eeh_add_device_late |
| 61 | * to finish the eeh setup for this device. | 61 | * to finish the eeh setup for this device. |
| 62 | */ | 62 | */ |
| 63 | void eeh_add_device_early(struct device_node *); | ||
| 64 | void eeh_add_device_late(struct pci_dev *dev); | ||
| 65 | void eeh_add_device_tree_early(struct device_node *); | 63 | void eeh_add_device_tree_early(struct device_node *); |
| 66 | void eeh_add_device_tree_late(struct pci_bus *); | 64 | void eeh_add_device_tree_late(struct pci_bus *); |
| 67 | 65 | ||
| 68 | /** | 66 | /** |
| 69 | * eeh_remove_device - undo EEH setup for the indicated pci device | ||
| 70 | * @dev: pci device to be removed | ||
| 71 | * | ||
| 72 | * This routine should be called when a device is removed from | ||
| 73 | * a running system (e.g. by hotplug or dlpar). It unregisters | ||
| 74 | * the PCI device from the EEH subsystem. I/O errors affecting | ||
| 75 | * this device will no longer be detected after this call; thus, | ||
| 76 | * i/o errors affecting this slot may leave this device unusable. | ||
| 77 | */ | ||
| 78 | void eeh_remove_device(struct pci_dev *); | ||
| 79 | |||
| 80 | /** | ||
| 81 | * eeh_remove_device_recursive - undo EEH for device & children. | 67 | * eeh_remove_device_recursive - undo EEH for device & children. |
| 82 | * @dev: pci device to be removed | 68 | * @dev: pci device to be removed |
| 83 | * | 69 | * |
| @@ -116,12 +102,6 @@ static inline int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *d | |||
| 116 | 102 | ||
| 117 | static inline void pci_addr_cache_build(void) { } | 103 | static inline void pci_addr_cache_build(void) { } |
| 118 | 104 | ||
| 119 | static inline void eeh_add_device_early(struct device_node *dn) { } | ||
| 120 | |||
| 121 | static inline void eeh_add_device_late(struct pci_dev *dev) { } | ||
| 122 | |||
| 123 | static inline void eeh_remove_device(struct pci_dev *dev) { } | ||
| 124 | |||
| 125 | static inline void eeh_add_device_tree_early(struct device_node *dn) { } | 105 | static inline void eeh_add_device_tree_early(struct device_node *dn) { } |
| 126 | 106 | ||
| 127 | static inline void eeh_add_device_tree_late(struct pci_bus *bus) { } | 107 | static inline void eeh_add_device_tree_late(struct pci_bus *bus) { } |
