Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91670
b: refs/heads/master
c: 8a1bc90
h: refs/heads/master
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Apr 21, 2008
1 parent 266912b commit 3d60461
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 70308923d317f2ad4973c30d90bb48ae38761317
refs/heads/master: 8a1bc9013a03d41a0e36ee413bb6f97281b30bd1
7 changes: 2 additions & 5 deletions trunk/arch/powerpc/platforms/pseries/pci_dlpar.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,8 @@ pcibios_fixup_new_pci_devices(struct pci_bus *bus)
struct pci_dev *dev;

list_for_each_entry(dev, &bus->devices, bus_list) {
/*
* Skip already-present devices (which are on the
* global device list.)
*/
if (list_empty(&dev->global_list)) {
/* Skip already-added devices */
if (!dev->is_added) {
int i;

/* Fill device archdata and setup iommu table */
Expand Down
11 changes: 4 additions & 7 deletions trunk/drivers/pci/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ int pci_bus_add_device(struct pci_dev *dev)
if (retval)
return retval;

dev->is_added = 1;
down_write(&pci_bus_sem);
list_add_tail(&dev->global_list, &pci_devices);
up_write(&pci_bus_sem);
Expand Down Expand Up @@ -112,20 +113,16 @@ void pci_bus_add_devices(struct pci_bus *bus)
int retval;

list_for_each_entry(dev, &bus->devices, bus_list) {
/*
* Skip already-present devices (which are on the
* global device list.)
*/
if (!list_empty(&dev->global_list))
/* Skip already-added devices */
if (dev->is_added)
continue;
retval = pci_bus_add_device(dev);
if (retval)
dev_err(&dev->dev, "Error adding device, continuing\n");
}

list_for_each_entry(dev, &bus->devices, bus_list) {

BUG_ON(list_empty(&dev->global_list));
BUG_ON(!dev->is_added);

/*
* If there is an unattached subordinate bus, attach
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/pci/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ EXPORT_SYMBOL(pci_scan_single_device);
*
* Scan a PCI slot on the specified PCI bus for devices, adding
* discovered devices to the @bus->devices list. New devices
* will have an empty dev->global_list head.
* will not have is_added set.
*/
int pci_scan_slot(struct pci_bus *bus, int devfn)
{
Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/pci/remove.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ static void pci_free_resources(struct pci_dev *dev)

static void pci_stop_dev(struct pci_dev *dev)
{
if (!dev->global_list.next)
return;

if (!list_empty(&dev->global_list)) {
if (dev->is_added) {
pci_proc_detach_device(dev);
pci_remove_sysfs_dev_files(dev);
device_unregister(&dev->dev);
dev->is_added = 0;
down_write(&pci_bus_sem);
list_del(&dev->global_list);
dev->global_list.next = dev->global_list.prev = NULL;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ struct pci_dev {
unsigned int transparent:1; /* Transparent PCI bridge */
unsigned int multifunction:1;/* Part of multi-function device */
/* keep track of device state */
unsigned int is_added:1;
unsigned int is_busmaster:1; /* device is busmaster */
unsigned int no_msi:1; /* device may not use msi */
unsigned int no_d1d2:1; /* only allow d0 or d3 */
Expand Down

0 comments on commit 3d60461

Please sign in to comment.