On Thu, Jul 19, 2018 at 9:48 AM, Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx wrote: > Indeed. However I'm not fan of the solution. Shouldn't we instead have > some locking for the content of pci_dev? I've always been wary of us > having other similar races in there. The solution presented is perfectly fine as it uses atomic bitops which obviate the need for locking. Why do you want to add unnecessary locking on top? Certain other parts of struct pci_dev use their own locking, e.g. pci_bus_sem to protect bus_list. Most elements can and should be accessed lockless for performance. > > The powerpc PCI code contains a lot of cruft coming from the depth of > > history, including rather nasty assumptions. We want to progressively > > clean it up, starting with EEH, but it will take time. Then I suggest using the #include "../../../drivers/pci/pci.h" for now until the powerpc arch code has been consolidated. Thanks, Lukas