diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-03-12 22:40:26 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 04:55:20 -0400 |
commit | 28f57e774d91ce01e03ff65caa2313bc8786b66f (patch) | |
tree | 5606d59ab501563d62798ccebc5915532d491174 /arch/sparc64 | |
parent | 97b3cf050b467dda571943ceadff5452bed04549 (diff) |
[SPARC64]: Force dummy host controller onto bus zero.
This helps deal with the invisible bridge that sits between
the host controller and the top-most visisble PCI devices
on hypervisor systems.
For example, on T1000 the bus-range property says 2 --> 4
and so there is a PCI express bridge at bus 2, devfn 0, etc.
So if we don't force the dummy host controller to bus zero,
we'll try to create two devices with the same domain/bus/devfn
triplet.
Also, add some more log diagnostics to make debugging stuff like this
easyer.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64')
-rw-r--r-- | arch/sparc64/kernel/pci.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c index ec5f85b030ef..8a7c699bb109 100644 --- a/arch/sparc64/kernel/pci.c +++ b/arch/sparc64/kernel/pci.c | |||
@@ -392,7 +392,8 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, | |||
392 | if (type == NULL) | 392 | if (type == NULL) |
393 | type = ""; | 393 | type = ""; |
394 | 394 | ||
395 | printk(" create device, devfn: %x, type: %s\n", devfn, type); | 395 | printk(" create device, devfn: %x, type: %s hostcontroller(%d)\n", |
396 | devfn, type, host_controller); | ||
396 | 397 | ||
397 | dev->bus = bus; | 398 | dev->bus = bus; |
398 | dev->sysdata = node; | 399 | dev->sysdata = node; |
@@ -407,6 +408,9 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, | |||
407 | dev->subsystem_vendor = 0x0000; | 408 | dev->subsystem_vendor = 0x0000; |
408 | dev->subsystem_device = 0x0000; | 409 | dev->subsystem_device = 0x0000; |
409 | dev->cfg_size = 256; | 410 | dev->cfg_size = 256; |
411 | dev->class = PCI_CLASS_BRIDGE_HOST << 8; | ||
412 | sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(bus), | ||
413 | 0x00, PCI_SLOT(devfn), PCI_FUNC(devfn)); | ||
410 | } else { | 414 | } else { |
411 | dev->vendor = of_getintprop_default(node, "vendor-id", 0xffff); | 415 | dev->vendor = of_getintprop_default(node, "vendor-id", 0xffff); |
412 | dev->device = of_getintprop_default(node, "device-id", 0xffff); | 416 | dev->device = of_getintprop_default(node, "device-id", 0xffff); |
@@ -416,13 +420,7 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, | |||
416 | of_getintprop_default(node, "subsystem-id", 0); | 420 | of_getintprop_default(node, "subsystem-id", 0); |
417 | 421 | ||
418 | dev->cfg_size = pci_cfg_space_size(dev); | 422 | dev->cfg_size = pci_cfg_space_size(dev); |
419 | } | ||
420 | sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(bus), | ||
421 | dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn)); | ||
422 | 423 | ||
423 | if (host_controller) { | ||
424 | dev->class = PCI_CLASS_BRIDGE_HOST << 8; | ||
425 | } else { | ||
426 | /* We can't actually use the firmware value, we have | 424 | /* We can't actually use the firmware value, we have |
427 | * to read what is in the register right now. One | 425 | * to read what is in the register right now. One |
428 | * reason is that in the case of IDE interfaces the | 426 | * reason is that in the case of IDE interfaces the |
@@ -431,8 +429,12 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, | |||
431 | */ | 429 | */ |
432 | pci_read_config_dword(dev, PCI_CLASS_REVISION, &class); | 430 | pci_read_config_dword(dev, PCI_CLASS_REVISION, &class); |
433 | dev->class = class >> 8; | 431 | dev->class = class >> 8; |
432 | |||
433 | sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(bus), | ||
434 | dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn)); | ||
434 | } | 435 | } |
435 | printk(" class: 0x%x\n", dev->class); | 436 | printk(" class: 0x%x device name: %s\n", |
437 | dev->class, pci_name(dev)); | ||
436 | 438 | ||
437 | dev->current_state = 4; /* unknown power state */ | 439 | dev->current_state = 4; /* unknown power state */ |
438 | dev->error_state = pci_channel_io_normal; | 440 | dev->error_state = pci_channel_io_normal; |