Re: [PATCH 2.6.26] PCI: refuse to re-add a device to a bus upon pci_scan_child_bus()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Matthew Wilcox wrote:
On Tue, Jul 22, 2008 at 06:25:40PM +0300, Eran Liberty wrote:
If my devices where the only one on the bus I would not have stumbled on this bug. I would have removed them all before reloading and would have scanned and empty PCI bus list after the reloading.

That's not true, the code you posted:

bus = null;
while ((bus = pci_find_next_bus(bus)) != NULL) {
        pci_scan_child_bus(bus);
        pci_bus_assign_resources(bus);
        pci_bus_add_devices(bus);
}

will scan all busses again.
You are correct! I have a single bus :)

Alas, the CPU itself is a pci device. Upon scanning the bus it is it who is duplicated. Upon trying to "pci_bus_add_devices()" you get resource collision.

Does the CPU have BARs of its own?  If you have no other devices with
BARs, it would explain why you have not noticed the problem with
fixup_resource ;-)
I seriously doubt my CPU has any resources of its own.

Do you perceive any down side to my suggested patch?
It seems (to me) really logical that a device can not and should not be added twice to a pci bus device list.

The problem is the other side-effects of what you propose.
Could you elaborate what ominous side-effects you predict?

Liberty
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux