diff options
| -rw-r--r-- | drivers/pci/iov.c | 3 | ||||
| -rw-r--r-- | drivers/pci/probe.c | 5 | ||||
| -rw-r--r-- | drivers/pci/remove.c | 28 |
3 files changed, 28 insertions, 8 deletions
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 0321fa3b4226..0dab5ecf61bb 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c | |||
| @@ -347,8 +347,6 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn) | |||
| 347 | return rc; | 347 | return rc; |
| 348 | } | 348 | } |
| 349 | 349 | ||
| 350 | pci_write_config_dword(dev, iov->pos + PCI_SRIOV_SYS_PGSIZE, iov->pgsz); | ||
| 351 | |||
| 352 | iov->ctrl |= PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE; | 350 | iov->ctrl |= PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE; |
| 353 | pci_cfg_access_lock(dev); | 351 | pci_cfg_access_lock(dev); |
| 354 | pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl); | 352 | pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl); |
| @@ -466,6 +464,7 @@ found: | |||
| 466 | return -EIO; | 464 | return -EIO; |
| 467 | 465 | ||
| 468 | pgsz &= ~(pgsz - 1); | 466 | pgsz &= ~(pgsz - 1); |
| 467 | pci_write_config_dword(dev, pos + PCI_SRIOV_SYS_PGSIZE, pgsz); | ||
| 469 | 468 | ||
| 470 | nres = 0; | 469 | nres = 0; |
| 471 | for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) { | 470 | for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) { |
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 7cc9e2f0f47c..71eac9cd724d 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
| @@ -651,6 +651,11 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, | |||
| 651 | dev_dbg(&dev->dev, "scanning [bus %02x-%02x] behind bridge, pass %d\n", | 651 | dev_dbg(&dev->dev, "scanning [bus %02x-%02x] behind bridge, pass %d\n", |
| 652 | secondary, subordinate, pass); | 652 | secondary, subordinate, pass); |
| 653 | 653 | ||
| 654 | if (!primary && (primary != bus->number) && secondary && subordinate) { | ||
| 655 | dev_warn(&dev->dev, "Primary bus is hard wired to 0\n"); | ||
| 656 | primary = bus->number; | ||
| 657 | } | ||
| 658 | |||
| 654 | /* Check if setup is sensible at all */ | 659 | /* Check if setup is sensible at all */ |
| 655 | if (!pass && | 660 | if (!pass && |
| 656 | (primary != bus->number || secondary <= bus->number)) { | 661 | (primary != bus->number || secondary <= bus->number)) { |
diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c index 6def3624c688..ef8b18c48f26 100644 --- a/drivers/pci/remove.c +++ b/drivers/pci/remove.c | |||
| @@ -77,6 +77,7 @@ void pci_remove_bus(struct pci_bus *pci_bus) | |||
| 77 | } | 77 | } |
| 78 | EXPORT_SYMBOL(pci_remove_bus); | 78 | EXPORT_SYMBOL(pci_remove_bus); |
| 79 | 79 | ||
| 80 | static void __pci_remove_behind_bridge(struct pci_dev *dev); | ||
| 80 | /** | 81 | /** |
| 81 | * pci_remove_bus_device - remove a PCI device and any children | 82 | * pci_remove_bus_device - remove a PCI device and any children |
| 82 | * @dev: the device to remove | 83 | * @dev: the device to remove |
| @@ -94,7 +95,7 @@ static void __pci_remove_bus_device(struct pci_dev *dev) | |||
| 94 | if (dev->subordinate) { | 95 | if (dev->subordinate) { |
| 95 | struct pci_bus *b = dev->subordinate; | 96 | struct pci_bus *b = dev->subordinate; |
| 96 | 97 | ||
| 97 | pci_remove_behind_bridge(dev); | 98 | __pci_remove_behind_bridge(dev); |
| 98 | pci_remove_bus(b); | 99 | pci_remove_bus(b); |
| 99 | dev->subordinate = NULL; | 100 | dev->subordinate = NULL; |
| 100 | } | 101 | } |
| @@ -107,6 +108,24 @@ void pci_remove_bus_device(struct pci_dev *dev) | |||
| 107 | __pci_remove_bus_device(dev); | 108 | __pci_remove_bus_device(dev); |
| 108 | } | 109 | } |
| 109 | 110 | ||
| 111 | static void __pci_remove_behind_bridge(struct pci_dev *dev) | ||
| 112 | { | ||
| 113 | struct list_head *l, *n; | ||
| 114 | |||
| 115 | if (dev->subordinate) | ||
| 116 | list_for_each_safe(l, n, &dev->subordinate->devices) | ||
| 117 | __pci_remove_bus_device(pci_dev_b(l)); | ||
| 118 | } | ||
| 119 | |||
| 120 | static void pci_stop_behind_bridge(struct pci_dev *dev) | ||
| 121 | { | ||
| 122 | struct list_head *l, *n; | ||
| 123 | |||
| 124 | if (dev->subordinate) | ||
| 125 | list_for_each_safe(l, n, &dev->subordinate->devices) | ||
| 126 | pci_stop_bus_device(pci_dev_b(l)); | ||
| 127 | } | ||
| 128 | |||
| 110 | /** | 129 | /** |
| 111 | * pci_remove_behind_bridge - remove all devices behind a PCI bridge | 130 | * pci_remove_behind_bridge - remove all devices behind a PCI bridge |
| 112 | * @dev: PCI bridge device | 131 | * @dev: PCI bridge device |
| @@ -117,11 +136,8 @@ void pci_remove_bus_device(struct pci_dev *dev) | |||
| 117 | */ | 136 | */ |
| 118 | void pci_remove_behind_bridge(struct pci_dev *dev) | 137 | void pci_remove_behind_bridge(struct pci_dev *dev) |
| 119 | { | 138 | { |
| 120 | struct list_head *l, *n; | 139 | pci_stop_behind_bridge(dev); |
| 121 | 140 | __pci_remove_behind_bridge(dev); | |
| 122 | if (dev->subordinate) | ||
| 123 | list_for_each_safe(l, n, &dev->subordinate->devices) | ||
| 124 | __pci_remove_bus_device(pci_dev_b(l)); | ||
| 125 | } | 141 | } |
| 126 | 142 | ||
| 127 | static void pci_stop_bus_devices(struct pci_bus *bus) | 143 | static void pci_stop_bus_devices(struct pci_bus *bus) |
