diff options
author | Yinghai Lu <yinghai.lu@oracle.com> | 2011-11-23 00:06:53 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2012-01-06 15:10:48 -0500 |
commit | 79cc9601c3e42b4f0650fe7e69132ebce7ab48f9 (patch) | |
tree | a64d1866bb2081f08396e23523171b7a9f2bada9 /drivers/pci/remove.c | |
parent | ca3671a83389eea1458929d22c66a69e955bfb07 (diff) |
PCI: Only call pci_stop_bus_device() one time for child devices at remove
During debugging pcie hotplug with SRIOV with pcie switch, I found
pci_stop_bus_device() is called several times for some child devices.
So change original pci_remove_bus_device() to __pci_remove_bus_device(),
and make it only do remove work, and add a new pci_remove_bus_device
that calls pci_stop_bus_device() one time, and then call
__pci_remove_bus_device().
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/remove.c')
-rw-r--r-- | drivers/pci/remove.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c index 7f87beed35ac..6def3624c688 100644 --- a/drivers/pci/remove.c +++ b/drivers/pci/remove.c | |||
@@ -89,9 +89,8 @@ EXPORT_SYMBOL(pci_remove_bus); | |||
89 | * device lists, remove the /proc entry, and notify userspace | 89 | * device lists, remove the /proc entry, and notify userspace |
90 | * (/sbin/hotplug). | 90 | * (/sbin/hotplug). |
91 | */ | 91 | */ |
92 | void pci_remove_bus_device(struct pci_dev *dev) | 92 | static void __pci_remove_bus_device(struct pci_dev *dev) |
93 | { | 93 | { |
94 | pci_stop_bus_device(dev); | ||
95 | if (dev->subordinate) { | 94 | if (dev->subordinate) { |
96 | struct pci_bus *b = dev->subordinate; | 95 | struct pci_bus *b = dev->subordinate; |
97 | 96 | ||
@@ -102,6 +101,11 @@ void pci_remove_bus_device(struct pci_dev *dev) | |||
102 | 101 | ||
103 | pci_destroy_dev(dev); | 102 | pci_destroy_dev(dev); |
104 | } | 103 | } |
104 | void pci_remove_bus_device(struct pci_dev *dev) | ||
105 | { | ||
106 | pci_stop_bus_device(dev); | ||
107 | __pci_remove_bus_device(dev); | ||
108 | } | ||
105 | 109 | ||
106 | /** | 110 | /** |
107 | * pci_remove_behind_bridge - remove all devices behind a PCI bridge | 111 | * pci_remove_behind_bridge - remove all devices behind a PCI bridge |
@@ -117,7 +121,7 @@ void pci_remove_behind_bridge(struct pci_dev *dev) | |||
117 | 121 | ||
118 | if (dev->subordinate) | 122 | if (dev->subordinate) |
119 | list_for_each_safe(l, n, &dev->subordinate->devices) | 123 | list_for_each_safe(l, n, &dev->subordinate->devices) |
120 | pci_remove_bus_device(pci_dev_b(l)); | 124 | __pci_remove_bus_device(pci_dev_b(l)); |
121 | } | 125 | } |
122 | 126 | ||
123 | static void pci_stop_bus_devices(struct pci_bus *bus) | 127 | static void pci_stop_bus_devices(struct pci_bus *bus) |