aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/probe.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-18 16:39:59 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-18 16:39:59 -0400
commit0679c2f47d50651018dd5e0bf35330f6e6ae35ec (patch)
tree2df65ebb958f930abf0b7ad35fd6e528398b1679 /drivers/pci/probe.c
parent76fbc263ff7e42ce8b21b8aee176e3c74b45f81a (diff)
parent5b664cb235e97afbf34db9c4d77f08ebd725335e (diff)
Merge branch 'linus' into pci-for-jesse
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r--drivers/pci/probe.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 27cdbb06c4dd..d2bd74ee3e08 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -278,8 +278,8 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
278 printk(KERN_INFO "PCI: %s reg %x 64bit mmio: [%llx, %llx]\n", pci_name(dev), reg, res->start, res->end); 278 printk(KERN_INFO "PCI: %s reg %x 64bit mmio: [%llx, %llx]\n", pci_name(dev), reg, res->start, res->end);
279#else 279#else
280 if (sz64 > 0x100000000ULL) { 280 if (sz64 > 0x100000000ULL) {
281 printk(KERN_ERR "PCI: Unable to handle 64-bit " 281 dev_err(&dev->dev, "BAR %d: can't handle 64-bit"
282 "BAR for device %s\n", pci_name(dev)); 282 " BAR\n", pos);
283 res->start = 0; 283 res->start = 0;
284 res->flags = 0; 284 res->flags = 0;
285 } else if (lhi) { 285 } else if (lhi) {
@@ -332,7 +332,7 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
332 return; 332 return;
333 333
334 if (dev->transparent) { 334 if (dev->transparent) {
335 printk(KERN_INFO "PCI: Transparent bridge - %s\n", pci_name(dev)); 335 dev_info(&dev->dev, "transparent bridge\n");
336 for(i = 3; i < PCI_BUS_NUM_RESOURCES; i++) 336 for(i = 3; i < PCI_BUS_NUM_RESOURCES; i++)
337 child->resource[i] = child->parent->resource[i - 3]; 337 child->resource[i] = child->parent->resource[i - 3];
338 } 338 }
@@ -397,7 +397,8 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
397 limit |= ((long) mem_limit_hi) << 32; 397 limit |= ((long) mem_limit_hi) << 32;
398#else 398#else
399 if (mem_base_hi || mem_limit_hi) { 399 if (mem_base_hi || mem_limit_hi) {
400 printk(KERN_ERR "PCI: Unable to handle 64-bit address space for bridge %s\n", pci_name(dev)); 400 dev_err(&dev->dev, "can't handle 64-bit "
401 "address space for bridge\n");
401 return; 402 return;
402 } 403 }
403#endif 404#endif
@@ -420,6 +421,7 @@ static struct pci_bus * pci_alloc_bus(void)
420 INIT_LIST_HEAD(&b->node); 421 INIT_LIST_HEAD(&b->node);
421 INIT_LIST_HEAD(&b->children); 422 INIT_LIST_HEAD(&b->children);
422 INIT_LIST_HEAD(&b->devices); 423 INIT_LIST_HEAD(&b->devices);
424 INIT_LIST_HEAD(&b->slots);
423 } 425 }
424 return b; 426 return b;
425} 427}
@@ -517,8 +519,8 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
517 519
518 pci_read_config_dword(dev, PCI_PRIMARY_BUS, &buses); 520 pci_read_config_dword(dev, PCI_PRIMARY_BUS, &buses);
519 521
520 pr_debug("PCI: Scanning behind PCI bridge %s, config %06x, pass %d\n", 522 dev_dbg(&dev->dev, "scanning behind bridge, config %06x, pass %d\n",
521 pci_name(dev), buses & 0xffffff, pass); 523 buses & 0xffffff, pass);
522 524
523 /* Disable MasterAbortMode during probing to avoid reporting 525 /* Disable MasterAbortMode during probing to avoid reporting
524 of bus errors (in some architectures) */ 526 of bus errors (in some architectures) */
@@ -541,8 +543,8 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
541 * ignore it. This can happen with the i450NX chipset. 543 * ignore it. This can happen with the i450NX chipset.
542 */ 544 */
543 if (pci_find_bus(pci_domain_nr(bus), busnr)) { 545 if (pci_find_bus(pci_domain_nr(bus), busnr)) {
544 printk(KERN_INFO "PCI: Bus %04x:%02x already known\n", 546 dev_info(&dev->dev, "bus %04x:%02x already known\n",
545 pci_domain_nr(bus), busnr); 547 pci_domain_nr(bus), busnr);
546 goto out; 548 goto out;
547 } 549 }
548 550
@@ -717,8 +719,9 @@ static int pci_setup_device(struct pci_dev * dev)
717{ 719{
718 u32 class; 720 u32 class;
719 721
720 sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(dev->bus), 722 dev_set_name(&dev->dev, "%04x:%02x:%02x.%d", pci_domain_nr(dev->bus),
721 dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); 723 dev->bus->number, PCI_SLOT(dev->devfn),
724 PCI_FUNC(dev->devfn));
722 725
723 pci_read_config_dword(dev, PCI_CLASS_REVISION, &class); 726 pci_read_config_dword(dev, PCI_CLASS_REVISION, &class);
724 dev->revision = class & 0xff; 727 dev->revision = class & 0xff;
@@ -726,7 +729,7 @@ static int pci_setup_device(struct pci_dev * dev)
726 dev->class = class; 729 dev->class = class;
727 class >>= 8; 730 class >>= 8;
728 731
729 pr_debug("PCI: Found %s [%04x/%04x] %06x %02x\n", pci_name(dev), 732 dev_dbg(&dev->dev, "found [%04x/%04x] class %06x header type %02x\n",
730 dev->vendor, dev->device, class, dev->hdr_type); 733 dev->vendor, dev->device, class, dev->hdr_type);
731 734
732 /* "Unknown power state" */ 735 /* "Unknown power state" */
@@ -794,13 +797,13 @@ static int pci_setup_device(struct pci_dev * dev)
794 break; 797 break;
795 798
796 default: /* unknown header */ 799 default: /* unknown header */
797 printk(KERN_ERR "PCI: device %s has unknown header type %02x, ignoring.\n", 800 dev_err(&dev->dev, "unknown header type %02x, "
798 pci_name(dev), dev->hdr_type); 801 "ignoring device\n", dev->hdr_type);
799 return -1; 802 return -1;
800 803
801 bad: 804 bad:
802 printk(KERN_ERR "PCI: %s: class %x doesn't match header type %02x. Ignoring class.\n", 805 dev_err(&dev->dev, "ignoring class %02x (doesn't match header "
803 pci_name(dev), class, dev->hdr_type); 806 "type %02x)\n", class, dev->hdr_type);
804 dev->class = PCI_CLASS_NOT_DEFINED; 807 dev->class = PCI_CLASS_NOT_DEFINED;
805 } 808 }
806 809
@@ -933,7 +936,7 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn)
933 return NULL; 936 return NULL;
934 /* Card hasn't responded in 60 seconds? Must be stuck. */ 937 /* Card hasn't responded in 60 seconds? Must be stuck. */
935 if (delay > 60 * 1000) { 938 if (delay > 60 * 1000) {
936 printk(KERN_WARNING "Device %04x:%02x:%02x.%d not " 939 printk(KERN_WARNING "pci %04x:%02x:%02x.%d: not "
937 "responding\n", pci_domain_nr(bus), 940 "responding\n", pci_domain_nr(bus),
938 bus->number, PCI_SLOT(devfn), 941 bus->number, PCI_SLOT(devfn),
939 PCI_FUNC(devfn)); 942 PCI_FUNC(devfn));
@@ -990,6 +993,9 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
990 /* Fix up broken headers */ 993 /* Fix up broken headers */
991 pci_fixup_device(pci_fixup_header, dev); 994 pci_fixup_device(pci_fixup_header, dev);
992 995
996 /* Initialize power management of the device */
997 pci_pm_init(dev);
998
993 /* 999 /*
994 * Add the device to our list of discovered devices 1000 * Add the device to our list of discovered devices
995 * and the bus list for fixup functions, etc. 1001 * and the bus list for fixup functions, etc.