Re: [PATCH] fakephp: Allocate PCI resources before adding the device

From: Trent Piepho
Date: Tue Nov 25 2008 - 23:47:27 EST


On Tue, 25 Nov 2008, Darrick J. Wong wrote:
> For PCI devices, pci_bus_assign_resources() must be called to set up the
> pci_device->resource array before pci_bus_add_devices() can be called, else
> attempts to load drivers results in BAR collision errors where there are none.

I've had a patch to fakephp that did something like this for a while, but I
called pci_bus_assign_resources() _after_ adding the devices with calls to
pci_bus_add_device(). It seems like that might be easier, to just add all
the devices and then call pci_bus_assign_resources() when done. It appears
to work fine for me. Is there a reason this is wrong?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/