aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-02-18 18:26:11 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-02-18 18:26:11 -0500
commit7bcd5b4671c3aa9185a7e6f76ee12e392070ddea (patch)
treedb80f1cc57cdec18e46bf8e37691b02f9a2ce35e /drivers
parent58e44bafbb601b5abc250cdbb032b1f4022ef30a (diff)
parent3682a3946d2b0bad621db871e3bead83e523a238 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci
One regression fix for SR-IOV on PPC and a couple of misc fixes from Yinghai. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci: PCI: Fix pci cardbus removal PCI: set pci sriov page size before reading SRIOV BAR PCI: workaround hard-wired bus number V2
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pci/iov.c3
-rw-r--r--drivers/pci/probe.c5
-rw-r--r--drivers/pci/remove.c28
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}
78EXPORT_SYMBOL(pci_remove_bus); 78EXPORT_SYMBOL(pci_remove_bus);
79 79
80static 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
111static 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
120static 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 */
118void pci_remove_behind_bridge(struct pci_dev *dev) 137void 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
127static void pci_stop_bus_devices(struct pci_bus *bus) 143static void pci_stop_bus_devices(struct pci_bus *bus)