[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bedd3623de984a6fafd24a2c85f6c05e@huawei.com>
Date: Thu, 24 Oct 2024 13:12:45 +0000
From: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@...wei.com>
To: liulongfang <liulongfang@...wei.com>, "alex.williamson@...hat.com"
<alex.williamson@...hat.com>, "jgg@...dia.com" <jgg@...dia.com>, "Jonathan
Cameron" <jonathan.cameron@...wei.com>
CC: "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linuxarm@...neuler.org" <linuxarm@...neuler.org>
Subject: RE: [PATCH v10 3/4] hisi_acc_vfio_pci: register debugfs for hisilicon
migration driver
> -----Original Message-----
> From: liulongfang <liulongfang@...wei.com>
> Sent: Wednesday, October 16, 2024 2:23 AM
> To: alex.williamson@...hat.com; jgg@...dia.com; Shameerali Kolothum
> Thodi <shameerali.kolothum.thodi@...wei.com>; Jonathan Cameron
> <jonathan.cameron@...wei.com>
> Cc: kvm@...r.kernel.org; linux-kernel@...r.kernel.org;
> linuxarm@...neuler.org; liulongfang <liulongfang@...wei.com>
> Subject: [PATCH v10 3/4] hisi_acc_vfio_pci: register debugfs for hisilicon
> migration driver
[..]
> @@ -1342,6 +1538,7 @@ static int hisi_acc_vfio_pci_migrn_init_dev(struct
> vfio_device *core_vdev)
> hisi_acc_vdev->pf_qm = pf_qm;
> hisi_acc_vdev->vf_dev = pdev;
> mutex_init(&hisi_acc_vdev->state_mutex);
> + mutex_init(&hisi_acc_vdev->open_mutex);
>
> core_vdev->migration_flags = VFIO_MIGRATION_STOP_COPY |
> VFIO_MIGRATION_PRE_COPY;
> core_vdev->mig_ops = &hisi_acc_vfio_pci_migrn_state_ops;
> @@ -1413,6 +1610,9 @@ static int hisi_acc_vfio_pci_probe(struct pci_dev
> *pdev, const struct pci_device
> ret = vfio_pci_core_register_device(&hisi_acc_vdev->core_device);
> if (ret)
> goto out_put_vdev;
> +
> + if (ops == &hisi_acc_vfio_pci_migrn_ops)
> + hisi_acc_vfio_debug_init(hisi_acc_vdev);
As commented earlier, the ops check can be moved to the debug_init() function
and you can remove ops check for the debug_exit() below. You may have to
rearrange the functions to avoid the compiler error you mentioned in previous
version to do so.
> return 0;
>
> out_put_vdev:
> @@ -1423,8 +1623,11 @@ static int hisi_acc_vfio_pci_probe(struct pci_dev
> *pdev, const struct pci_device
> static void hisi_acc_vfio_pci_remove(struct pci_dev *pdev)
> {
> struct hisi_acc_vf_core_device *hisi_acc_vdev =
> hisi_acc_drvdata(pdev);
> + struct vfio_device *vdev = &hisi_acc_vdev->core_device.vdev;
>
> vfio_pci_core_unregister_device(&hisi_acc_vdev->core_device);
> + if (vdev->ops == &hisi_acc_vfio_pci_migrn_ops)
> + hisi_acc_vf_debugfs_exit(hisi_acc_vdev);
As mentioned above remove the ops check here.
With the above ones checked and fixed,
Reviewed-by: Shameer Kolothum <shameerali.kolothum.thodi@...wei.com>
Powered by blists - more mailing lists