On Sat, Jan 21, 2012 at 1:52 AM, Yinghai Lu <yinghai@xxxxxxxxxx> wrote: > > + /* > + * pci_stop_bus_device(dev) will not remove dev from bus->devices list, > + * so We don't need use _safe version for_each here. > + * Also _safe version has problem when pci_stop_bus_device() for PF try > + * to remove VFs. > + */ > + for (l = head->next; l != head;) { That's crazy. Why would you open-code this? Why isn't it just a "list_for_each()"? And what are the problems with the safe version? If the safe version doesn't work, then something is *seriously* wrong with the list. > + struct pci_dev *dev = pci_dev_b(l); > + > + /* > + * VFs are removed by pci_remove_bus_device() in the > + * pci_stop_bus_devices() code path for PF. > + * aka, bus->devices get updated in the process. > + * barrier() will make sure we get right next from that list. > + */ > + if (!dev->is_virtfn) { > + pci_stop_bus_device(dev); > + barrier(); > + } And this is just insanity. The "barrier()" cannot *possibly* do anything sane. If it really makes a difference, there is again some serious problem with the whole f*cking thing. NAK on the patch until sanity is restored. This is just total voodoo programming. Linus -- 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