diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-12 17:38:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-12 17:38:34 -0400 |
commit | 2caa731819a633bec5a56736e64c562b7e193666 (patch) | |
tree | e93f5c50c33c7cf5a9cc3ea29dd1d868b4f14d5c /drivers | |
parent | 589bf8d52b5bbb580962438ad9403ec6853bc12b (diff) | |
parent | 30fc24b5cbc55f9e6c686e2710cc812419bddc0c (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
PCI: Prevent AER driver from being loaded on non-root port PCIE devices
PCI: get larger bridge ranges when space is available
PCI: pci.c: fix kernel-doc notation
PCI quirk: TI XIO200a erroneously reports support for fast b2b transfers
PCI PM: Read device power state from register after updating it
PCI: remove pci_assign_resource_fixed()
PCI: PCIe portdrv: remove "-driver" from driver name
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/pci.c | 14 | ||||
-rw-r--r-- | drivers/pci/pcie/aer/aerdrv.c | 2 | ||||
-rw-r--r-- | drivers/pci/pcie/portdrv_pci.c | 3 | ||||
-rw-r--r-- | drivers/pci/quirks.c | 19 | ||||
-rw-r--r-- | drivers/pci/setup-bus.c | 13 | ||||
-rw-r--r-- | drivers/pci/setup-res.c | 37 |
6 files changed, 41 insertions, 47 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 6edecff0b419..3835871f4832 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -513,7 +513,11 @@ static int pci_raw_set_power_state(struct pci_dev *dev, pci_power_t state) | |||
513 | else if (state == PCI_D2 || dev->current_state == PCI_D2) | 513 | else if (state == PCI_D2 || dev->current_state == PCI_D2) |
514 | udelay(PCI_PM_D2_DELAY); | 514 | udelay(PCI_PM_D2_DELAY); |
515 | 515 | ||
516 | dev->current_state = state; | 516 | pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr); |
517 | dev->current_state = (pmcsr & PCI_PM_CTRL_STATE_MASK); | ||
518 | if (dev->current_state != state && printk_ratelimit()) | ||
519 | dev_info(&dev->dev, "Refused to change power state, " | ||
520 | "currently in D%d\n", dev->current_state); | ||
517 | 521 | ||
518 | /* According to section 5.4.1 of the "PCI BUS POWER MANAGEMENT | 522 | /* According to section 5.4.1 of the "PCI BUS POWER MANAGEMENT |
519 | * INTERFACE SPECIFICATION, REV. 1.2", a device transitioning | 523 | * INTERFACE SPECIFICATION, REV. 1.2", a device transitioning |
@@ -2542,10 +2546,10 @@ int pci_resource_bar(struct pci_dev *dev, int resno, enum pci_bar_type *type) | |||
2542 | 2546 | ||
2543 | /** | 2547 | /** |
2544 | * pci_set_vga_state - set VGA decode state on device and parents if requested | 2548 | * pci_set_vga_state - set VGA decode state on device and parents if requested |
2545 | * @dev the PCI device | 2549 | * @dev: the PCI device |
2546 | * @decode - true = enable decoding, false = disable decoding | 2550 | * @decode: true = enable decoding, false = disable decoding |
2547 | * @command_bits PCI_COMMAND_IO and/or PCI_COMMAND_MEMORY | 2551 | * @command_bits: PCI_COMMAND_IO and/or PCI_COMMAND_MEMORY |
2548 | * @change_bridge - traverse ancestors and change bridges | 2552 | * @change_bridge: traverse ancestors and change bridges |
2549 | */ | 2553 | */ |
2550 | int pci_set_vga_state(struct pci_dev *dev, bool decode, | 2554 | int pci_set_vga_state(struct pci_dev *dev, bool decode, |
2551 | unsigned int command_bits, bool change_bridge) | 2555 | unsigned int command_bits, bool change_bridge) |
diff --git a/drivers/pci/pcie/aer/aerdrv.c b/drivers/pci/pcie/aer/aerdrv.c index d49ecc94bd49..40c3cc5d1caf 100644 --- a/drivers/pci/pcie/aer/aerdrv.c +++ b/drivers/pci/pcie/aer/aerdrv.c | |||
@@ -53,7 +53,7 @@ static struct pci_error_handlers aer_error_handlers = { | |||
53 | 53 | ||
54 | static struct pcie_port_service_driver aerdriver = { | 54 | static struct pcie_port_service_driver aerdriver = { |
55 | .name = "aer", | 55 | .name = "aer", |
56 | .port_type = PCIE_ANY_PORT, | 56 | .port_type = PCIE_RC_PORT, |
57 | .service = PCIE_PORT_SERVICE_AER, | 57 | .service = PCIE_PORT_SERVICE_AER, |
58 | 58 | ||
59 | .probe = aer_probe, | 59 | .probe = aer_probe, |
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index 6df5c984a791..f635e476d632 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c | |||
@@ -30,7 +30,6 @@ MODULE_DESCRIPTION(DRIVER_DESC); | |||
30 | MODULE_LICENSE("GPL"); | 30 | MODULE_LICENSE("GPL"); |
31 | 31 | ||
32 | /* global data */ | 32 | /* global data */ |
33 | static const char device_name[] = "pcieport-driver"; | ||
34 | 33 | ||
35 | static int pcie_portdrv_restore_config(struct pci_dev *dev) | 34 | static int pcie_portdrv_restore_config(struct pci_dev *dev) |
36 | { | 35 | { |
@@ -262,7 +261,7 @@ static struct pci_error_handlers pcie_portdrv_err_handler = { | |||
262 | }; | 261 | }; |
263 | 262 | ||
264 | static struct pci_driver pcie_portdriver = { | 263 | static struct pci_driver pcie_portdriver = { |
265 | .name = (char *)device_name, | 264 | .name = "pcieport", |
266 | .id_table = &port_pci_ids[0], | 265 | .id_table = &port_pci_ids[0], |
267 | 266 | ||
268 | .probe = pcie_portdrv_probe, | 267 | .probe = pcie_portdrv_probe, |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 6099facecd79..efa6534a6593 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -670,6 +670,25 @@ static void __devinit quirk_vt8235_acpi(struct pci_dev *dev) | |||
670 | } | 670 | } |
671 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, quirk_vt8235_acpi); | 671 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, quirk_vt8235_acpi); |
672 | 672 | ||
673 | /* | ||
674 | * TI XIO2000a PCIe-PCI Bridge erroneously reports it supports fast back-to-back: | ||
675 | * Disable fast back-to-back on the secondary bus segment | ||
676 | */ | ||
677 | static void __devinit quirk_xio2000a(struct pci_dev *dev) | ||
678 | { | ||
679 | struct pci_dev *pdev; | ||
680 | u16 command; | ||
681 | |||
682 | dev_warn(&dev->dev, "TI XIO2000a quirk detected; " | ||
683 | "secondary bus fast back-to-back transfers disabled\n"); | ||
684 | list_for_each_entry(pdev, &dev->subordinate->devices, bus_list) { | ||
685 | pci_read_config_word(pdev, PCI_COMMAND, &command); | ||
686 | if (command & PCI_COMMAND_FAST_BACK) | ||
687 | pci_write_config_word(pdev, PCI_COMMAND, command & ~PCI_COMMAND_FAST_BACK); | ||
688 | } | ||
689 | } | ||
690 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_XIO2000A, | ||
691 | quirk_xio2000a); | ||
673 | 692 | ||
674 | #ifdef CONFIG_X86_IO_APIC | 693 | #ifdef CONFIG_X86_IO_APIC |
675 | 694 | ||
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index cb1a027eb552..0959430534b2 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c | |||
@@ -299,8 +299,17 @@ static struct resource *find_free_bus_resource(struct pci_bus *bus, unsigned lon | |||
299 | r = bus->resource[i]; | 299 | r = bus->resource[i]; |
300 | if (r == &ioport_resource || r == &iomem_resource) | 300 | if (r == &ioport_resource || r == &iomem_resource) |
301 | continue; | 301 | continue; |
302 | if (r && (r->flags & type_mask) == type && !r->parent) | 302 | if (r && (r->flags & type_mask) == type) { |
303 | return r; | 303 | if (!r->parent) |
304 | return r; | ||
305 | /* | ||
306 | * if there is no child under that, we should release | ||
307 | * and use it. don't need to reset it, pbus_size_* will | ||
308 | * set it again | ||
309 | */ | ||
310 | if (!r->child && !release_resource(r)) | ||
311 | return r; | ||
312 | } | ||
304 | } | 313 | } |
305 | return NULL; | 314 | return NULL; |
306 | } | 315 | } |
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 706f82d8111f..c54526b206b5 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c | |||
@@ -205,43 +205,6 @@ int pci_assign_resource(struct pci_dev *dev, int resno) | |||
205 | return ret; | 205 | return ret; |
206 | } | 206 | } |
207 | 207 | ||
208 | #if 0 | ||
209 | int pci_assign_resource_fixed(struct pci_dev *dev, int resno) | ||
210 | { | ||
211 | struct pci_bus *bus = dev->bus; | ||
212 | struct resource *res = dev->resource + resno; | ||
213 | unsigned int type_mask; | ||
214 | int i, ret = -EBUSY; | ||
215 | |||
216 | type_mask = IORESOURCE_IO | IORESOURCE_MEM | IORESOURCE_PREFETCH; | ||
217 | |||
218 | for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) { | ||
219 | struct resource *r = bus->resource[i]; | ||
220 | if (!r) | ||
221 | continue; | ||
222 | |||
223 | /* type_mask must match */ | ||
224 | if ((res->flags ^ r->flags) & type_mask) | ||
225 | continue; | ||
226 | |||
227 | ret = request_resource(r, res); | ||
228 | |||
229 | if (ret == 0) | ||
230 | break; | ||
231 | } | ||
232 | |||
233 | if (ret) { | ||
234 | dev_err(&dev->dev, "BAR %d: can't allocate %s resource %pR\n", | ||
235 | resno, res->flags & IORESOURCE_IO ? "I/O" : "mem", res); | ||
236 | } else if (resno < PCI_BRIDGE_RESOURCES) { | ||
237 | pci_update_resource(dev, resno); | ||
238 | } | ||
239 | |||
240 | return ret; | ||
241 | } | ||
242 | EXPORT_SYMBOL_GPL(pci_assign_resource_fixed); | ||
243 | #endif | ||
244 | |||
245 | /* Sort resources by alignment */ | 208 | /* Sort resources by alignment */ |
246 | void pdev_sort_resources(struct pci_dev *dev, struct resource_list *head) | 209 | void pdev_sort_resources(struct pci_dev *dev, struct resource_list *head) |
247 | { | 210 | { |