diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 17:02:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 17:02:12 -0400 |
commit | 475c77edf826333aa61625f49d6a2bec26ecb5a6 (patch) | |
tree | 8e1c6c319e347cd3c649fdb0b3ab45971c6b19e7 /arch/ia64 | |
parent | 934e18b5cb4531cc6e81865bf54115cfd21d1ac6 (diff) | |
parent | 1488d5158dcd612fcdaf6b642451b026ee8bbcbb (diff) |
Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci
Pull PCI changes (including maintainer change) from Jesse Barnes:
"This pull has some good cleanups from Bjorn and Yinghai, as well as
some more code from Yinghai to better handle resource re-allocation
when enabled.
There's also a new initcall_debug feature from Arjan which will print
out quirk timing information to help identify slow quirks for fixing
or refinement (Yinghai sent in a few patches to do just that once the
new debug code landed).
Beyond that, I'm handing off PCI maintainership to Bjorn Helgaas.
He's been a core PCI and Linux contributor for some time now, and has
kindly volunteered to take over. I just don't feel I have the time
for PCI review and work that it deserves lately (I've taken on some
other projects), and haven't been as responsive lately as I'd like, so
I approached Bjorn asking if he'd like to manage things. He's going
to give it a try, and I'm confident he'll do at least as well as I
have in keeping the tree managed, patches flowing, and keeping things
stable."
Fix up some fairly trivial conflicts due to other cleanups (mips device
resource fixup cleanups clashing with list handling cleanup, ppc iseries
removal clashing with pci_probe_only cleanup etc)
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci: (112 commits)
PCI: Bjorn gets PCI hotplug too
PCI: hand PCI maintenance over to Bjorn Helgaas
unicore32/PCI: move <asm-generic/pci-bridge.h> include to asm/pci.h
sparc/PCI: convert devtree and arch-probed bus addresses to resource
powerpc/PCI: allow reallocation on PA Semi
powerpc/PCI: convert devtree bus addresses to resource
powerpc/PCI: compute I/O space bus-to-resource offset consistently
arm/PCI: don't export pci_flags
PCI: fix bridge I/O window bus-to-resource conversion
x86/PCI: add spinlock held check to 'pcibios_fwaddrmap_lookup()'
PCI / PCIe: Introduce command line option to disable ARI
PCI: make acpihp use __pci_remove_bus_device instead
PCI: export __pci_remove_bus_device
PCI: Rename pci_remove_behind_bridge to pci_stop_and_remove_behind_bridge
PCI: Rename pci_remove_bus_device to pci_stop_and_remove_bus_device
PCI: print out PCI device info along with duration
PCI: Move "pci reassigndev resource alignment" out of quirks.c
PCI: Use class for quirk for usb host controller fixup
PCI: Use class for quirk for ti816x class fixup
PCI: Use class for quirk for intel e100 interrupt fixup
...
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/include/asm/pci.h | 6 | ||||
-rw-r--r-- | arch/ia64/pci/pci.c | 55 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/io_init.c | 16 |
3 files changed, 13 insertions, 64 deletions
diff --git a/arch/ia64/include/asm/pci.h b/arch/ia64/include/asm/pci.h index 279b38ae74aa..b22e5f5fa593 100644 --- a/arch/ia64/include/asm/pci.h +++ b/arch/ia64/include/asm/pci.h | |||
@@ -108,12 +108,6 @@ static inline int pci_proc_domain(struct pci_bus *bus) | |||
108 | return (pci_domain_nr(bus) != 0); | 108 | return (pci_domain_nr(bus) != 0); |
109 | } | 109 | } |
110 | 110 | ||
111 | extern void pcibios_resource_to_bus(struct pci_dev *dev, | ||
112 | struct pci_bus_region *region, struct resource *res); | ||
113 | |||
114 | extern void pcibios_bus_to_resource(struct pci_dev *dev, | ||
115 | struct resource *res, struct pci_bus_region *region); | ||
116 | |||
117 | static inline struct resource * | 111 | static inline struct resource * |
118 | pcibios_select_root(struct pci_dev *pdev, struct resource *res) | 112 | pcibios_select_root(struct pci_dev *pdev, struct resource *res) |
119 | { | 113 | { |
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index f82f5d4b65fd..d1ce3200147c 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c | |||
@@ -320,7 +320,8 @@ static __devinit acpi_status add_window(struct acpi_resource *res, void *data) | |||
320 | * Ignore these tiny memory ranges */ | 320 | * Ignore these tiny memory ranges */ |
321 | if (!((window->resource.flags & IORESOURCE_MEM) && | 321 | if (!((window->resource.flags & IORESOURCE_MEM) && |
322 | (window->resource.end - window->resource.start < 16))) | 322 | (window->resource.end - window->resource.start < 16))) |
323 | pci_add_resource(&info->resources, &window->resource); | 323 | pci_add_resource_offset(&info->resources, &window->resource, |
324 | window->offset); | ||
324 | 325 | ||
325 | return AE_OK; | 326 | return AE_OK; |
326 | } | 327 | } |
@@ -395,54 +396,6 @@ out1: | |||
395 | return NULL; | 396 | return NULL; |
396 | } | 397 | } |
397 | 398 | ||
398 | void pcibios_resource_to_bus(struct pci_dev *dev, | ||
399 | struct pci_bus_region *region, struct resource *res) | ||
400 | { | ||
401 | struct pci_controller *controller = PCI_CONTROLLER(dev); | ||
402 | unsigned long offset = 0; | ||
403 | int i; | ||
404 | |||
405 | for (i = 0; i < controller->windows; i++) { | ||
406 | struct pci_window *window = &controller->window[i]; | ||
407 | if (!(window->resource.flags & res->flags)) | ||
408 | continue; | ||
409 | if (window->resource.start > res->start) | ||
410 | continue; | ||
411 | if (window->resource.end < res->end) | ||
412 | continue; | ||
413 | offset = window->offset; | ||
414 | break; | ||
415 | } | ||
416 | |||
417 | region->start = res->start - offset; | ||
418 | region->end = res->end - offset; | ||
419 | } | ||
420 | EXPORT_SYMBOL(pcibios_resource_to_bus); | ||
421 | |||
422 | void pcibios_bus_to_resource(struct pci_dev *dev, | ||
423 | struct resource *res, struct pci_bus_region *region) | ||
424 | { | ||
425 | struct pci_controller *controller = PCI_CONTROLLER(dev); | ||
426 | unsigned long offset = 0; | ||
427 | int i; | ||
428 | |||
429 | for (i = 0; i < controller->windows; i++) { | ||
430 | struct pci_window *window = &controller->window[i]; | ||
431 | if (!(window->resource.flags & res->flags)) | ||
432 | continue; | ||
433 | if (window->resource.start - window->offset > region->start) | ||
434 | continue; | ||
435 | if (window->resource.end - window->offset < region->end) | ||
436 | continue; | ||
437 | offset = window->offset; | ||
438 | break; | ||
439 | } | ||
440 | |||
441 | res->start = region->start + offset; | ||
442 | res->end = region->end + offset; | ||
443 | } | ||
444 | EXPORT_SYMBOL(pcibios_bus_to_resource); | ||
445 | |||
446 | static int __devinit is_valid_resource(struct pci_dev *dev, int idx) | 399 | static int __devinit is_valid_resource(struct pci_dev *dev, int idx) |
447 | { | 400 | { |
448 | unsigned int i, type_mask = IORESOURCE_IO | IORESOURCE_MEM; | 401 | unsigned int i, type_mask = IORESOURCE_IO | IORESOURCE_MEM; |
@@ -464,15 +417,11 @@ static int __devinit is_valid_resource(struct pci_dev *dev, int idx) | |||
464 | static void __devinit | 417 | static void __devinit |
465 | pcibios_fixup_resources(struct pci_dev *dev, int start, int limit) | 418 | pcibios_fixup_resources(struct pci_dev *dev, int start, int limit) |
466 | { | 419 | { |
467 | struct pci_bus_region region; | ||
468 | int i; | 420 | int i; |
469 | 421 | ||
470 | for (i = start; i < limit; i++) { | 422 | for (i = start; i < limit; i++) { |
471 | if (!dev->resource[i].flags) | 423 | if (!dev->resource[i].flags) |
472 | continue; | 424 | continue; |
473 | region.start = dev->resource[i].start; | ||
474 | region.end = dev->resource[i].end; | ||
475 | pcibios_bus_to_resource(dev, &dev->resource[i], ®ion); | ||
476 | if ((is_valid_resource(dev, i))) | 425 | if ((is_valid_resource(dev, i))) |
477 | pci_claim_resource(dev, i); | 426 | pci_claim_resource(dev, i); |
478 | } | 427 | } |
diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c index 0a36f082eaf1..238e2c511d94 100644 --- a/arch/ia64/sn/kernel/io_init.c +++ b/arch/ia64/sn/kernel/io_init.c | |||
@@ -297,7 +297,8 @@ sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus) | |||
297 | s64 status = 0; | 297 | s64 status = 0; |
298 | struct pci_controller *controller; | 298 | struct pci_controller *controller; |
299 | struct pcibus_bussoft *prom_bussoft_ptr; | 299 | struct pcibus_bussoft *prom_bussoft_ptr; |
300 | 300 | LIST_HEAD(resources); | |
301 | int i; | ||
301 | 302 | ||
302 | status = sal_get_pcibus_info((u64) segment, (u64) busnum, | 303 | status = sal_get_pcibus_info((u64) segment, (u64) busnum, |
303 | (u64) ia64_tpa(&prom_bussoft_ptr)); | 304 | (u64) ia64_tpa(&prom_bussoft_ptr)); |
@@ -315,7 +316,15 @@ sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus) | |||
315 | */ | 316 | */ |
316 | controller->platform_data = prom_bussoft_ptr; | 317 | controller->platform_data = prom_bussoft_ptr; |
317 | 318 | ||
318 | bus = pci_scan_bus(busnum, &pci_root_ops, controller); | 319 | sn_legacy_pci_window_fixup(controller, |
320 | prom_bussoft_ptr->bs_legacy_io, | ||
321 | prom_bussoft_ptr->bs_legacy_mem); | ||
322 | for (i = 0; i < controller->windows; i++) | ||
323 | pci_add_resource_offset(&resources, | ||
324 | &controller->window[i].resource, | ||
325 | controller->window[i].offset); | ||
326 | bus = pci_scan_root_bus(NULL, busnum, &pci_root_ops, controller, | ||
327 | &resources); | ||
319 | if (bus == NULL) | 328 | if (bus == NULL) |
320 | goto error_return; /* error, or bus already scanned */ | 329 | goto error_return; /* error, or bus already scanned */ |
321 | 330 | ||
@@ -348,9 +357,6 @@ sn_bus_fixup(struct pci_bus *bus) | |||
348 | return; | 357 | return; |
349 | } | 358 | } |
350 | sn_common_bus_fixup(bus, prom_bussoft_ptr); | 359 | sn_common_bus_fixup(bus, prom_bussoft_ptr); |
351 | sn_legacy_pci_window_fixup(PCI_CONTROLLER(bus), | ||
352 | prom_bussoft_ptr->bs_legacy_io, | ||
353 | prom_bussoft_ptr->bs_legacy_mem); | ||
354 | } | 360 | } |
355 | list_for_each_entry(pci_dev, &bus->devices, bus_list) { | 361 | list_for_each_entry(pci_dev, &bus->devices, bus_list) { |
356 | sn_io_slot_fixup(pci_dev); | 362 | sn_io_slot_fixup(pci_dev); |