[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <60b22817-442f-c7ac-3dce-8f8a57c12c4b@nvidia.com>
Date: Thu, 23 Sep 2021 16:57:16 +0300
From: Max Gurtovoy <mgurtovoy@...dia.com>
To: Leon Romanovsky <leon@...nel.org>,
Doug Ledford <dledford@...hat.com>,
Jason Gunthorpe <jgg@...dia.com>
CC: Yishai Hadas <yishaih@...dia.com>,
Alex Williamson <alex.williamson@...hat.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
"Kirti Wankhede" <kwankhede@...dia.com>, <kvm@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-pci@...r.kernel.org>,
<linux-rdma@...r.kernel.org>, <netdev@...r.kernel.org>,
Saeed Mahameed <saeedm@...dia.com>
Subject: Re: [PATCH mlx5-next 3/7] vfio/pci_core: Make the region->release()
function optional
On 9/22/2021 1:38 PM, Leon Romanovsky wrote:
> From: Yishai Hadas <yishaih@...dia.com>
>
> Make the region->release() function optional as in some cases there is
> nothing to do by driver as part of it.
>
> This is needed for coming patch from this series once we add
> mlx5_vfio_cpi driver to support live migration but we don't need a
mlx5_vfio_pci *typo
> migration release function.
>
> Signed-off-by: Yishai Hadas <yishaih@...dia.com>
> Signed-off-by: Leon Romanovsky <leonro@...dia.com>
> ---
> drivers/vfio/pci/vfio_pci_core.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c
> index 68198e0f2a63..3ddc3adb24de 100644
> --- a/drivers/vfio/pci/vfio_pci_core.c
> +++ b/drivers/vfio/pci/vfio_pci_core.c
> @@ -341,7 +341,8 @@ void vfio_pci_core_disable(struct vfio_pci_core_device *vdev)
> vdev->virq_disabled = false;
>
> for (i = 0; i < vdev->num_regions; i++)
> - vdev->region[i].ops->release(vdev, &vdev->region[i]);
> + if (vdev->region[i].ops->release)
> + vdev->region[i].ops->release(vdev, &vdev->region[i]);
>
> vdev->num_regions = 0;
> kfree(vdev->region);
Looks good,
Reviewed-by: Max Gurtovoy <mgurtovoy@...dia.com>
Powered by blists - more mailing lists