dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Enable FLR for IDXD halt
@ 2024-07-05 18:15 Fenghua Yu
  2024-07-05 18:15 ` [PATCH 1/5] dmaengine: idxd: Add idxd_pci_probe_alloc() helper Fenghua Yu
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Fenghua Yu @ 2024-07-05 18:15 UTC (permalink / raw)
  To: Vinod Koul, Dave Jiang; +Cc: dmaengine, linux-kernel, Fenghua Yu

When IDXD device hits hardware errors, it enters halt state and triggers
an interrupt to IDXD driver. Currently IDXD driver just prints an error
message in the interrupt handler.

A better way to handle the interrupt is to do Function Level Reset (FLR)
and recover the device's hardware and software configurations to its
previous working state. The device and software can continue to run after
the interrupt.

This series enables this FLR handling for IDXD device whose WQs are all
user type. FLR handling for IDXD device whose WQs are kernel type
will be implemented in a future series.

Fenghua Yu (5):
  dmaengine: idxd: Add idxd_pci_probe_alloc() helper
  dmaengine: idxd: Binding and unbinding IDXD device and driver
  dmaengine: idxd: Add idxd_device_config_save() and
    idxd_device_config_restore() helpers
  dmaengine: idxd: Refactor halt handler
  dmaengine: idxd: Enable Function Level Reset (FLR) for halt

 drivers/dma/idxd/idxd.h |  13 ++
 drivers/dma/idxd/init.c | 478 ++++++++++++++++++++++++++++++++++++----
 drivers/dma/idxd/irq.c  |  85 ++++---
 3 files changed, 506 insertions(+), 70 deletions(-)

-- 
2.37.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/5] dmaengine: idxd: Add idxd_pci_probe_alloc() helper
  2024-07-05 18:15 [PATCH 0/5] Enable FLR for IDXD halt Fenghua Yu
@ 2024-07-05 18:15 ` Fenghua Yu
  2024-07-05 18:15 ` [PATCH 2/5] dmaengine: idxd: Binding and unbinding IDXD device and driver Fenghua Yu
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Fenghua Yu @ 2024-07-05 18:15 UTC (permalink / raw)
  To: Vinod Koul, Dave Jiang; +Cc: dmaengine, linux-kernel, Fenghua Yu

Add the idxd_pci_probe_alloc() helper to probe IDXD PCI device with or
without allocating and setting idxd software values.

The idxd_pci_probe() function is refactored to call this helper and
always probe the IDXD device with allocating and setting the software
values.

This helper will be called later in the Function Level Reset (FLR)
process without modifying the idxd software data.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
---
 drivers/dma/idxd/idxd.h |   2 +
 drivers/dma/idxd/init.c | 102 ++++++++++++++++++++++++----------------
 2 files changed, 64 insertions(+), 40 deletions(-)

diff --git a/drivers/dma/idxd/idxd.h b/drivers/dma/idxd/idxd.h
index 868b724a3b75..03f099518ec1 100644
--- a/drivers/dma/idxd/idxd.h
+++ b/drivers/dma/idxd/idxd.h
@@ -745,6 +745,8 @@ void idxd_unmask_error_interrupts(struct idxd_device *idxd);
 
 /* device control */
 int idxd_device_drv_probe(struct idxd_dev *idxd_dev);
+int idxd_pci_probe_alloc(struct idxd_device *idxd, struct pci_dev *pdev,
+			 const struct pci_device_id *id);
 void idxd_device_drv_remove(struct idxd_dev *idxd_dev);
 int idxd_drv_enable_wq(struct idxd_wq *wq);
 void idxd_drv_disable_wq(struct idxd_wq *wq);
diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
index a7295943fa22..068103b40223 100644
--- a/drivers/dma/idxd/init.c
+++ b/drivers/dma/idxd/init.c
@@ -716,67 +716,84 @@ static void idxd_cleanup(struct idxd_device *idxd)
 		idxd_disable_sva(idxd->pdev);
 }
 
-static int idxd_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
+/*
+ * Probe idxd PCI device.
+ * If idxd is not given, need to allocate idxd and set up its data.
+ *
+ * If idxd is given, idxd was allocated and setup already. Just need to
+ * configure device without re-allocating and re-configuring idxd data.
+ * This is useful for recovering from FLR.
+ */
+int idxd_pci_probe_alloc(struct idxd_device *idxd, struct pci_dev *pdev,
+			 const struct pci_device_id *id)
 {
-	struct device *dev = &pdev->dev;
-	struct idxd_device *idxd;
-	struct idxd_driver_data *data = (struct idxd_driver_data *)id->driver_data;
+	bool alloc_idxd = idxd ? false : true;
+	struct idxd_driver_data *data;
+	struct device *dev;
 	int rc;
 
+	pdev = idxd ? idxd->pdev : pdev;
+	dev = &pdev->dev;
+	data = id ? (struct idxd_driver_data *)id->driver_data : NULL;
 	rc = pci_enable_device(pdev);
 	if (rc)
 		return rc;
 
-	dev_dbg(dev, "Alloc IDXD context\n");
-	idxd = idxd_alloc(pdev, data);
-	if (!idxd) {
-		rc = -ENOMEM;
-		goto err_idxd_alloc;
-	}
+	if (alloc_idxd) {
+		dev_dbg(dev, "Alloc IDXD context\n");
+		idxd = idxd_alloc(pdev, data);
+		if (!idxd) {
+			rc = -ENOMEM;
+			goto err_idxd_alloc;
+		}
 
-	dev_dbg(dev, "Mapping BARs\n");
-	idxd->reg_base = pci_iomap(pdev, IDXD_MMIO_BAR, 0);
-	if (!idxd->reg_base) {
-		rc = -ENOMEM;
-		goto err_iomap;
-	}
+		dev_dbg(dev, "Mapping BARs\n");
+		idxd->reg_base = pci_iomap(pdev, IDXD_MMIO_BAR, 0);
+		if (!idxd->reg_base) {
+			rc = -ENOMEM;
+			goto err_iomap;
+		}
 
-	dev_dbg(dev, "Set DMA masks\n");
-	rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
-	if (rc)
-		goto err;
+		dev_dbg(dev, "Set DMA masks\n");
+		rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+		if (rc)
+			goto err;
+	}
 
 	dev_dbg(dev, "Set PCI master\n");
 	pci_set_master(pdev);
 	pci_set_drvdata(pdev, idxd);
 
-	idxd->hw.version = ioread32(idxd->reg_base + IDXD_VER_OFFSET);
-	rc = idxd_probe(idxd);
-	if (rc) {
-		dev_err(dev, "Intel(R) IDXD DMA Engine init failed\n");
-		goto err;
-	}
+	if (alloc_idxd) {
+		idxd->hw.version = ioread32(idxd->reg_base + IDXD_VER_OFFSET);
+		rc = idxd_probe(idxd);
+		if (rc) {
+			dev_err(dev, "Intel(R) IDXD DMA Engine init failed\n");
+			goto err;
+		}
 
-	if (data->load_device_defaults) {
-		rc = data->load_device_defaults(idxd);
-		if (rc)
-			dev_warn(dev, "IDXD loading device defaults failed\n");
-	}
+		if (data->load_device_defaults) {
+			rc = data->load_device_defaults(idxd);
+			if (rc)
+				dev_warn(dev, "IDXD loading device defaults failed\n");
+		}
 
-	rc = idxd_register_devices(idxd);
-	if (rc) {
-		dev_err(dev, "IDXD sysfs setup failed\n");
-		goto err_dev_register;
-	}
+		rc = idxd_register_devices(idxd);
+		if (rc) {
+			dev_err(dev, "IDXD sysfs setup failed\n");
+			goto err_dev_register;
+		}
 
-	rc = idxd_device_init_debugfs(idxd);
-	if (rc)
-		dev_warn(dev, "IDXD debugfs failed to setup\n");
+		rc = idxd_device_init_debugfs(idxd);
+		if (rc)
+			dev_warn(dev, "IDXD debugfs failed to setup\n");
+	}
 
 	dev_info(&pdev->dev, "Intel(R) Accelerator Device (v%x)\n",
 		 idxd->hw.version);
 
-	idxd->user_submission_safe = data->user_submission_safe;
+	if (data)
+		idxd->user_submission_safe = data->user_submission_safe;
 
 	return 0;
 
@@ -791,6 +808,11 @@ static int idxd_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	return rc;
 }
 
+static int idxd_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
+{
+	return idxd_pci_probe_alloc(NULL, pdev, id);
+}
+
 void idxd_wqs_quiesce(struct idxd_device *idxd)
 {
 	struct idxd_wq *wq;
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/5] dmaengine: idxd: Binding and unbinding IDXD device and driver
  2024-07-05 18:15 [PATCH 0/5] Enable FLR for IDXD halt Fenghua Yu
  2024-07-05 18:15 ` [PATCH 1/5] dmaengine: idxd: Add idxd_pci_probe_alloc() helper Fenghua Yu
@ 2024-07-05 18:15 ` Fenghua Yu
  2024-07-05 18:15 ` [PATCH 3/5] dmaengine: idxd: Add idxd_device_config_save() and idxd_device_config_restore() helpers Fenghua Yu
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Fenghua Yu @ 2024-07-05 18:15 UTC (permalink / raw)
  To: Vinod Koul, Dave Jiang; +Cc: dmaengine, linux-kernel, Fenghua Yu

Add idxd_bind() and idxd_unbind() helpers to bind and unbind the IDXD
device and driver.

These helpers will be called during Function Level Reset (FLR) processing.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
---
 drivers/dma/idxd/init.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
index 068103b40223..a6d8097b2dcf 100644
--- a/drivers/dma/idxd/init.c
+++ b/drivers/dma/idxd/init.c
@@ -716,6 +716,39 @@ static void idxd_cleanup(struct idxd_device *idxd)
 		idxd_disable_sva(idxd->pdev);
 }
 
+/*
+ * Attach IDXD device to IDXD driver.
+ */
+static int idxd_bind(struct device_driver *drv, const char *buf)
+{
+	const struct bus_type *bus = drv->bus;
+	struct device *dev;
+	int err = -ENODEV;
+
+	dev = bus_find_device_by_name(bus, NULL, buf);
+	if (dev)
+		err = device_driver_attach(drv, dev);
+
+	put_device(dev);
+
+	return err;
+}
+
+/*
+ * Detach IDXD device from driver.
+ */
+static void idxd_unbind(struct device_driver *drv, const char *buf)
+{
+	const struct bus_type *bus = drv->bus;
+	struct device *dev;
+
+	dev = bus_find_device_by_name(bus, NULL, buf);
+	if (dev && dev->driver == drv)
+		device_release_driver(dev);
+
+	put_device(dev);
+}
+
 /*
  * Probe idxd PCI device.
  * If idxd is not given, need to allocate idxd and set up its data.
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/5] dmaengine: idxd: Add idxd_device_config_save() and idxd_device_config_restore() helpers
  2024-07-05 18:15 [PATCH 0/5] Enable FLR for IDXD halt Fenghua Yu
  2024-07-05 18:15 ` [PATCH 1/5] dmaengine: idxd: Add idxd_pci_probe_alloc() helper Fenghua Yu
  2024-07-05 18:15 ` [PATCH 2/5] dmaengine: idxd: Binding and unbinding IDXD device and driver Fenghua Yu
@ 2024-07-05 18:15 ` Fenghua Yu
  2024-07-08 19:10   ` Dave Jiang
  2024-07-05 18:15 ` [PATCH 4/5] dmaengine: idxd: Refactor halt handler Fenghua Yu
  2024-07-05 18:15 ` [PATCH 5/5] dmaengine: idxd: Enable Function Level Reset (FLR) for halt Fenghua Yu
  4 siblings, 1 reply; 7+ messages in thread
From: Fenghua Yu @ 2024-07-05 18:15 UTC (permalink / raw)
  To: Vinod Koul, Dave Jiang; +Cc: dmaengine, linux-kernel, Fenghua Yu

Add the helpers to save and restore IDXD device configurations.

These helpers will be called during Function Level Reset (FLR) processing.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
---
 drivers/dma/idxd/idxd.h |  11 ++
 drivers/dma/idxd/init.c | 224 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 235 insertions(+)

diff --git a/drivers/dma/idxd/idxd.h b/drivers/dma/idxd/idxd.h
index 03f099518ec1..4f3e98720b45 100644
--- a/drivers/dma/idxd/idxd.h
+++ b/drivers/dma/idxd/idxd.h
@@ -377,6 +377,17 @@ struct idxd_device {
 	struct dentry *dbgfs_evl_file;
 
 	bool user_submission_safe;
+
+	struct idxd_saved_states *idxd_saved;
+};
+
+struct idxd_saved_states {
+	struct idxd_device saved_idxd;
+	struct idxd_evl saved_evl;
+	struct idxd_engine **saved_engines;
+	struct idxd_wq **saved_wqs;
+	struct idxd_group **saved_groups;
+	unsigned long *saved_wq_enable_map;
 };
 
 static inline unsigned int evl_ent_size(struct idxd_device *idxd)
diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
index a6d8097b2dcf..bb03d8cc5d32 100644
--- a/drivers/dma/idxd/init.c
+++ b/drivers/dma/idxd/init.c
@@ -749,6 +749,230 @@ static void idxd_unbind(struct device_driver *drv, const char *buf)
 	put_device(dev);
 }
 
+/* Free allocated saved wq enable map after saving wq configs. */
+static void free_saved_wq_enable_map(unsigned long *map)
+{
+	bitmap_free(map);
+}
+
+DEFINE_FREE(free_saved_wq_enable_map, unsigned long *, if (!IS_ERR_OR_NULL(_T))
+	    free_saved_wq_enable_map(_T))
+
+#define idxd_free_saved_configs(saved_configs, count)	\
+	do {						\
+		int i;					\
+							\
+		for (i = 0; i < (count); i++)		\
+			kfree(saved_configs[i]);	\
+	} while (0)
+
+/*
+ * Save IDXD device configurations including engines, groups, wqs etc.
+ * The saved configurations can be restored when needed.
+ */
+static int idxd_device_config_save(struct idxd_device *idxd,
+				   struct idxd_saved_states *idxd_saved)
+{
+	struct device *dev = &idxd->pdev->dev;
+	int i;
+
+	memcpy(&idxd_saved->saved_idxd, idxd, sizeof(*idxd));
+
+	if (idxd->evl) {
+		memcpy(&idxd_saved->saved_evl, idxd->evl,
+		       sizeof(struct idxd_evl));
+	}
+
+	struct idxd_group **saved_groups __free(kfree) =
+			kcalloc_node(idxd->max_groups,
+				     sizeof(struct idxd_group *),
+				     GFP_KERNEL, dev_to_node(dev));
+	if (!saved_groups)
+		return -ENOMEM;
+
+	for (i = 0; i < idxd->max_groups; i++) {
+		struct idxd_group *saved_group __free(kfree) =
+			kzalloc_node(sizeof(*saved_group), GFP_KERNEL,
+				     dev_to_node(dev));
+
+		if (!saved_group) {
+			idxd_free_saved_configs(saved_groups, i);
+
+			return -ENOMEM;
+		}
+
+		memcpy(saved_group, idxd->groups[i], sizeof(*saved_group));
+		saved_groups[i] = no_free_ptr(saved_group);
+	}
+
+	struct idxd_engine **saved_engines =
+			kcalloc_node(idxd->max_engines,
+				     sizeof(struct idxd_engine *),
+				     GFP_KERNEL, dev_to_node(dev));
+	if (!saved_engines) {
+		/* Free saved groups */
+		idxd_free_saved_configs(saved_groups, idxd->max_groups);
+
+		return -ENOMEM;
+	}
+	for (i = 0; i < idxd->max_engines; i++) {
+		struct idxd_engine *saved_engine __free(kfree) =
+				kzalloc_node(sizeof(*saved_engine), GFP_KERNEL,
+					     dev_to_node(dev));
+		if (!saved_engine) {
+			/* Free saved groups and engines */
+			idxd_free_saved_configs(saved_groups, idxd->max_groups);
+			idxd_free_saved_configs(saved_engines, i);
+
+			return -ENOMEM;
+		}
+
+		memcpy(saved_engine, idxd->engines[i], sizeof(*saved_engine));
+		saved_engines[i] = no_free_ptr(saved_engine);
+	}
+
+	unsigned long *saved_wq_enable_map __free(free_saved_wq_enable_map) =
+			bitmap_zalloc_node(idxd->max_wqs, GFP_KERNEL,
+					   dev_to_node(dev));
+	if (!saved_wq_enable_map) {
+		/* Free saved groups and engines */
+		idxd_free_saved_configs(saved_groups, idxd->max_groups);
+		idxd_free_saved_configs(saved_engines, idxd->max_engines);
+
+		return -ENOMEM;
+	}
+
+	bitmap_copy(saved_wq_enable_map, idxd->wq_enable_map, idxd->max_wqs);
+
+	struct idxd_wq **saved_wqs __free(kfree) =
+			kcalloc_node(idxd->max_wqs, sizeof(struct idxd_wq *),
+				     GFP_KERNEL, dev_to_node(dev));
+	if (!saved_wqs) {
+		/* Free saved groups and engines */
+		idxd_free_saved_configs(saved_groups, idxd->max_groups);
+		idxd_free_saved_configs(saved_engines, idxd->max_engines);
+
+		return -ENOMEM;
+	}
+
+	for (i = 0; i < idxd->max_wqs; i++) {
+		struct idxd_wq *saved_wq __free(kfree) =
+			kzalloc_node(sizeof(*saved_wq), GFP_KERNEL,
+				     dev_to_node(dev));
+		struct idxd_wq *wq;
+
+		if (!saved_wq) {
+			/* Free saved groups, engines, and wqs */
+			idxd_free_saved_configs(saved_groups, idxd->max_groups);
+			idxd_free_saved_configs(saved_engines,
+						idxd->max_engines);
+			idxd_free_saved_configs(saved_wqs, i);
+
+			return -ENOMEM;
+		}
+
+		if (!test_bit(i, saved_wq_enable_map))
+			continue;
+
+		wq = idxd->wqs[i];
+		mutex_lock(&wq->wq_lock);
+		memcpy(saved_wq, wq, sizeof(*saved_wq));
+		saved_wqs[i] = no_free_ptr(saved_wq);
+		mutex_unlock(&wq->wq_lock);
+	}
+
+	/* Save configurations */
+	idxd_saved->saved_groups = no_free_ptr(saved_groups);
+	idxd_saved->saved_engines = no_free_ptr(saved_engines);
+	idxd_saved->saved_wq_enable_map = no_free_ptr(saved_wq_enable_map);
+	idxd_saved->saved_wqs = no_free_ptr(saved_wqs);
+
+	return 0;
+}
+
+/*
+ * Restore IDXD device configurations including engines, groups, wqs etc
+ * that were saved before.
+ */
+static void idxd_device_config_restore(struct idxd_device *idxd,
+				       struct idxd_saved_states *idxd_saved)
+{
+	struct idxd_evl *saved_evl = &idxd_saved->saved_evl;
+	int i;
+
+	idxd->rdbuf_limit = idxd_saved->saved_idxd.rdbuf_limit;
+
+	if (saved_evl)
+		idxd->evl->size = saved_evl->size;
+
+	for (i = 0; i < idxd->max_groups; i++) {
+		struct idxd_group *saved_group, *group;
+
+		saved_group = idxd_saved->saved_groups[i];
+		group = idxd->groups[i];
+
+		group->rdbufs_allowed = saved_group->rdbufs_allowed;
+		group->rdbufs_reserved = saved_group->rdbufs_reserved;
+		group->tc_a = saved_group->tc_a;
+		group->tc_b = saved_group->tc_b;
+		group->use_rdbuf_limit = saved_group->use_rdbuf_limit;
+
+		kfree(saved_group);
+	}
+	kfree(idxd_saved->saved_groups);
+
+	for (i = 0; i < idxd->max_engines; i++) {
+		struct idxd_engine *saved_engine, *engine;
+
+		saved_engine = idxd_saved->saved_engines[i];
+		engine = idxd->engines[i];
+
+		engine->group = saved_engine->group;
+
+		kfree(saved_engine);
+	}
+	kfree(idxd_saved->saved_engines);
+
+	bitmap_copy(idxd->wq_enable_map, idxd_saved->saved_wq_enable_map,
+		    idxd->max_wqs);
+	bitmap_free(idxd_saved->saved_wq_enable_map);
+
+	for (i = 0; i < idxd->max_wqs; i++) {
+		struct idxd_wq *saved_wq, *wq;
+		size_t len;
+
+		if (!test_bit(i, idxd->wq_enable_map))
+			continue;
+
+		saved_wq = idxd_saved->saved_wqs[i];
+		wq = idxd->wqs[i];
+
+		mutex_lock(&wq->wq_lock);
+
+		wq->group = saved_wq->group;
+		wq->flags = saved_wq->flags;
+		wq->threshold = saved_wq->threshold;
+		wq->size = saved_wq->size;
+		wq->priority = saved_wq->priority;
+		wq->type = saved_wq->type;
+		len = strlen(saved_wq->name) + 1;
+		strscpy(wq->name, saved_wq->name, len);
+		wq->max_xfer_bytes = saved_wq->max_xfer_bytes;
+		wq->max_batch_size = saved_wq->max_batch_size;
+		wq->enqcmds_retries = saved_wq->enqcmds_retries;
+		wq->descs = saved_wq->descs;
+		wq->idxd_chan = saved_wq->idxd_chan;
+		len = strlen(saved_wq->driver_name) + 1;
+		strscpy(wq->driver_name, saved_wq->driver_name, len);
+
+		mutex_unlock(&wq->wq_lock);
+
+		kfree(saved_wq);
+	}
+
+	kfree(idxd_saved->saved_wqs);
+}
+
 /*
  * Probe idxd PCI device.
  * If idxd is not given, need to allocate idxd and set up its data.
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/5] dmaengine: idxd: Refactor halt handler
  2024-07-05 18:15 [PATCH 0/5] Enable FLR for IDXD halt Fenghua Yu
                   ` (2 preceding siblings ...)
  2024-07-05 18:15 ` [PATCH 3/5] dmaengine: idxd: Add idxd_device_config_save() and idxd_device_config_restore() helpers Fenghua Yu
@ 2024-07-05 18:15 ` Fenghua Yu
  2024-07-05 18:15 ` [PATCH 5/5] dmaengine: idxd: Enable Function Level Reset (FLR) for halt Fenghua Yu
  4 siblings, 0 replies; 7+ messages in thread
From: Fenghua Yu @ 2024-07-05 18:15 UTC (permalink / raw)
  To: Vinod Koul, Dave Jiang; +Cc: dmaengine, linux-kernel, Fenghua Yu

Define a halt handling helper idxd_halt(). Refactor the halt interrupt
handler to call the helper. This will simplify the Function Level
Reset (FLR) code.

No functional change.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
---
 drivers/dma/idxd/irq.c | 63 +++++++++++++++++++++---------------------
 1 file changed, 31 insertions(+), 32 deletions(-)

diff --git a/drivers/dma/idxd/irq.c b/drivers/dma/idxd/irq.c
index fc049c9c9892..a46e58b756a5 100644
--- a/drivers/dma/idxd/irq.c
+++ b/drivers/dma/idxd/irq.c
@@ -383,15 +383,43 @@ static void process_evl_entries(struct idxd_device *idxd)
 	mutex_unlock(&evl->lock);
 }
 
+static irqreturn_t idxd_halt(struct idxd_device *idxd)
+{
+	union gensts_reg gensts;
+
+	gensts.bits = ioread32(idxd->reg_base + IDXD_GENSTATS_OFFSET);
+	if (gensts.state == IDXD_DEVICE_STATE_HALT) {
+		idxd->state = IDXD_DEV_HALTED;
+		if (gensts.reset_type == IDXD_DEVICE_RESET_SOFTWARE) {
+			/*
+			 * If we need a software reset, we will throw the work
+			 * on a system workqueue in order to allow interrupts
+			 * for the device command completions.
+			 */
+			INIT_WORK(&idxd->work, idxd_device_reinit);
+			queue_work(idxd->wq, &idxd->work);
+		} else {
+			idxd->state = IDXD_DEV_HALTED;
+			idxd_wqs_quiesce(idxd);
+			idxd_wqs_unmap_portal(idxd);
+			idxd_device_clear_state(idxd);
+			dev_err(&idxd->pdev->dev,
+				"idxd halted, need %s.\n",
+				gensts.reset_type == IDXD_DEVICE_RESET_FLR ?
+				"FLR" : "system reset");
+		}
+	}
+
+	return IRQ_HANDLED;
+}
+
 irqreturn_t idxd_misc_thread(int vec, void *data)
 {
 	struct idxd_irq_entry *irq_entry = data;
 	struct idxd_device *idxd = ie_to_idxd(irq_entry);
 	struct device *dev = &idxd->pdev->dev;
-	union gensts_reg gensts;
 	u32 val = 0;
 	int i;
-	bool err = false;
 	u32 cause;
 
 	cause = ioread32(idxd->reg_base + IDXD_INTCAUSE_OFFSET);
@@ -401,7 +429,7 @@ irqreturn_t idxd_misc_thread(int vec, void *data)
 	iowrite32(cause, idxd->reg_base + IDXD_INTCAUSE_OFFSET);
 
 	if (cause & IDXD_INTC_HALT_STATE)
-		goto halt;
+		return idxd_halt(idxd);
 
 	if (cause & IDXD_INTC_ERR) {
 		spin_lock(&idxd->dev_lock);
@@ -435,7 +463,6 @@ irqreturn_t idxd_misc_thread(int vec, void *data)
 		for (i = 0; i < 4; i++)
 			dev_warn_ratelimited(dev, "err[%d]: %#16.16llx\n",
 					     i, idxd->sw_err.bits[i]);
-		err = true;
 	}
 
 	if (cause & IDXD_INTC_INT_HANDLE_REVOKED) {
@@ -480,34 +507,6 @@ irqreturn_t idxd_misc_thread(int vec, void *data)
 		dev_warn_once(dev, "Unexpected interrupt cause bits set: %#x\n",
 			      val);
 
-	if (!err)
-		goto out;
-
-halt:
-	gensts.bits = ioread32(idxd->reg_base + IDXD_GENSTATS_OFFSET);
-	if (gensts.state == IDXD_DEVICE_STATE_HALT) {
-		idxd->state = IDXD_DEV_HALTED;
-		if (gensts.reset_type == IDXD_DEVICE_RESET_SOFTWARE) {
-			/*
-			 * If we need a software reset, we will throw the work
-			 * on a system workqueue in order to allow interrupts
-			 * for the device command completions.
-			 */
-			INIT_WORK(&idxd->work, idxd_device_reinit);
-			queue_work(idxd->wq, &idxd->work);
-		} else {
-			idxd->state = IDXD_DEV_HALTED;
-			idxd_wqs_quiesce(idxd);
-			idxd_wqs_unmap_portal(idxd);
-			idxd_device_clear_state(idxd);
-			dev_err(&idxd->pdev->dev,
-				"idxd halted, need %s.\n",
-				gensts.reset_type == IDXD_DEVICE_RESET_FLR ?
-				"FLR" : "system reset");
-		}
-	}
-
-out:
 	return IRQ_HANDLED;
 }
 
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/5] dmaengine: idxd: Enable Function Level Reset (FLR) for halt
  2024-07-05 18:15 [PATCH 0/5] Enable FLR for IDXD halt Fenghua Yu
                   ` (3 preceding siblings ...)
  2024-07-05 18:15 ` [PATCH 4/5] dmaengine: idxd: Refactor halt handler Fenghua Yu
@ 2024-07-05 18:15 ` Fenghua Yu
  4 siblings, 0 replies; 7+ messages in thread
From: Fenghua Yu @ 2024-07-05 18:15 UTC (permalink / raw)
  To: Vinod Koul, Dave Jiang; +Cc: dmaengine, linux-kernel, Fenghua Yu

When DSA/IAA device hits a fatal error, the device enters a halt state.
The driver can reset the device depending on Reset Type required by
hardware to recover the device.

Supported Reset Types are:
0: Reset Device command
1: Function Level Reset (FLR)
2: Warm reset
3: Cold reset

Currently, the driver only supports Reset Type 0.

This patch adds support for FLR recovery Type 1. Before issuing a PCIe
FLR command, IDXD device and WQ states are saved. After the FLR command
execution, the device is recovered to its previous states, allowing
the user can continue using the device.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
---
 drivers/dma/idxd/init.c | 123 ++++++++++++++++++++++++++++++++++++++++
 drivers/dma/idxd/irq.c  |  28 ++++++++-
 2 files changed, 148 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
index bb03d8cc5d32..87f2c6a878c6 100644
--- a/drivers/dma/idxd/init.c
+++ b/drivers/dma/idxd/init.c
@@ -973,6 +973,118 @@ static void idxd_device_config_restore(struct idxd_device *idxd,
 	kfree(idxd_saved->saved_wqs);
 }
 
+static void idxd_reset_prepare(struct pci_dev *pdev)
+{
+	struct idxd_device *idxd = pci_get_drvdata(pdev);
+	struct device *dev = &idxd->pdev->dev;
+	const char *idxd_name;
+	int rc;
+
+	dev = &idxd->pdev->dev;
+	idxd_name = dev_name(idxd_confdev(idxd));
+
+	struct idxd_saved_states *idxd_saved __free(kfree) =
+			kzalloc_node(sizeof(*idxd_saved), GFP_KERNEL,
+				     dev_to_node(&pdev->dev));
+	if (!idxd_saved) {
+		dev_err(dev, "HALT: no memory\n");
+
+		return;
+	}
+
+	/* Save IDXD configurations. */
+	rc = idxd_device_config_save(idxd, idxd_saved);
+	if (rc < 0) {
+		dev_err(dev, "HALT: cannot save %s configs\n", idxd_name);
+
+		return;
+	}
+
+	idxd->idxd_saved = no_free_ptr(idxd_saved);
+
+	/* Save PCI device state. */
+	pci_save_state(idxd->pdev);
+}
+
+static void idxd_reset_done(struct pci_dev *pdev)
+{
+	struct idxd_device *idxd = pci_get_drvdata(pdev);
+	const char *idxd_name;
+	struct device *dev;
+	int rc, i;
+
+	if (!idxd->idxd_saved)
+		return;
+
+	dev = &idxd->pdev->dev;
+	idxd_name = dev_name(idxd_confdev(idxd));
+
+	/* Restore PCI device state. */
+	pci_restore_state(idxd->pdev);
+
+	/* Unbind idxd device from driver. */
+	idxd_unbind(&idxd_drv.drv, idxd_name);
+
+	/*
+	 * Probe PCI device without allocating or changing
+	 * idxd software data which keeps the same as before FLR.
+	 */
+	idxd_pci_probe_alloc(idxd, NULL, NULL);
+
+	/* Restore IDXD configurations. */
+	idxd_device_config_restore(idxd, idxd->idxd_saved);
+
+	/* Re-configure IDXD device if allowed. */
+	if (test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags)) {
+		rc = idxd_device_config(idxd);
+		if (rc < 0) {
+			dev_err(dev, "HALT: %s config fails\n", idxd_name);
+			goto out;
+		}
+	}
+
+	/* Bind IDXD device to driver. */
+	rc = idxd_bind(&idxd_drv.drv, idxd_name);
+	if (rc < 0) {
+		dev_err(dev, "HALT: binding %s to driver fails\n", idxd_name);
+		goto out;
+	}
+
+	/* Bind enabled wq in the IDXD device to driver. */
+	for (i = 0; i < idxd->max_wqs; i++) {
+		if (test_bit(i, idxd->wq_enable_map)) {
+			struct idxd_wq *wq = idxd->wqs[i];
+			char wq_name[32];
+
+			wq->state = IDXD_WQ_DISABLED;
+			sprintf(wq_name, "wq%d.%d", idxd->id, wq->id);
+			/*
+			 * Bind to user driver depending on wq type.
+			 *
+			 * Currently only support user type WQ. Will support
+			 * kernel type WQ in the future.
+			 */
+			if (wq->type == IDXD_WQT_USER)
+				rc = idxd_bind(&idxd_user_drv.drv, wq_name);
+			else
+				rc = -EINVAL;
+			if (rc < 0) {
+				clear_bit(i, idxd->wq_enable_map);
+				dev_err(dev,
+					"HALT: unable to re-enable wq %s\n",
+					dev_name(wq_confdev(wq)));
+			}
+		}
+	}
+out:
+	kfree(idxd->idxd_saved);
+}
+
+static const struct pci_error_handlers idxd_error_handler = {
+	.reset_prepare	= idxd_reset_prepare,
+	.reset_done	= idxd_reset_done,
+};
+
 /*
  * Probe idxd PCI device.
  * If idxd is not given, need to allocate idxd and set up its data.
@@ -1046,6 +1158,16 @@ int idxd_pci_probe_alloc(struct idxd_device *idxd, struct pci_dev *pdev,
 			dev_warn(dev, "IDXD debugfs failed to setup\n");
 	}
 
+	if (!alloc_idxd) {
+		/* Release interrupts in the IDXD device. */
+		idxd_cleanup_interrupts(idxd);
+
+		/* Re-enable interrupts in the IDXD device. */
+		rc = idxd_setup_interrupts(idxd);
+		if (rc)
+			dev_warn(dev, "IDXD interrupts failed to setup\n");
+	}
+
 	dev_info(&pdev->dev, "Intel(R) Accelerator Device (v%x)\n",
 		 idxd->hw.version);
 
@@ -1136,6 +1258,7 @@ static struct pci_driver idxd_pci_driver = {
 	.probe		= idxd_pci_probe,
 	.remove		= idxd_remove,
 	.shutdown	= idxd_shutdown,
+	.err_handler	= &idxd_error_handler,
 };
 
 static int __init idxd_init_module(void)
diff --git a/drivers/dma/idxd/irq.c b/drivers/dma/idxd/irq.c
index a46e58b756a5..1107db3ce0a3 100644
--- a/drivers/dma/idxd/irq.c
+++ b/drivers/dma/idxd/irq.c
@@ -383,6 +383,20 @@ static void process_evl_entries(struct idxd_device *idxd)
 	mutex_unlock(&evl->lock);
 }
 
+static void idxd_device_flr(struct work_struct *work)
+{
+	struct idxd_device *idxd = container_of(work, struct idxd_device, work);
+	int rc;
+
+	/*
+	 * IDXD device requires a Function Level Reset (FLR).
+	 * pci_reset_function() will reset the device with FLR.
+	 */
+	rc = pci_reset_function(idxd->pdev);
+	if (rc)
+		dev_err(&idxd->pdev->dev, "FLR failed\n");
+}
+
 static irqreturn_t idxd_halt(struct idxd_device *idxd)
 {
 	union gensts_reg gensts;
@@ -398,15 +412,23 @@ static irqreturn_t idxd_halt(struct idxd_device *idxd)
 			 */
 			INIT_WORK(&idxd->work, idxd_device_reinit);
 			queue_work(idxd->wq, &idxd->work);
+		} else if (gensts.reset_type == IDXD_DEVICE_RESET_FLR) {
+			idxd->state = IDXD_DEV_HALTED;
+			idxd_mask_error_interrupts(idxd);
+			dev_dbg(&idxd->pdev->dev,
+				"idxd halted, doing FLR. After FLR, configs are restored\n");
+			INIT_WORK(&idxd->work, idxd_device_flr);
+			queue_work(idxd->wq, &idxd->work);
+
 		} else {
 			idxd->state = IDXD_DEV_HALTED;
 			idxd_wqs_quiesce(idxd);
 			idxd_wqs_unmap_portal(idxd);
 			idxd_device_clear_state(idxd);
 			dev_err(&idxd->pdev->dev,
-				"idxd halted, need %s.\n",
-				gensts.reset_type == IDXD_DEVICE_RESET_FLR ?
-				"FLR" : "system reset");
+				"idxd halted, need system reset");
+
+			return -ENXIO;
 		}
 	}
 
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/5] dmaengine: idxd: Add idxd_device_config_save() and idxd_device_config_restore() helpers
  2024-07-05 18:15 ` [PATCH 3/5] dmaengine: idxd: Add idxd_device_config_save() and idxd_device_config_restore() helpers Fenghua Yu
@ 2024-07-08 19:10   ` Dave Jiang
  0 siblings, 0 replies; 7+ messages in thread
From: Dave Jiang @ 2024-07-08 19:10 UTC (permalink / raw)
  To: Fenghua Yu, Vinod Koul; +Cc: dmaengine, linux-kernel



On 7/5/24 11:15 AM, Fenghua Yu wrote:
> Add the helpers to save and restore IDXD device configurations.
> 
> These helpers will be called during Function Level Reset (FLR) processing.
> 
> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
> ---
>  drivers/dma/idxd/idxd.h |  11 ++
>  drivers/dma/idxd/init.c | 224 ++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 235 insertions(+)
> 
> diff --git a/drivers/dma/idxd/idxd.h b/drivers/dma/idxd/idxd.h
> index 03f099518ec1..4f3e98720b45 100644
> --- a/drivers/dma/idxd/idxd.h
> +++ b/drivers/dma/idxd/idxd.h
> @@ -377,6 +377,17 @@ struct idxd_device {
>  	struct dentry *dbgfs_evl_file;
>  
>  	bool user_submission_safe;
> +
> +	struct idxd_saved_states *idxd_saved;
> +};
> +
> +struct idxd_saved_states {
> +	struct idxd_device saved_idxd;
> +	struct idxd_evl saved_evl;
> +	struct idxd_engine **saved_engines;
> +	struct idxd_wq **saved_wqs;
> +	struct idxd_group **saved_groups;
> +	unsigned long *saved_wq_enable_map;
>  };
>  
>  static inline unsigned int evl_ent_size(struct idxd_device *idxd)
> diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
> index a6d8097b2dcf..bb03d8cc5d32 100644
> --- a/drivers/dma/idxd/init.c
> +++ b/drivers/dma/idxd/init.c
> @@ -749,6 +749,230 @@ static void idxd_unbind(struct device_driver *drv, const char *buf)
>  	put_device(dev);
>  }
>  
> +/* Free allocated saved wq enable map after saving wq configs. */
> +static void free_saved_wq_enable_map(unsigned long *map)
> +{
> +	bitmap_free(map);
> +}
> +
> +DEFINE_FREE(free_saved_wq_enable_map, unsigned long *, if (!IS_ERR_OR_NULL(_T))
> +	    free_saved_wq_enable_map(_T))
> +
> +#define idxd_free_saved_configs(saved_configs, count)	\
> +	do {						\
> +		int i;					\
> +							\
> +		for (i = 0; i < (count); i++)		\
> +			kfree(saved_configs[i]);	\
> +	} while (0)
> +
> +/*
> + * Save IDXD device configurations including engines, groups, wqs etc.
> + * The saved configurations can be restored when needed.
> + */
> +static int idxd_device_config_save(struct idxd_device *idxd,
> +				   struct idxd_saved_states *idxd_saved)
> +{
> +	struct device *dev = &idxd->pdev->dev;
> +	int i;
> +
> +	memcpy(&idxd_saved->saved_idxd, idxd, sizeof(*idxd));
> +
> +	if (idxd->evl) {
> +		memcpy(&idxd_saved->saved_evl, idxd->evl,
> +		       sizeof(struct idxd_evl));
> +	}
> +
> +	struct idxd_group **saved_groups __free(kfree) =
> +			kcalloc_node(idxd->max_groups,
> +				     sizeof(struct idxd_group *),
> +				     GFP_KERNEL, dev_to_node(dev));
> +	if (!saved_groups)
> +		return -ENOMEM;
> +
> +	for (i = 0; i < idxd->max_groups; i++) {
> +		struct idxd_group *saved_group __free(kfree) =
> +			kzalloc_node(sizeof(*saved_group), GFP_KERNEL,
> +				     dev_to_node(dev));
> +
> +		if (!saved_group) {
> +			idxd_free_saved_configs(saved_groups, i);
> +
> +			return -ENOMEM;
> +		}
> +
> +		memcpy(saved_group, idxd->groups[i], sizeof(*saved_group));
> +		saved_groups[i] = no_free_ptr(saved_group);
> +	}
> +
> +	struct idxd_engine **saved_engines =
> +			kcalloc_node(idxd->max_engines,
> +				     sizeof(struct idxd_engine *),
> +				     GFP_KERNEL, dev_to_node(dev));
> +	if (!saved_engines) {
> +		/* Free saved groups */
> +		idxd_free_saved_configs(saved_groups, idxd->max_groups);

I would put a wrapper function around idxd_device_config_save(). If error is returned from idxd_device_config_save(), then you can just call the cleanup function and free everything allocated. That way you don't need to keep calling idxd_free_saved_configs() for every error exit point.

DJ

> +
> +		return -ENOMEM;
> +	}
> +	for (i = 0; i < idxd->max_engines; i++) {
> +		struct idxd_engine *saved_engine __free(kfree) =
> +				kzalloc_node(sizeof(*saved_engine), GFP_KERNEL,
> +					     dev_to_node(dev));
> +		if (!saved_engine) {
> +			/* Free saved groups and engines */
> +			idxd_free_saved_configs(saved_groups, idxd->max_groups);
> +			idxd_free_saved_configs(saved_engines, i);
> +
> +			return -ENOMEM;
> +		}
> +
> +		memcpy(saved_engine, idxd->engines[i], sizeof(*saved_engine));
> +		saved_engines[i] = no_free_ptr(saved_engine);
> +	}
> +
> +	unsigned long *saved_wq_enable_map __free(free_saved_wq_enable_map) =
> +			bitmap_zalloc_node(idxd->max_wqs, GFP_KERNEL,
> +					   dev_to_node(dev));
> +	if (!saved_wq_enable_map) {
> +		/* Free saved groups and engines */
> +		idxd_free_saved_configs(saved_groups, idxd->max_groups);
> +		idxd_free_saved_configs(saved_engines, idxd->max_engines);
> +
> +		return -ENOMEM;
> +	}
> +
> +	bitmap_copy(saved_wq_enable_map, idxd->wq_enable_map, idxd->max_wqs);
> +
> +	struct idxd_wq **saved_wqs __free(kfree) =
> +			kcalloc_node(idxd->max_wqs, sizeof(struct idxd_wq *),
> +				     GFP_KERNEL, dev_to_node(dev));
> +	if (!saved_wqs) {
> +		/* Free saved groups and engines */
> +		idxd_free_saved_configs(saved_groups, idxd->max_groups);
> +		idxd_free_saved_configs(saved_engines, idxd->max_engines);
> +
> +		return -ENOMEM;
> +	}
> +
> +	for (i = 0; i < idxd->max_wqs; i++) {
> +		struct idxd_wq *saved_wq __free(kfree) =
> +			kzalloc_node(sizeof(*saved_wq), GFP_KERNEL,
> +				     dev_to_node(dev));
> +		struct idxd_wq *wq;
> +
> +		if (!saved_wq) {
> +			/* Free saved groups, engines, and wqs */
> +			idxd_free_saved_configs(saved_groups, idxd->max_groups);
> +			idxd_free_saved_configs(saved_engines,
> +						idxd->max_engines);
> +			idxd_free_saved_configs(saved_wqs, i);
> +
> +			return -ENOMEM;
> +		}
> +
> +		if (!test_bit(i, saved_wq_enable_map))
> +			continue;
> +
> +		wq = idxd->wqs[i];
> +		mutex_lock(&wq->wq_lock);
> +		memcpy(saved_wq, wq, sizeof(*saved_wq));
> +		saved_wqs[i] = no_free_ptr(saved_wq);
> +		mutex_unlock(&wq->wq_lock);
> +	}
> +
> +	/* Save configurations */
> +	idxd_saved->saved_groups = no_free_ptr(saved_groups);
> +	idxd_saved->saved_engines = no_free_ptr(saved_engines);
> +	idxd_saved->saved_wq_enable_map = no_free_ptr(saved_wq_enable_map);
> +	idxd_saved->saved_wqs = no_free_ptr(saved_wqs);
> +
> +	return 0;
> +}
> +
> +/*
> + * Restore IDXD device configurations including engines, groups, wqs etc
> + * that were saved before.
> + */
> +static void idxd_device_config_restore(struct idxd_device *idxd,
> +				       struct idxd_saved_states *idxd_saved)
> +{
> +	struct idxd_evl *saved_evl = &idxd_saved->saved_evl;
> +	int i;
> +
> +	idxd->rdbuf_limit = idxd_saved->saved_idxd.rdbuf_limit;
> +
> +	if (saved_evl)
> +		idxd->evl->size = saved_evl->size;
> +
> +	for (i = 0; i < idxd->max_groups; i++) {
> +		struct idxd_group *saved_group, *group;
> +
> +		saved_group = idxd_saved->saved_groups[i];
> +		group = idxd->groups[i];
> +
> +		group->rdbufs_allowed = saved_group->rdbufs_allowed;
> +		group->rdbufs_reserved = saved_group->rdbufs_reserved;
> +		group->tc_a = saved_group->tc_a;
> +		group->tc_b = saved_group->tc_b;
> +		group->use_rdbuf_limit = saved_group->use_rdbuf_limit;
> +
> +		kfree(saved_group);
> +	}
> +	kfree(idxd_saved->saved_groups);
> +
> +	for (i = 0; i < idxd->max_engines; i++) {
> +		struct idxd_engine *saved_engine, *engine;
> +
> +		saved_engine = idxd_saved->saved_engines[i];
> +		engine = idxd->engines[i];
> +
> +		engine->group = saved_engine->group;
> +
> +		kfree(saved_engine);
> +	}
> +	kfree(idxd_saved->saved_engines);
> +
> +	bitmap_copy(idxd->wq_enable_map, idxd_saved->saved_wq_enable_map,
> +		    idxd->max_wqs);
> +	bitmap_free(idxd_saved->saved_wq_enable_map);
> +
> +	for (i = 0; i < idxd->max_wqs; i++) {
> +		struct idxd_wq *saved_wq, *wq;
> +		size_t len;
> +
> +		if (!test_bit(i, idxd->wq_enable_map))
> +			continue;
> +
> +		saved_wq = idxd_saved->saved_wqs[i];
> +		wq = idxd->wqs[i];
> +
> +		mutex_lock(&wq->wq_lock);
> +
> +		wq->group = saved_wq->group;
> +		wq->flags = saved_wq->flags;
> +		wq->threshold = saved_wq->threshold;
> +		wq->size = saved_wq->size;
> +		wq->priority = saved_wq->priority;
> +		wq->type = saved_wq->type;
> +		len = strlen(saved_wq->name) + 1;
> +		strscpy(wq->name, saved_wq->name, len);
> +		wq->max_xfer_bytes = saved_wq->max_xfer_bytes;
> +		wq->max_batch_size = saved_wq->max_batch_size;
> +		wq->enqcmds_retries = saved_wq->enqcmds_retries;
> +		wq->descs = saved_wq->descs;
> +		wq->idxd_chan = saved_wq->idxd_chan;
> +		len = strlen(saved_wq->driver_name) + 1;
> +		strscpy(wq->driver_name, saved_wq->driver_name, len);
> +
> +		mutex_unlock(&wq->wq_lock);
> +
> +		kfree(saved_wq);
> +	}
> +
> +	kfree(idxd_saved->saved_wqs);
> +}
> +
>  /*
>   * Probe idxd PCI device.
>   * If idxd is not given, need to allocate idxd and set up its data.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-07-08 19:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-05 18:15 [PATCH 0/5] Enable FLR for IDXD halt Fenghua Yu
2024-07-05 18:15 ` [PATCH 1/5] dmaengine: idxd: Add idxd_pci_probe_alloc() helper Fenghua Yu
2024-07-05 18:15 ` [PATCH 2/5] dmaengine: idxd: Binding and unbinding IDXD device and driver Fenghua Yu
2024-07-05 18:15 ` [PATCH 3/5] dmaengine: idxd: Add idxd_device_config_save() and idxd_device_config_restore() helpers Fenghua Yu
2024-07-08 19:10   ` Dave Jiang
2024-07-05 18:15 ` [PATCH 4/5] dmaengine: idxd: Refactor halt handler Fenghua Yu
2024-07-05 18:15 ` [PATCH 5/5] dmaengine: idxd: Enable Function Level Reset (FLR) for halt Fenghua Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).