[patch] 2.5.18: unnamed PCI bus resources

From: Ivan Kokshaysky (ink@jurassic.park.msu.ru)
Date: Tue May 28 2002 - 10:54:45 EST


As pointed out by Russell King, resource name pointers
of the secondary PCI buses are left uninitialized in the
non-x86 PCI allocation path.
Assigning these pointers in pci_add_new_bus() fixes the problem.

Ivan.

--- 2.5.18/drivers/pci/probe.c Sat May 25 05:55:20 2002
+++ linux/drivers/pci/probe.c Tue May 28 15:52:05 2002
@@ -151,7 +151,6 @@ void __devinit pci_read_bridge_bases(str
                 res->flags = (io_base_lo & PCI_IO_RANGE_TYPE_MASK) | IORESOURCE_IO;
                 res->start = base;
                 res->end = limit + 0xfff;
- res->name = child->name;
         } else {
                 /*
                  * Ugh. We don't know enough about this bridge. Just assume
@@ -170,7 +169,6 @@ void __devinit pci_read_bridge_bases(str
                 res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM;
                 res->start = base;
                 res->end = limit + 0xfffff;
- res->name = child->name;
         } else {
                 /* See comment above. Same thing */
                 printk(KERN_ERR "Unknown bridge resource %d: assuming transparent\n", 1);
@@ -201,7 +199,6 @@ void __devinit pci_read_bridge_bases(str
                 res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM | IORESOURCE_PREFETCH;
                 res->start = base;
                 res->end = limit + 0xfffff;
- res->name = child->name;
         } else {
                 /* See comments above */
                 printk(KERN_ERR "Unknown bridge resource %d: assuming transparent\n", 2);
@@ -248,9 +245,11 @@ struct pci_bus * __devinit pci_add_new_b
         child->primary = parent->secondary;
         child->subordinate = 0xff;
 
- /* Set up default resource pointers.. */
- for (i = 0; i < 4; i++)
+ /* Set up default resource pointers and names.. */
+ for (i = 0; i < 4; i++) {
                 child->resource[i] = &dev->resource[PCI_BRIDGE_RESOURCES+i];
+ child->resource[i]->name = child->name;
+ }
 
         return child;
 }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri May 31 2002 - 22:00:22 EST