Re: [PATCH rc] PCI: Fix nested pci_dev_reset_iommu_prepare/done()

Nicolin Chen
2026-03-19T03:06:50Z

On Thu, Mar 19, 2026 at 03:00:58AM +0000, Tian, Kevin wrote:
> Looking at handlers like reset_intel_82599_sfp_virtfn(), the return value of
> pcie_flr() is not checked:
> static int reset_intel_82599_sfp_virtfn(struct pci_dev *dev, bool probe)
> {
> if (!probe)
> pcie_flr(dev);
> return 0;
> }
> Similarly, delay_250ms_after_flr() ignores the return value when actually
> performing the reset:
> static int delay_250ms_after_flr(struct pci_dev *dev, bool probe)
> {
> if (probe)
> return pcie_reset_flr(dev, PCI_RESET_PROBE);
> pcie_reset_flr(dev, PCI_RESET_DO_RESET);
> msleep(250);
> return 0;
> }
> If pci_dev_reset_iommu_prepare() fails inside pcie_flr(), the function aborts
> the FLR and returns an error. However, since the quirk handlers swallow this
> error, the PCI subsystem is falsely told that the device reset succeeded.
> Could this falsely reported success leave sensitive device state uncleared
> between host and guest environments? Can we ensure the return value from the
> inner reset functions is properly propagated to prevent this?

Yea, looks like we need a preparatory patch for the other series.

Thanks
Nicolin