Sigh. The API is already broken - passing parent resource to
pcibios_update_resource() is not only pointless (since we have
res->parent), but extremely misleading.
Almost all architectures declare
void
pcibios_update_resource(struct pci_dev *dev, struct resource *root,
^^^^
struct resource *res, int resource)
Obviously root != parent.
Vast majority of archs do not use `root' arg, but some do:
mips64/mips-boards/generic/pci.c
mips64/sgi-ip27/ip27-pci.c
mips/ite-boards/generic/it8172_pci.c
mips/mips-boards/generic/pci.c
ia64/pci/pci.c
All of these use exactly the same code:
pcibios_update_resource(struct pci_dev *dev, struct resource *root,
struct resource *res, int resource)
{
unsigned long where, size;
u32 reg;
where = PCI_BASE_ADDRESS_0 + (resource * 4);
size = res->end - res->start;
pci_read_config_dword(dev, where, ®);
reg = (reg & size) | (((u32)(res->start - root->start)) & ~size);
pci_write_config_dword(dev, where, reg);
}
Which is wrong if the `root' is a pointer to the PCI or CardBus bridge
resource.
The arg 2 to pcibios_update_resource() must be removed...
Ivan.
-
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/