Alex-san,
I noticed that changing pci_get_pci_slot() to acquire the pci_bus_sem
might be not enough. If slot was created between pci_get_pci_slot() and
pci_create_slot() by another thread in the following code, something
wrong would happen I think.
pci_slot = pci_get_pci_slot(bus, slot_nr);
if (pci_slot) {
if (pci_slot->hotplug) {
result = -EBUSY;
goto err;
}
if (strcmp(kobject_name(&pci_slot->kobj), name))
if ((result = pci_rename_slot(pci_slot, name)))
goto err;
} else {
pci_slot = pci_create_slot(bus, slot_nr, name);
if ((result = IS_ERR(pci_slot)))
goto out;
}
I've finished reviewing and testing your patches. The rest of your
patch looks good to me. Of course, we must not forget the comment
from Taku Izumi.
Thanks,
Kenji Kaneshige
--