Release 4.11 drivers/pci/remove.c
#include <linux/pci.h>
#include <linux/module.h>
#include <linux/pci-aspm.h>
#include "pci.h"
static void pci_free_resources(struct pci_dev *dev)
{
int i;
for (i = 0; i < PCI_NUM_RESOURCES; i++) {
struct resource *res = dev->resource + i;
if (res->parent)
release_resource(res);
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 51 | 100.00% | 1 | 100.00% |
Total | 51 | 100.00% | 1 | 100.00% |
static void pci_stop_dev(struct pci_dev *dev)
{
pci_pme_active(dev, false);
if (dev->is_added) {
pci_proc_detach_device(dev);
pci_remove_sysfs_dev_files(dev);
device_release_driver(&dev->dev);
dev->is_added = 0;
}
if (dev->bus->self)
pcie_aspm_exit_link_state(dev);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Greg Kroah-Hartman | 28 | 44.44% | 2 | 25.00% |
David Shaohua Li | 13 | 20.63% | 1 | 12.50% |
Rafael J. Wysocki | 8 | 12.70% | 2 | 25.00% |
Rajesh Shah | 5 | 7.94% | 1 | 12.50% |
Jon Smirl | 5 | 7.94% | 1 | 12.50% |
Satoru Takeuchi | 4 | 6.35% | 1 | 12.50% |
Total | 63 | 100.00% | 8 | 100.00% |
static void pci_destroy_dev(struct pci_dev *dev)
{
if (!dev->dev.kobj.parent)
return;
device_del(&dev->dev);
down_write(&pci_bus_sem);
list_del(&dev->bus_list);
up_write(&pci_bus_sem);
pci_bridge_d3_update(dev);
pci_free_resources(dev);
put_device(&dev->dev);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 45 | 65.22% | 3 | 37.50% |
Satoru Takeuchi | 10 | 14.49% | 1 | 12.50% |
Lukas Wunner | 5 | 7.25% | 2 | 25.00% |
Greg Kroah-Hartman | 5 | 7.25% | 1 | 12.50% |
Jiang Liu | 4 | 5.80% | 1 | 12.50% |
Total | 69 | 100.00% | 8 | 100.00% |
void pci_remove_bus(struct pci_bus *bus)
{
pci_proc_detach_bus(bus);
down_write(&pci_bus_sem);
list_del(&bus->node);
pci_bus_release_busn_res(bus);
up_write(&pci_bus_sem);
pci_remove_legacy_files(bus);
if (bus->ops->remove_bus)
bus->ops->remove_bus(bus);
pcibios_remove_bus(bus);
device_unregister(&bus->dev);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Greg Kroah-Hartman | 29 | 38.67% | 2 | 20.00% |
Thierry Reding | 17 | 22.67% | 1 | 10.00% |
John Rose | 8 | 10.67% | 2 | 20.00% |
Björn Helgaas | 6 | 8.00% | 1 | 10.00% |
Jiang Liu | 5 | 6.67% | 1 | 10.00% |
Yinghai Lu | 4 | 5.33% | 1 | 10.00% |
Yanmin Zhang | 4 | 5.33% | 1 | 10.00% |
Matthew Dobson | 2 | 2.67% | 1 | 10.00% |
Total | 75 | 100.00% | 10 | 100.00% |
EXPORT_SYMBOL(pci_remove_bus);
static void pci_stop_bus_device(struct pci_dev *dev)
{
struct pci_bus *bus = dev->subordinate;
struct pci_dev *child, *tmp;
/*
* Stopping an SR-IOV PF device removes all the associated VFs,
* which will update the bus->devices list and confuse the
* iterator. Therefore, iterate in reverse so we remove the VFs
* first, then the PF.
*/
if (bus) {
list_for_each_entry_safe_reverse(child, tmp,
&bus->devices, bus_list)
pci_stop_bus_device(child);
}
pci_stop_dev(dev);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Björn Helgaas | 23 | 41.82% | 2 | 50.00% |
John Rose | 17 | 30.91% | 1 | 25.00% |
Yinghai Lu | 15 | 27.27% | 1 | 25.00% |
Total | 55 | 100.00% | 4 | 100.00% |
static void pci_remove_bus_device(struct pci_dev *dev)
{
struct pci_bus *bus = dev->subordinate;
struct pci_dev *child, *tmp;
if (bus) {
list_for_each_entry_safe(child, tmp,
&bus->devices, bus_list)
pci_remove_bus_device(child);
pci_remove_bus(bus);
dev->subordinate = NULL;
}
pci_destroy_dev(dev);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Yinghai Lu | 49 | 75.38% | 2 | 40.00% |
Greg Kroah-Hartman | 7 | 10.77% | 1 | 20.00% |
John Rose | 6 | 9.23% | 1 | 20.00% |
Björn Helgaas | 3 | 4.62% | 1 | 20.00% |
Total | 65 | 100.00% | 5 | 100.00% |
/**
* pci_stop_and_remove_bus_device - remove a PCI device and any children
* @dev: the device to remove
*
* Remove a PCI device from the device lists, informing the drivers
* that the device has been removed. We also remove any subordinate
* buses and children in a depth-first manner.
*
* For each device we remove, delete the device structure from the
* device lists, remove the /proc entry, and notify userspace
* (/sbin/hotplug).
*/
void pci_stop_and_remove_bus_device(struct pci_dev *dev)
{
pci_stop_bus_device(dev);
pci_remove_bus_device(dev);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Yinghai Lu | 15 | 75.00% | 1 | 50.00% |
Satoru Takeuchi | 5 | 25.00% | 1 | 50.00% |
Total | 20 | 100.00% | 2 | 100.00% |
EXPORT_SYMBOL(pci_stop_and_remove_bus_device);
void pci_stop_and_remove_bus_device_locked(struct pci_dev *dev)
{
pci_lock_rescan_remove();
pci_stop_and_remove_bus_device(dev);
pci_unlock_rescan_remove();
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 21 | 100.00% | 1 | 100.00% |
Total | 21 | 100.00% | 1 | 100.00% |
EXPORT_SYMBOL_GPL(pci_stop_and_remove_bus_device_locked);
void pci_stop_root_bus(struct pci_bus *bus)
{
struct pci_dev *child, *tmp;
struct pci_host_bridge *host_bridge;
if (!pci_is_root_bus(bus))
return;
host_bridge = to_pci_host_bridge(bus->bridge);
list_for_each_entry_safe_reverse(child, tmp,
&bus->devices, bus_list)
pci_stop_bus_device(child);
/* stop the host bridge */
device_release_driver(&host_bridge->dev);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Yinghai Lu | 65 | 100.00% | 2 | 100.00% |
Total | 65 | 100.00% | 2 | 100.00% |
EXPORT_SYMBOL_GPL(pci_stop_root_bus);
void pci_remove_root_bus(struct pci_bus *bus)
{
struct pci_dev *child, *tmp;
struct pci_host_bridge *host_bridge;
if (!pci_is_root_bus(bus))
return;
host_bridge = to_pci_host_bridge(bus->bridge);
list_for_each_entry_safe(child, tmp,
&bus->devices, bus_list)
pci_remove_bus_device(child);
pci_remove_bus(bus);
host_bridge->bus = NULL;
/* remove the host bridge */
device_unregister(&host_bridge->dev);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Yinghai Lu | 76 | 100.00% | 2 | 100.00% |
Total | 76 | 100.00% | 2 | 100.00% |
EXPORT_SYMBOL_GPL(pci_remove_root_bus);
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Yinghai Lu | 226 | 37.79% | 6 | 19.35% |
Rafael J. Wysocki | 130 | 21.74% | 5 | 16.13% |
Greg Kroah-Hartman | 82 | 13.71% | 3 | 9.68% |
John Rose | 36 | 6.02% | 2 | 6.45% |
Björn Helgaas | 32 | 5.35% | 3 | 9.68% |
Satoru Takeuchi | 19 | 3.18% | 1 | 3.23% |
Thierry Reding | 17 | 2.84% | 1 | 3.23% |
David Shaohua Li | 16 | 2.68% | 1 | 3.23% |
Ray Jui | 10 | 1.67% | 1 | 3.23% |
Jiang Liu | 9 | 1.51% | 2 | 6.45% |
Rajesh Shah | 5 | 0.84% | 1 | 3.23% |
Jon Smirl | 5 | 0.84% | 1 | 3.23% |
Lukas Wunner | 5 | 0.84% | 2 | 6.45% |
Yanmin Zhang | 4 | 0.67% | 1 | 3.23% |
Matthew Dobson | 2 | 0.33% | 1 | 3.23% |
Total | 598 | 100.00% | 31 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.