if (pin == 0)
return -1;
if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) ||
- line == 0xff) {
+ line == 0xff || line == 0) {
return -1;
}
- DBG(" -> no map ! Using irq line %d from PCI config\n", line);
+ DBG(" -> no map ! Using line %d (pin %d) from PCI config\n",
+ line, pin);
virq = irq_create_mapping(NULL, line);
if (virq != NO_IRQ)
struct resource *res = dev->resource + i;
if (!res->flags)
continue;
- if (res->end == 0xffffffff) {
+ /* On platforms that have PPC_PCI_PROBE_ONLY set, we don't
+ * consider 0 as an unassigned BAR value. It's technically
+ * a valid value, but linux doesn't like it... so when we can
+ * re-assign things, we do so, but if we can't, we keep it
+ * around and hope for the best...
+ */
+ if (res->start == 0 && !(ppc_pci_flags & PPC_PCI_PROBE_ONLY)) {
pr_debug("PCI:%s Resource %d %016llx-%016llx [%x] is unassigned\n",
pci_name(dev), i,
(unsigned long long)res->start,
for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) {
if ((res = bus->resource[i]) == NULL)
continue;
- if (!res->flags || bus->self->transparent)
+ if (!res->flags)
+ continue;
+ if (i >= 3 && bus->self->transparent)
continue;
-
/* On PowerMac, Apple leaves bridge windows open over
* an inaccessible region of memory space (0...fffff)
* which is somewhat bogus, but that's what they think
* equal to the pci_mem_offset of the host bridge and
* their size is smaller than 1M.
*/
- if (res->start == hose->pci_mem_offset &&
+ if (res->flags & IORESOURCE_MEM &&
+ res->start == hose->pci_mem_offset &&
res->end < 0x100000) {
printk(KERN_INFO
"PCI: Closing bogus Apple Firmware"
}
}
-static inline int __devinit alloc_resource(struct pci_dev *dev, int idx)
+static inline void __devinit alloc_resource(struct pci_dev *dev, int idx)
{
struct resource *pr, *r = &dev->resource[idx];
r->flags |= IORESOURCE_UNSET;
r->end -= r->start;
r->start = 0;
-
- return -EBUSY;
}
- return 0;
}
static void __init pcibios_allocate_resources(int pass)
disabled = !(command & PCI_COMMAND_IO);
else
disabled = !(command & PCI_COMMAND_MEMORY);
- if (pass == disabled && alloc_resource(dev, idx)) {
- command &= ~(r->flags & (IORESOURCE_IO |
- IORESOURCE_MEM));
- pci_write_config_word(dev,
- PCI_COMMAND, command);
- }
+ if (pass == disabled)
+ alloc_resource(dev, idx);
}
if (pass)
continue;