From: "Michał Winiarski" <michal.winiarski@intel.com>
To: Jason Gunthorpe <jgg@ziepe.ca>,
Alex Williamson <alex@shazbot.org>,
"Kevin Tian" <kevin.tian@intel.com>,
Yishai Hadas <yishaih@nvidia.com>,
Longfang Liu <liulongfang@huawei.com>,
Shameer Kolothum <skolothumtho@nvidia.com>,
"Brett Creeley" <brett.creeley@amd.com>,
Giovanni Cabiddu <giovanni.cabiddu@intel.com>,
<kvm@vger.kernel.org>, <qat-linux@intel.com>,
<virtualization@lists.linux.dev>, <linux-kernel@vger.kernel.org>
Cc: "Michał Winiarski" <michal.winiarski@intel.com>
Subject: [PATCH 2/6] hisi_acc_vfio_pci: Use .migration_reset_state() callback
Date: Thu, 20 Nov 2025 13:36:43 +0100 [thread overview]
Message-ID: <20251120123647.3522082-3-michal.winiarski@intel.com> (raw)
In-Reply-To: <20251120123647.3522082-1-michal.winiarski@intel.com>
Move the migration device state reset code from .reset_done() to
dedicated callback.
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
---
drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
index fde33f54e99ec..eafdf62ee29ef 100644
--- a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
+++ b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
@@ -1169,9 +1169,10 @@ hisi_acc_vfio_pci_get_device_state(struct vfio_device *vdev,
return 0;
}
-static void hisi_acc_vf_pci_aer_reset_done(struct pci_dev *pdev)
+static void
+hisi_acc_vfio_pci_reset_device_state(struct vfio_device *vdev)
{
- struct hisi_acc_vf_core_device *hisi_acc_vdev = hisi_acc_drvdata(pdev);
+ struct hisi_acc_vf_core_device *hisi_acc_vdev = hisi_acc_get_vf_dev(vdev);
if (hisi_acc_vdev->core_device.vdev.migration_flags !=
VFIO_MIGRATION_STOP_COPY)
@@ -1529,6 +1530,7 @@ static void hisi_acc_vfio_pci_close_device(struct vfio_device *core_vdev)
static const struct vfio_migration_ops hisi_acc_vfio_pci_migrn_state_ops = {
.migration_set_state = hisi_acc_vfio_pci_set_device_state,
.migration_get_state = hisi_acc_vfio_pci_get_device_state,
+ .migration_reset_state = hisi_acc_vfio_pci_reset_device_state,
.migration_get_data_size = hisi_acc_vfio_pci_get_data_size,
};
@@ -1689,7 +1691,6 @@ static const struct pci_device_id hisi_acc_vfio_pci_table[] = {
MODULE_DEVICE_TABLE(pci, hisi_acc_vfio_pci_table);
static const struct pci_error_handlers hisi_acc_vf_err_handlers = {
- .reset_done = hisi_acc_vf_pci_aer_reset_done,
.error_detected = vfio_pci_core_aer_err_detected,
};
--
2.51.2
next prev parent reply other threads:[~2025-11-20 12:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-20 12:36 [PATCH 0/6] vfio: Reset migration device state using dedicated callback Michał Winiarski
2025-11-20 12:36 ` [PATCH 1/6] vfio: Introduce .migration_reset_state() callback Michał Winiarski
2025-11-21 7:13 ` Tian, Kevin
2025-11-24 21:29 ` Winiarski, Michal
2025-11-21 18:16 ` Alex Williamson
2025-11-24 21:44 ` Michał Winiarski
2025-11-20 12:36 ` Michał Winiarski [this message]
2025-11-20 12:36 ` [PATCH 3/6] vfio/pds: Use " Michał Winiarski
2025-11-20 12:36 ` [PATCH 4/6] vfio/qat: " Michał Winiarski
2025-11-20 12:36 ` [PATCH 5/6] vfio/mlx5: " Michał Winiarski
2025-11-20 12:36 ` [PATCH 6/6] vfio/virtio: " Michał Winiarski
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=20251120123647.3522082-3-michal.winiarski@intel.com \
--to=michal.winiarski@intel.com \
--cc=alex@shazbot.org \
--cc=brett.creeley@amd.com \
--cc=giovanni.cabiddu@intel.com \
--cc=jgg@ziepe.ca \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liulongfang@huawei.com \
--cc=qat-linux@intel.com \
--cc=skolothumtho@nvidia.com \
--cc=virtualization@lists.linux.dev \
--cc=yishaih@nvidia.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
all inboxes | Powered by JetHome®