Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71921
b: refs/heads/master
c: 9611f61
h: refs/heads/master
i:
  71919: d76324c
v: v3
  • Loading branch information
Matthew Wilcox authored and Kyle McMartin committed Oct 18, 2007
1 parent f13f43e commit 2d8f5a6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 77 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 26f0324922e50e0ef7677aaf96287b862c2fec61
refs/heads/master: 9611f61eb5baf22b6b6ed46c2c196c10e1fade6a
32 changes: 0 additions & 32 deletions trunk/arch/parisc/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,31 +194,6 @@ 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! [%p-%p]\n",
(void*) r->start, (void*) 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)
Expand All @@ -245,13 +220,6 @@ 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",
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,
Expand Down
51 changes: 7 additions & 44 deletions trunk/drivers/parisc/lba_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,44 +556,6 @@ lba_bios_init(void)

#ifdef CONFIG_64BIT

/*
** Determine if a device is already configured.
** If so, reserve it resources.
**
** Read PCI cfg command register and see if I/O or MMIO is enabled.
** PAT has to enable the devices it's using.
**
** Note: resources are fixed up before we try to claim them.
*/
static void
lba_claim_dev_resources(struct pci_dev *dev)
{
u16 cmd;
int i, srch_flags;

(void) pci_read_config_word(dev, PCI_COMMAND, &cmd);

srch_flags = (cmd & PCI_COMMAND_IO) ? IORESOURCE_IO : 0;
if (cmd & PCI_COMMAND_MEMORY)
srch_flags |= IORESOURCE_MEM;

if (!srch_flags)
return;

for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
if (dev->resource[i].flags & srch_flags) {
pci_claim_resource(dev, i);
DBG(" claimed %s %d [%lx,%lx]/%lx\n",
pci_name(dev), i,
dev->resource[i].start,
dev->resource[i].end,
dev->resource[i].flags
);
}
}
}


/*
* truncate_pat_collision: Deal with overlaps or outright collisions
* between PAT PDC reported ranges.
Expand Down Expand Up @@ -653,7 +615,6 @@ truncate_pat_collision(struct resource *root, struct resource *new)
}

#else
#define lba_claim_dev_resources(dev) do { } while (0)
#define truncate_pat_collision(r,n) (0)
#endif

Expand Down Expand Up @@ -684,8 +645,12 @@ lba_fixup_bus(struct pci_bus *bus)
** pci_alloc_primary_bus() mangles this.
*/
if (bus->self) {
int i;
/* PCI-PCI Bridge */
pci_read_bridge_bases(bus);
for (i = PCI_BRIDGE_RESOURCES; i < PCI_NUM_RESOURCES; i++) {
pci_claim_resource(bus->self, i);
}
} else {
/* Host-PCI Bridge */
int err, i;
Expand Down Expand Up @@ -803,6 +768,9 @@ lba_fixup_bus(struct pci_bus *bus)
DBG("lba_fixup_bus() WTF? 0x%lx [%lx/%lx] XXX",
res->flags, res->start, res->end);
}
if ((i != PCI_ROM_RESOURCE) ||
(res->flags & IORESOURCE_ROM_ENABLE))
pci_claim_resource(dev, i);
}

#ifdef FBB_SUPPORT
Expand All @@ -814,11 +782,6 @@ lba_fixup_bus(struct pci_bus *bus)
bus->bridge_ctl &= ~(status & PCI_STATUS_FAST_BACK);
#endif

if (is_pdc_pat()) {
/* Claim resources for PDC's devices */
lba_claim_dev_resources(dev);
}

/*
** P2PB's have no IRQs. ignore them.
*/
Expand Down

0 comments on commit 2d8f5a6

Please sign in to comment.