RE: [RFC PATCH 04/19] vfio/pci: Serialize function reset with recovery

From: Shameer Kolothum Thodi

Date: Thu Sep 03 2026 - 07:26:23 EST




> -----Original Message-----
> From: K V P, Satyanarayana <satyanarayana.k.v.p@xxxxxxxxx>
> Sent: 02 September 2026 07:06
> To: Shameer Kolothum Thodi <skolothumtho@xxxxxxxxxx>;
> kvm@xxxxxxxxxxxxxxx; linux-pci@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> Cc: alex@xxxxxxxxxxx; jgg@xxxxxxxx; kevin.tian@xxxxxxxxx;
> kbusch@xxxxxxxx; michal.winiarski@xxxxxxxxx; Sonang Patel
> <sonangp@xxxxxxxxxx>; Nathan Chen <nathanc@xxxxxxxxxx>; Matt Ochs
> <mochs@xxxxxxxxxx>
> Subject: Re: [RFC PATCH 04/19] vfio/pci: Serialize function reset with recovery

[...]
> > +int vfio_pci_try_reset_function(struct vfio_pci_core_device *vdev,
> > + bool reset_power_state)
> > {
> > + struct pci_dev *pdev = vdev->pdev;
> > + bool enabled = false;
> > + bool supported = vdev->pci_recovery_supported;
>
> Can we use a helper function to get pci recovery is supported or not?
>
> Maintainability will be easy with helper function than direct assignment.

Ok. Maybe we can add something similar to vfio_device_cdev_opened()
and I don’t think that local "supported" is required here.

Thanks,
Shameer