On Wed, May 13, 2015 at 11:16:30AM +1000, Gavin Shan wrote: >On Mon, May 04, 2015 at 03:07:38PM +0800, Wei Yang wrote: > > if (!edev->physfn) { > pr_warn("%s: EEH dev %04x:%02x:%02x:%01x not for VF\n", > edev->phb->global_number, pdn->busno, > PCI_SLOT(pdn->devfn), PCI_FUNC(pdn->devfn)); > return NULL; > } > >>+ >>+ driver = eeh_pcid_get(dev); >>+ if (driver) { >>+ eeh_pcid_put(dev); >>+ if (driver->err_handler) >>+ return NULL; >>+ } > >dev and driver are NULL for those VFs that have been unplugged. For those >VFs weren't unplugged, driver and err_handler should be valid. The code >looks correct. However, for consistence, please use EEH_DEV_DISCONNECTED >that has been marked to those EEH devices which were unplugged. Do you >think it would be better? > > if (!(dev->flags & EEH_DEV_DISCONNECTED)) > return NULL; > Hi, Gavin, I think this is a nice idea, while this may not work. We mark the DISCONNECTED flag when remove a PCI device, while before we do the hot plug we will detach it from the tree and remove this flag in eeh_pe_detach_dev(). This will leads to the VF not be hot plugged. -- Richard Yang Help you, Help me -- 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