public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
To: liulongfang <liulongfang@huawei.com>,
	"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
	"jgg@nvidia.com" <jgg@nvidia.com>,
	"Jonathan Cameron" <jonathan.cameron@huawei.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linuxarm@openeuler.org" <linuxarm@openeuler.org>
Subject: RE: [PATCH v10 3/4] hisi_acc_vfio_pci: register debugfs for hisilicon migration driver
Date: Thu, 24 Oct 2024 13:12:45 +0000	[thread overview]
Message-ID: <bedd3623de984a6fafd24a2c85f6c05e@huawei.com> (raw)
In-Reply-To: <20241016012308.14108-4-liulongfang@huawei.com>



> -----Original Message-----
> From: liulongfang <liulongfang@huawei.com>
> Sent: Wednesday, October 16, 2024 2:23 AM
> To: alex.williamson@redhat.com; jgg@nvidia.com; Shameerali Kolothum
> Thodi <shameerali.kolothum.thodi@huawei.com>; Jonathan Cameron
> <jonathan.cameron@huawei.com>
> Cc: kvm@vger.kernel.org; linux-kernel@vger.kernel.org;
> linuxarm@openeuler.org; liulongfang <liulongfang@huawei.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@huawei.com>

  reply	other threads:[~2024-10-24 13:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-16  1:23 [PATCH v10 0/4] debugfs to hisilicon migration driver Longfang Liu
2024-10-16  1:23 ` [PATCH v10 1/4] hisi_acc_vfio_pci: extract public functions for container_of Longfang Liu
2024-10-16  1:23 ` [PATCH v10 2/4] hisi_acc_vfio_pci: create subfunction for data reading Longfang Liu
2024-10-16  1:23 ` [PATCH v10 3/4] hisi_acc_vfio_pci: register debugfs for hisilicon migration driver Longfang Liu
2024-10-24 13:12   ` Shameerali Kolothum Thodi [this message]
2024-10-24 13:26     ` liulongfang
2024-10-16  1:23 ` [PATCH v10 4/4] Documentation: add debugfs description for hisi migration Longfang Liu
2024-10-24 13:14   ` Shameerali Kolothum Thodi
2024-10-24 13:18 ` [PATCH v10 0/4] debugfs to hisilicon migration driver Shameerali Kolothum Thodi
2024-10-24 15:27   ` Jason Gunthorpe
2024-10-24 16:06     ` Shameerali Kolothum Thodi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bedd3623de984a6fafd24a2c85f6c05e@huawei.com \
    --to=shameerali.kolothum.thodi@huawei.com \
    --cc=alex.williamson@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@openeuler.org \
    --cc=liulongfang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox