]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - arch/ia64/sn/kernel/io_init.c
ia64: use non-racy method for proc entries creation
[mv-sheeva.git] / arch / ia64 / sn / kernel / io_init.c
index 6b10e5d284883380a284a1d2616e1aa2ec834fd2..c3aa851d1ca60278c9897859ba9a6740976ae6c9 100644 (file)
@@ -209,11 +209,11 @@ sn_io_slot_fixup(struct pci_dev *dev)
 
        pcidev_info = kzalloc(sizeof(struct pcidev_info), GFP_KERNEL);
        if (!pcidev_info)
-               panic("%s: Unable to alloc memory for pcidev_info", __FUNCTION__);
+               panic("%s: Unable to alloc memory for pcidev_info", __func__);
 
        sn_irq_info = kzalloc(sizeof(struct sn_irq_info), GFP_KERNEL);
        if (!sn_irq_info)
-               panic("%s: Unable to alloc memory for sn_irq_info", __FUNCTION__);
+               panic("%s: Unable to alloc memory for sn_irq_info", __func__);
 
        /* Call to retrieve pci device information needed by kernel. */
        status = sal_get_pcidev_info((u64) pci_domain_nr(dev),
@@ -259,9 +259,23 @@ sn_io_slot_fixup(struct pci_dev *dev)
                        insert_resource(&ioport_resource, &dev->resource[idx]);
                else
                        insert_resource(&iomem_resource, &dev->resource[idx]);
-               /* If ROM, mark as shadowed in PROM */
-               if (idx == PCI_ROM_RESOURCE)
-                       dev->resource[idx].flags |= IORESOURCE_ROM_BIOS_COPY;
+               /*
+                * If ROM, set the actual ROM image size, and mark as
+                * shadowed in PROM.
+                */
+               if (idx == PCI_ROM_RESOURCE) {
+                       size_t image_size;
+                       void __iomem *rom;
+
+                       rom = ioremap(pci_resource_start(dev, PCI_ROM_RESOURCE),
+                                     size + 1);
+                       image_size = pci_get_rom_size(rom, size + 1);
+                       dev->resource[PCI_ROM_RESOURCE].end =
+                               dev->resource[PCI_ROM_RESOURCE].start +
+                               image_size - 1;
+                       dev->resource[PCI_ROM_RESOURCE].flags |=
+                                                IORESOURCE_ROM_BIOS_COPY;
+               }
        }
        /* Create a pci_window in the pci_controller struct for
         * each device resource.