X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=arch%2Fparisc%2Fkernel%2Fpci.c;h=6936386c9861a3721aba9a857158e8cc9133743e;hb=d35c7b0e54a596c5a8134d75999b7f391a9c6550;hp=d3b8fc52dfc1e130a2c9a6e621116c62ed8a74f7;hpb=b4bc7b53ccfa0cb793591ba11af49db8f1bc5a4d;p=linux-2.6 diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c index d3b8fc52df..6936386c98 100644 --- a/arch/parisc/kernel/pci.c +++ b/arch/parisc/kernel/pci.c @@ -194,37 +194,13 @@ void __init pcibios_init_bus(struct pci_bus *bus) pci_write_config_word(dev, PCI_BRIDGE_CONTROL, bridge_ctl); } - -/* KLUGE: Link the child and parent resources - generic PCI didn't */ -static void -pcibios_link_hba_resources( struct resource *hba_res, struct resource *r) -{ - if (!r->parent) { - printk(KERN_EMERG "PCI: resource not parented! [%lx-%lx]\n", - r->start, r->end); - r->parent = hba_res; - - /* reverse link is harder *sigh* */ - if (r->parent->child) { - if (r->parent->sibling) { - struct resource *next = r->parent->sibling; - while (next->sibling) - next = next->sibling; - next->sibling = r; - } else { - r->parent->sibling = r; - } - } else - r->parent->child = r; - } -} - /* called by drivers/pci/setup-bus.c:pci_setup_bridge(). */ void __devinit pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, struct resource *res) { - struct pci_bus *bus = dev->bus; - struct pci_hba_data *hba = HBA_DATA(bus->bridge->platform_data); +#ifdef CONFIG_64BIT + struct pci_hba_data *hba = HBA_DATA(dev->bus->bridge->platform_data); +#endif if (res->flags & IORESOURCE_IO) { /* @@ -243,23 +219,15 @@ void __devinit pcibios_resource_to_bus(struct pci_dev *dev, } DBG_RES("pcibios_resource_to_bus(%02x %s [%lx,%lx])\n", - bus->number, res->flags & IORESOURCE_IO ? "IO" : "MEM", + dev->bus->number, res->flags & IORESOURCE_IO ? "IO" : "MEM", region->start, region->end); - - /* KLUGE ALERT - ** if this resource isn't linked to a "parent", then it seems - ** to be a child of the HBA - lets link it in. - */ - pcibios_link_hba_resources(&hba->io_space, bus->resource[0]); - pcibios_link_hba_resources(&hba->lmmio_space, bus->resource[1]); } void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, struct pci_bus_region *region) { #ifdef CONFIG_64BIT - struct pci_bus *bus = dev->bus; - struct pci_hba_data *hba = HBA_DATA(bus->bridge->platform_data); + struct pci_hba_data *hba = HBA_DATA(dev->bus->bridge->platform_data); #endif if (res->flags & IORESOURCE_MEM) { @@ -290,7 +258,7 @@ EXPORT_SYMBOL(pcibios_bus_to_resource); void pcibios_align_resource(void *data, struct resource *res, resource_size_t size, resource_size_t alignment) { - unsigned long mask, align; + resource_size_t mask, align; DBG_RES("pcibios_align_resource(%s, (%p) [%lx,%lx]/%x, 0x%lx, 0x%lx)\n", pci_name(((struct pci_dev *) data)), @@ -319,23 +287,15 @@ void pcibios_align_resource(void *data, struct resource *res, */ int pcibios_enable_device(struct pci_dev *dev, int mask) { - u16 cmd; - int idx; - - pci_read_config_word(dev, PCI_COMMAND, &cmd); - - for (idx = 0; idx < DEVICE_COUNT_RESOURCE; idx++) { - struct resource *r = &dev->resource[idx]; + int err; + u16 cmd, old_cmd; - /* only setup requested resources */ - if (!(mask & (1<flags & IORESOURCE_IO) - cmd |= PCI_COMMAND_IO; - if (r->flags & IORESOURCE_MEM) - cmd |= PCI_COMMAND_MEMORY; - } + pci_read_config_word(dev, PCI_COMMAND, &cmd); + old_cmd = cmd; cmd |= (PCI_COMMAND_SERR | PCI_COMMAND_PARITY); @@ -344,8 +304,12 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) if (dev->bus->bridge_ctl & PCI_BRIDGE_CTL_FAST_BACK) cmd |= PCI_COMMAND_FAST_BACK; #endif - DBGC("PCIBIOS: Enabling device %s cmd 0x%04x\n", pci_name(dev), cmd); - pci_write_config_word(dev, PCI_COMMAND, cmd); + + if (cmd != old_cmd) { + dev_info(&dev->dev, "enabling SERR and PARITY (%04x -> %04x)\n", + old_cmd, cmd); + pci_write_config_word(dev, PCI_COMMAND, cmd); + } return 0; }