On Sat, Sep 17, 2016 at 10:35:06AM +0200, Lukas Wunner wrote: > On Tue, Sep 06, 2016 at 04:00:16PM -0600, Keith Busch wrote: > > - return pci_bus_read_dev_vendor_id(pdev->bus, pdev->devfn, &v, 0); > > + if (pdev->is_removed) > > + return false; > > + > > + if (!pci_bus_read_dev_vendor_id(pdev->bus, pdev->devfn, &v, 0)) { > > + pdev->is_removed = 1; > > + return false; > > + } > > + return true; > > } > > EXPORT_SYMBOL_GPL(pci_device_is_present); > > I've kept this series on my development branch and found a bug now: > > In the above hunk, it's okay to return false if pdev->is_removed is set, > but it's not okay to set pdev->is_removed if pci_bus_read_dev_vendor_id() > returns false. That's because pci_bus_read_dev_vendor_id() can fail for > other reasons, such as the device being powered down to D3cold, or > currently unreachable because a PCIe port above it was suspended to D3hot > so that the link is down. Those are transient issues, the device isn't > removed in those cases. Thanks for the info. I wasn't sure about making the removed return sticky on a failed vendor id check, so I will remove that from this path and resend the entire series. -- 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