mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 3/6] vfio/pds: Use .migration_reset_state() callback
Date: Thu, 20 Nov 2025 13:36:44 +0100	[thread overview]
Message-ID: <20251120123647.3522082-4-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/pds/pci_drv.c  | 10 ----------
 drivers/vfio/pci/pds/vfio_dev.c | 12 ++++++++++++
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/vfio/pci/pds/pci_drv.c b/drivers/vfio/pci/pds/pci_drv.c
index 4923f18231263..4cf3d2e3767a6 100644
--- a/drivers/vfio/pci/pds/pci_drv.c
+++ b/drivers/vfio/pci/pds/pci_drv.c
@@ -162,17 +162,7 @@ static const struct pci_device_id pds_vfio_pci_table[] = {
 };
 MODULE_DEVICE_TABLE(pci, pds_vfio_pci_table);
 
-static void pds_vfio_pci_aer_reset_done(struct pci_dev *pdev)
-{
-	struct pds_vfio_pci_device *pds_vfio = pds_vfio_pci_drvdata(pdev);
-
-	mutex_lock(&pds_vfio->state_mutex);
-	pds_vfio_reset(pds_vfio, VFIO_DEVICE_STATE_RUNNING);
-	mutex_unlock(&pds_vfio->state_mutex);
-}
-
 static const struct pci_error_handlers pds_vfio_pci_err_handlers = {
-	.reset_done = pds_vfio_pci_aer_reset_done,
 	.error_detected = vfio_pci_core_aer_err_detected,
 };
 
diff --git a/drivers/vfio/pci/pds/vfio_dev.c b/drivers/vfio/pci/pds/vfio_dev.c
index f3ccb0008f675..6b29641b5819b 100644
--- a/drivers/vfio/pci/pds/vfio_dev.c
+++ b/drivers/vfio/pci/pds/vfio_dev.c
@@ -101,9 +101,21 @@ static int pds_vfio_get_device_state_size(struct vfio_device *vdev,
 	return 0;
 }
 
+static void pds_vfio_reset_device_state(struct vfio_device *vdev)
+{
+	struct pds_vfio_pci_device *pds_vfio =
+		container_of(vdev, struct pds_vfio_pci_device,
+			     vfio_coredev.vdev);
+
+	mutex_lock(&pds_vfio->state_mutex);
+	pds_vfio_reset(pds_vfio, VFIO_DEVICE_STATE_RUNNING);
+	mutex_unlock(&pds_vfio->state_mutex);
+}
+
 static const struct vfio_migration_ops pds_vfio_lm_ops = {
 	.migration_set_state = pds_vfio_set_device_state,
 	.migration_get_state = pds_vfio_get_device_state,
+	.migration_reset_state = pds_vfio_reset_device_state,
 	.migration_get_data_size = pds_vfio_get_device_state_size
 };
 
-- 
2.51.2


  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 ` [PATCH 2/6] hisi_acc_vfio_pci: Use " Michał Winiarski
2025-11-20 12:36 ` Michał Winiarski [this message]
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-4-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®