Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/8] drm/xe/device_sysfs: switch over to devm
@ 2024-04-29 12:14 Matthew Auld
  2024-04-29 12:14 ` [PATCH 2/8] drm/xe: covert sysfs " Matthew Auld
                   ` (10 more replies)
  0 siblings, 11 replies; 28+ messages in thread
From: Matthew Auld @ 2024-04-29 12:14 UTC (permalink / raw)
  To: intel-xe; +Cc: Rodrigo Vivi

When hotunplugging the device we currently hit:

kernfs: can not remove 'vram_d3cold_threshold', no directory

Due to directory already being removed. Using drmm for sysfs device
stuff like vram_d3cold_threshold doesn't really make sense when you
consider hot unplugging of the pci device. In such a case the device is
removed however the drmm release action will only fire once the driver
instance can be released, which can be long after the device has already
been hotunplugged. Rather use devm which is directly tied to the device
and should be called when it is removed.

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1432
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/xe/xe_device_sysfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_device_sysfs.c b/drivers/gpu/drm/xe/xe_device_sysfs.c
index 21677b8cd977..7375937934fa 100644
--- a/drivers/gpu/drm/xe/xe_device_sysfs.c
+++ b/drivers/gpu/drm/xe/xe_device_sysfs.c
@@ -69,7 +69,7 @@ vram_d3cold_threshold_store(struct device *dev, struct device_attribute *attr,
 
 static DEVICE_ATTR_RW(vram_d3cold_threshold);
 
-static void xe_device_sysfs_fini(struct drm_device *drm, void *arg)
+static void xe_device_sysfs_fini(void *arg)
 {
 	struct xe_device *xe = arg;
 
@@ -85,5 +85,5 @@ int xe_device_sysfs_init(struct xe_device *xe)
 	if (ret)
 		return ret;
 
-	return drmm_add_action_or_reset(&xe->drm, xe_device_sysfs_fini, xe);
+	return devm_add_action_or_reset(dev, xe_device_sysfs_fini, xe);
 }
-- 
2.44.0


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

* [PATCH 2/8] drm/xe: covert sysfs over to devm
  2024-04-29 12:14 [PATCH 1/8] drm/xe/device_sysfs: switch over to devm Matthew Auld
@ 2024-04-29 12:14 ` Matthew Auld
  2024-04-29 13:28   ` Rodrigo Vivi
  2024-05-06  8:07   ` [PATCH 2/8] drm/xe: covert sysfs over to devm Andrzej Hajda
  2024-04-29 12:14 ` [PATCH 3/8] drm/xe/ggtt: use drm_dev_enter to mark device section Matthew Auld
                   ` (9 subsequent siblings)
  10 siblings, 2 replies; 28+ messages in thread
From: Matthew Auld @ 2024-04-29 12:14 UTC (permalink / raw)
  To: intel-xe; +Cc: Rodrigo Vivi

Hotunplugging the device seems to result in stuff like:

kobject_add_internal failed for tile0 with -EEXIST, don't try to
register things with the same name in the same directory.

We only remove the sysfs as part of drmm, however that is tied to the
lifetime of the driver instance and not the device underneath. Attempt
to fix by using devm for all of the remaining sysfs stuff related to the
device.

Closes: https://gitlab.freedesktop.org/dt srm/xe/kernel/-/issues/1667
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/xe/xe_gt_ccs_mode.c           |  4 ++--
 drivers/gpu/drm/xe/xe_gt_freq.c               |  4 ++--
 drivers/gpu/drm/xe/xe_gt_idle.c               |  4 ++--
 drivers/gpu/drm/xe/xe_gt_sysfs.c              |  4 ++--
 drivers/gpu/drm/xe/xe_gt_throttle_sysfs.c     |  4 ++--
 drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c | 12 ++++++------
 drivers/gpu/drm/xe/xe_tile_sysfs.c            |  4 ++--
 drivers/gpu/drm/xe/xe_vram_freq.c             |  4 ++--
 8 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_gt_ccs_mode.c b/drivers/gpu/drm/xe/xe_gt_ccs_mode.c
index 396aeb5b9924..890da8870b0d 100644
--- a/drivers/gpu/drm/xe/xe_gt_ccs_mode.c
+++ b/drivers/gpu/drm/xe/xe_gt_ccs_mode.c
@@ -150,7 +150,7 @@ static const struct attribute *gt_ccs_mode_attrs[] = {
 	NULL,
 };
 
-static void xe_gt_ccs_mode_sysfs_fini(struct drm_device *drm, void *arg)
+static void xe_gt_ccs_mode_sysfs_fini(void *arg)
 {
 	struct xe_gt *gt = arg;
 
@@ -182,5 +182,5 @@ int xe_gt_ccs_mode_sysfs_init(struct xe_gt *gt)
 	if (err)
 		return err;
 
-	return drmm_add_action_or_reset(&xe->drm, xe_gt_ccs_mode_sysfs_fini, gt);
+	return devm_add_action_or_reset(xe->drm.dev, xe_gt_ccs_mode_sysfs_fini, gt);
 }
diff --git a/drivers/gpu/drm/xe/xe_gt_freq.c b/drivers/gpu/drm/xe/xe_gt_freq.c
index 855de40e40ea..e0305942644c 100644
--- a/drivers/gpu/drm/xe/xe_gt_freq.c
+++ b/drivers/gpu/drm/xe/xe_gt_freq.c
@@ -209,7 +209,7 @@ static const struct attribute *freq_attrs[] = {
 	NULL
 };
 
-static void freq_fini(struct drm_device *drm, void *arg)
+static void freq_fini(void *arg)
 {
 	struct kobject *kobj = arg;
 
@@ -237,7 +237,7 @@ int xe_gt_freq_init(struct xe_gt *gt)
 	if (!gt->freq)
 		return -ENOMEM;
 
-	err = drmm_add_action_or_reset(&xe->drm, freq_fini, gt->freq);
+	err = devm_add_action(xe->drm.dev, freq_fini, gt->freq);
 	if (err)
 		return err;
 
diff --git a/drivers/gpu/drm/xe/xe_gt_idle.c b/drivers/gpu/drm/xe/xe_gt_idle.c
index 8fc0f3f6ecc5..9e907033f32b 100644
--- a/drivers/gpu/drm/xe/xe_gt_idle.c
+++ b/drivers/gpu/drm/xe/xe_gt_idle.c
@@ -144,7 +144,7 @@ static const struct attribute *gt_idle_attrs[] = {
 	NULL,
 };
 
-static void gt_idle_sysfs_fini(struct drm_device *drm, void *arg)
+static void gt_idle_sysfs_fini(void *arg)
 {
 	struct kobject *kobj = arg;
 
@@ -181,7 +181,7 @@ int xe_gt_idle_sysfs_init(struct xe_gt_idle *gtidle)
 		return err;
 	}
 
-	return drmm_add_action_or_reset(&xe->drm, gt_idle_sysfs_fini, kobj);
+	return devm_add_action_or_reset(xe->drm.dev, gt_idle_sysfs_fini, kobj);
 }
 
 void xe_gt_idle_enable_c6(struct xe_gt *gt)
diff --git a/drivers/gpu/drm/xe/xe_gt_sysfs.c b/drivers/gpu/drm/xe/xe_gt_sysfs.c
index 1e5971072bc8..a05c3699e8b9 100644
--- a/drivers/gpu/drm/xe/xe_gt_sysfs.c
+++ b/drivers/gpu/drm/xe/xe_gt_sysfs.c
@@ -22,7 +22,7 @@ static const struct kobj_type xe_gt_sysfs_kobj_type = {
 	.sysfs_ops = &kobj_sysfs_ops,
 };
 
-static void gt_sysfs_fini(struct drm_device *drm, void *arg)
+static void gt_sysfs_fini(void *arg)
 {
 	struct xe_gt *gt = arg;
 
@@ -51,5 +51,5 @@ int xe_gt_sysfs_init(struct xe_gt *gt)
 
 	gt->sysfs = &kg->base;
 
-	return drmm_add_action_or_reset(&xe->drm, gt_sysfs_fini, gt);
+	return devm_add_action(xe->drm.dev, gt_sysfs_fini, gt);
 }
diff --git a/drivers/gpu/drm/xe/xe_gt_throttle_sysfs.c b/drivers/gpu/drm/xe/xe_gt_throttle_sysfs.c
index fbe21a8599ca..c9e04151286d 100644
--- a/drivers/gpu/drm/xe/xe_gt_throttle_sysfs.c
+++ b/drivers/gpu/drm/xe/xe_gt_throttle_sysfs.c
@@ -229,7 +229,7 @@ static const struct attribute_group throttle_group_attrs = {
 	.attrs = throttle_attrs,
 };
 
-static void gt_throttle_sysfs_fini(struct drm_device *drm, void *arg)
+static void gt_throttle_sysfs_fini(void *arg)
 {
 	struct xe_gt *gt = arg;
 
@@ -245,5 +245,5 @@ int xe_gt_throttle_sysfs_init(struct xe_gt *gt)
 	if (err)
 		return err;
 
-	return drmm_add_action_or_reset(&xe->drm, gt_throttle_sysfs_fini, gt);
+	return devm_add_action_or_reset(xe->drm.dev, gt_throttle_sysfs_fini, gt);
 }
diff --git a/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c b/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c
index 844ec68cbbb8..258078a6b461 100644
--- a/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c
+++ b/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c
@@ -492,7 +492,7 @@ static const struct attribute * const files[] = {
 	NULL
 };
 
-static void kobj_xe_hw_engine_class_fini(struct drm_device *drm, void *arg)
+static void kobj_xe_hw_engine_class_fini(void *arg)
 {
 	struct kobject *kobj = arg;
 
@@ -517,7 +517,7 @@ kobj_xe_hw_engine_class(struct xe_device *xe, struct kobject *parent, const char
 	}
 	keclass->xe = xe;
 
-	err = drmm_add_action_or_reset(&xe->drm, kobj_xe_hw_engine_class_fini,
+	err = devm_add_action_or_reset(xe->drm.dev, kobj_xe_hw_engine_class_fini,
 				       &keclass->base);
 	if (err)
 		return NULL;
@@ -525,7 +525,7 @@ kobj_xe_hw_engine_class(struct xe_device *xe, struct kobject *parent, const char
 	return keclass;
 }
 
-static void hw_engine_class_defaults_fini(struct drm_device *drm, void *arg)
+static void hw_engine_class_defaults_fini(void *arg)
 {
 	struct kobject *kobj = arg;
 
@@ -552,7 +552,7 @@ static int xe_add_hw_engine_class_defaults(struct xe_device *xe,
 	if (err)
 		goto err_object;
 
-	return drmm_add_action_or_reset(&xe->drm, hw_engine_class_defaults_fini, kobj);
+	return devm_add_action_or_reset(xe->drm.dev, hw_engine_class_defaults_fini, kobj);
 
 err_object:
 	kobject_put(kobj);
@@ -611,7 +611,7 @@ static const struct kobj_type xe_hw_engine_sysfs_kobj_type = {
 	.sysfs_ops = &xe_hw_engine_class_sysfs_ops,
 };
 
-static void hw_engine_class_sysfs_fini(struct drm_device *drm, void *arg)
+static void hw_engine_class_sysfs_fini(void *arg)
 {
 	struct kobject *kobj = arg;
 
@@ -698,7 +698,7 @@ int xe_hw_engine_class_sysfs_init(struct xe_gt *gt)
 			goto err_object;
 	}
 
-	return drmm_add_action_or_reset(&xe->drm, hw_engine_class_sysfs_fini, kobj);
+	return devm_add_action_or_reset(xe->drm.dev, hw_engine_class_sysfs_fini, kobj);
 
 err_object:
 	kobject_put(kobj);
diff --git a/drivers/gpu/drm/xe/xe_tile_sysfs.c b/drivers/gpu/drm/xe/xe_tile_sysfs.c
index 64661403afcd..b804234a6551 100644
--- a/drivers/gpu/drm/xe/xe_tile_sysfs.c
+++ b/drivers/gpu/drm/xe/xe_tile_sysfs.c
@@ -22,7 +22,7 @@ static const struct kobj_type xe_tile_sysfs_kobj_type = {
 	.sysfs_ops = &kobj_sysfs_ops,
 };
 
-static void tile_sysfs_fini(struct drm_device *drm, void *arg)
+static void tile_sysfs_fini(void *arg)
 {
 	struct xe_tile *tile = arg;
 
@@ -55,5 +55,5 @@ int xe_tile_sysfs_init(struct xe_tile *tile)
 	if (err)
 		return err;
 
-	return drmm_add_action_or_reset(&xe->drm, tile_sysfs_fini, tile);
+	return devm_add_action_or_reset(xe->drm.dev, tile_sysfs_fini, tile);
 }
diff --git a/drivers/gpu/drm/xe/xe_vram_freq.c b/drivers/gpu/drm/xe/xe_vram_freq.c
index 3e21ddc6e60c..99ff95e408e0 100644
--- a/drivers/gpu/drm/xe/xe_vram_freq.c
+++ b/drivers/gpu/drm/xe/xe_vram_freq.c
@@ -87,7 +87,7 @@ static const struct attribute_group freq_group_attrs = {
 	.attrs = freq_attrs,
 };
 
-static void vram_freq_sysfs_fini(struct drm_device *drm, void *arg)
+static void vram_freq_sysfs_fini(void *arg)
 {
 	struct kobject *kobj = arg;
 
@@ -122,5 +122,5 @@ int xe_vram_freq_sysfs_init(struct xe_tile *tile)
 		return err;
 	}
 
-	return drmm_add_action_or_reset(&xe->drm, vram_freq_sysfs_fini, kobj);
+	return devm_add_action_or_reset(xe->drm.dev, vram_freq_sysfs_fini, kobj);
 }
-- 
2.44.0


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

* [PATCH 3/8] drm/xe/ggtt: use drm_dev_enter to mark device section
  2024-04-29 12:14 [PATCH 1/8] drm/xe/device_sysfs: switch over to devm Matthew Auld
  2024-04-29 12:14 ` [PATCH 2/8] drm/xe: covert sysfs " Matthew Auld
@ 2024-04-29 12:14 ` Matthew Auld
  2024-05-06  8:42   ` Andrzej Hajda
  2024-04-29 12:14 ` [PATCH 4/8] drm/xe/guc: move guc_fini over to devm Matthew Auld
                   ` (8 subsequent siblings)
  10 siblings, 1 reply; 28+ messages in thread
From: Matthew Auld @ 2024-04-29 12:14 UTC (permalink / raw)
  To: intel-xe; +Cc: Rodrigo Vivi

Device can be hotunplugged before we start destroying gem objects. In
such a case don't touch the GGTT entries, trigger any invalidations or
mess around with rpm.  This should already be taken care of when
removing the device, we just need to take care of dealing with the
software state, like removing the mm node.

References: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1717
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/xe/xe_ggtt.c | 34 ++++++++++++++++++++++------------
 1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c
index 0d541f55b4fc..7c05d3f7e1a4 100644
--- a/drivers/gpu/drm/xe/xe_ggtt.c
+++ b/drivers/gpu/drm/xe/xe_ggtt.c
@@ -8,6 +8,7 @@
 #include <linux/io-64-nonatomic-lo-hi.h>
 #include <linux/sizes.h>
 
+#include <drm/drm_drv.h>
 #include <drm/drm_managed.h>
 #include <drm/i915_drm.h>
 
@@ -433,18 +434,27 @@ int xe_ggtt_insert_bo(struct xe_ggtt *ggtt, struct xe_bo *bo)
 void xe_ggtt_remove_node(struct xe_ggtt *ggtt, struct drm_mm_node *node,
 			 bool invalidate)
 {
-	xe_pm_runtime_get_noresume(tile_to_xe(ggtt->tile));
-
-	mutex_lock(&ggtt->lock);
-	xe_ggtt_clear(ggtt, node->start, node->size);
-	drm_mm_remove_node(node);
-	node->size = 0;
-	mutex_unlock(&ggtt->lock);
-
-	if (invalidate)
-		xe_ggtt_invalidate(ggtt);
-
-	xe_pm_runtime_put(tile_to_xe(ggtt->tile));
+	struct xe_device *xe = tile_to_xe(ggtt->tile);
+	int idx;
+
+	if (drm_dev_enter(&xe->drm, &idx)) {
+		xe_pm_runtime_get_noresume(xe);
+		mutex_lock(&ggtt->lock);
+		xe_ggtt_clear(ggtt, node->start, node->size);
+		drm_mm_remove_node(node);
+		node->size = 0;
+		mutex_unlock(&ggtt->lock);
+
+		if (invalidate)
+			xe_ggtt_invalidate(ggtt);
+		xe_pm_runtime_put(xe);
+		drm_dev_exit(idx);
+	} else {
+		mutex_lock(&ggtt->lock);
+		drm_mm_remove_node(node);
+		node->size = 0;
+		mutex_unlock(&ggtt->lock);
+	}
 }
 
 void xe_ggtt_remove_bo(struct xe_ggtt *ggtt, struct xe_bo *bo)
-- 
2.44.0


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

* [PATCH 4/8] drm/xe/guc: move guc_fini over to devm
  2024-04-29 12:14 [PATCH 1/8] drm/xe/device_sysfs: switch over to devm Matthew Auld
  2024-04-29 12:14 ` [PATCH 2/8] drm/xe: covert sysfs " Matthew Auld
  2024-04-29 12:14 ` [PATCH 3/8] drm/xe/ggtt: use drm_dev_enter to mark device section Matthew Auld
@ 2024-04-29 12:14 ` Matthew Auld
  2024-05-06  9:03   ` Andrzej Hajda
  2024-04-29 12:14 ` [PATCH 5/8] drm/xe/guc_pc: move pc_fini " Matthew Auld
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 28+ messages in thread
From: Matthew Auld @ 2024-04-29 12:14 UTC (permalink / raw)
  To: intel-xe; +Cc: Rodrigo Vivi

Make sure to actually call this when the device is removed. Currently we
only trigger it when the driver instance goes away, but that doesn't
work too well with hotunplug, since device can be removed and re-probed
with a new driver instance, where the guc_fini() is called too late.
Move the fini over to devm to ensure this is called when device is
removed.

References: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1717
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/xe/xe_guc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
index 0c9938e0ab8c..97e2b62df486 100644
--- a/drivers/gpu/drm/xe/xe_guc.c
+++ b/drivers/gpu/drm/xe/xe_guc.c
@@ -239,7 +239,7 @@ static void guc_write_params(struct xe_guc *guc)
 		xe_mmio_write32(gt, SOFT_SCRATCH(1 + i), guc->params[i]);
 }
 
-static void guc_fini(struct drm_device *drm, void *arg)
+static void guc_fini(void *arg)
 {
 	struct xe_guc *guc = arg;
 	struct xe_gt *gt = guc_to_gt(guc);
@@ -323,7 +323,7 @@ int xe_guc_init(struct xe_guc *guc)
 	if (ret)
 		goto out;
 
-	ret = drmm_add_action_or_reset(&xe->drm, guc_fini, guc);
+	ret = devm_add_action_or_reset(xe->drm.dev, guc_fini, guc);
 	if (ret)
 		goto out;
 
-- 
2.44.0


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

* [PATCH 5/8] drm/xe/guc_pc: move pc_fini to devm
  2024-04-29 12:14 [PATCH 1/8] drm/xe/device_sysfs: switch over to devm Matthew Auld
                   ` (2 preceding siblings ...)
  2024-04-29 12:14 ` [PATCH 4/8] drm/xe/guc: move guc_fini over to devm Matthew Auld
@ 2024-04-29 12:14 ` Matthew Auld
  2024-05-06  9:11   ` Andrzej Hajda
  2024-04-29 12:14 ` [PATCH 6/8] drm/xe/irq: move irq_uninstall over " Matthew Auld
                   ` (6 subsequent siblings)
  10 siblings, 1 reply; 28+ messages in thread
From: Matthew Auld @ 2024-04-29 12:14 UTC (permalink / raw)
  To: intel-xe; +Cc: Rodrigo Vivi

Here we are touching the HW/GuC and presumably this should happen when
the device is removed. Currently if you hotunplug the device this is
skipped if there is already open driver instance.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/xe/xe_guc_pc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_guc_pc.c b/drivers/gpu/drm/xe/xe_guc_pc.c
index 8fc757900ed1..8c855afd1144 100644
--- a/drivers/gpu/drm/xe/xe_guc_pc.c
+++ b/drivers/gpu/drm/xe/xe_guc_pc.c
@@ -892,7 +892,7 @@ int xe_guc_pc_stop(struct xe_guc_pc *pc)
  * @drm: DRM device
  * @arg: opaque pointer that should point to Xe_GuC_PC instance
  */
-static void xe_guc_pc_fini(struct drm_device *drm, void *arg)
+static void xe_guc_pc_fini(void *arg)
 {
 	struct xe_guc_pc *pc = arg;
 	struct xe_device *xe = pc_to_xe(pc);
@@ -940,5 +940,5 @@ int xe_guc_pc_init(struct xe_guc_pc *pc)
 
 	pc->bo = bo;
 
-	return drmm_add_action_or_reset(&xe->drm, xe_guc_pc_fini, pc);
+	return devm_add_action_or_reset(xe->drm.dev, xe_guc_pc_fini, pc);
 }
-- 
2.44.0


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

* [PATCH 6/8] drm/xe/irq: move irq_uninstall over to devm
  2024-04-29 12:14 [PATCH 1/8] drm/xe/device_sysfs: switch over to devm Matthew Auld
                   ` (3 preceding siblings ...)
  2024-04-29 12:14 ` [PATCH 5/8] drm/xe/guc_pc: move pc_fini " Matthew Auld
@ 2024-04-29 12:14 ` Matthew Auld
  2024-05-06  9:12   ` Andrzej Hajda
  2024-04-29 12:14 ` [PATCH 7/8] drm/xe/device: move flr " Matthew Auld
                   ` (5 subsequent siblings)
  10 siblings, 1 reply; 28+ messages in thread
From: Matthew Auld @ 2024-04-29 12:14 UTC (permalink / raw)
  To: intel-xe; +Cc: Rodrigo Vivi

Makes sense to trigger this when the device is removed.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/xe/xe_irq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_irq.c b/drivers/gpu/drm/xe/xe_irq.c
index 996806353171..8ee3c300c5e4 100644
--- a/drivers/gpu/drm/xe/xe_irq.c
+++ b/drivers/gpu/drm/xe/xe_irq.c
@@ -663,7 +663,7 @@ static irq_handler_t xe_irq_handler(struct xe_device *xe)
 		return xelp_irq_handler;
 }
 
-static void irq_uninstall(struct drm_device *drm, void *arg)
+static void irq_uninstall(void *arg)
 {
 	struct xe_device *xe = arg;
 	struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
@@ -723,7 +723,7 @@ int xe_irq_install(struct xe_device *xe)
 
 	xe_irq_postinstall(xe);
 
-	err = drmm_add_action_or_reset(&xe->drm, irq_uninstall, xe);
+	err = devm_add_action_or_reset(xe->drm.dev, irq_uninstall, xe);
 	if (err)
 		goto free_irq_handler;
 
@@ -737,7 +737,7 @@ int xe_irq_install(struct xe_device *xe)
 
 void xe_irq_shutdown(struct xe_device *xe)
 {
-	irq_uninstall(&xe->drm, xe);
+	irq_uninstall(xe);
 }
 
 void xe_irq_suspend(struct xe_device *xe)
-- 
2.44.0


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

* [PATCH 7/8] drm/xe/device: move flr to devm
  2024-04-29 12:14 [PATCH 1/8] drm/xe/device_sysfs: switch over to devm Matthew Auld
                   ` (4 preceding siblings ...)
  2024-04-29 12:14 ` [PATCH 6/8] drm/xe/irq: move irq_uninstall over " Matthew Auld
@ 2024-04-29 12:14 ` Matthew Auld
  2024-05-06  9:12   ` Andrzej Hajda
  2024-04-29 12:14 ` [PATCH 8/8] drm/xe/device: move xe_device_sanitize over " Matthew Auld
                   ` (4 subsequent siblings)
  10 siblings, 1 reply; 28+ messages in thread
From: Matthew Auld @ 2024-04-29 12:14 UTC (permalink / raw)
  To: intel-xe; +Cc: Rodrigo Vivi

Should be called when driver is removed, not when this particular driver
instance is destroyed.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/xe/xe_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index b61f8356e23e..ba917e383f8f 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -387,7 +387,7 @@ static void xe_driver_flr(struct xe_device *xe)
 	xe_mmio_write32(gt, GU_DEBUG, DRIVERFLR_STATUS);
 }
 
-static void xe_driver_flr_fini(struct drm_device *drm, void *arg)
+static void xe_driver_flr_fini(void *arg)
 {
 	struct xe_device *xe = arg;
 
@@ -589,7 +589,7 @@ int xe_device_probe(struct xe_device *xe)
 	err = xe_devcoredump_init(xe);
 	if (err)
 		return err;
-	err = drmm_add_action_or_reset(&xe->drm, xe_driver_flr_fini, xe);
+	err = devm_add_action_or_reset(xe->drm.dev, xe_driver_flr_fini, xe);
 	if (err)
 		return err;
 
-- 
2.44.0


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

* [PATCH 8/8] drm/xe/device: move xe_device_sanitize over to devm
  2024-04-29 12:14 [PATCH 1/8] drm/xe/device_sysfs: switch over to devm Matthew Auld
                   ` (5 preceding siblings ...)
  2024-04-29 12:14 ` [PATCH 7/8] drm/xe/device: move flr " Matthew Auld
@ 2024-04-29 12:14 ` Matthew Auld
  2024-05-06 17:25   ` Andrzej Hajda
  2024-04-29 12:21 ` ✓ CI.Patch_applied: success for series starting with [1/8] drm/xe/device_sysfs: switch " Patchwork
                   ` (3 subsequent siblings)
  10 siblings, 1 reply; 28+ messages in thread
From: Matthew Auld @ 2024-04-29 12:14 UTC (permalink / raw)
  To: intel-xe; +Cc: Rodrigo Vivi

Disable GuC submission when removing the device.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/xe/xe_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index ba917e383f8f..8c3415d7635a 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -395,7 +395,7 @@ static void xe_driver_flr_fini(void *arg)
 		xe_driver_flr(xe);
 }
 
-static void xe_device_sanitize(struct drm_device *drm, void *arg)
+static void xe_device_sanitize(void *arg)
 {
 	struct xe_device *xe = arg;
 	struct xe_gt *gt;
@@ -661,7 +661,7 @@ int xe_device_probe(struct xe_device *xe)
 
 	xe_hwmon_register(xe);
 
-	return drmm_add_action_or_reset(&xe->drm, xe_device_sanitize, xe);
+	return devm_add_action_or_reset(xe->drm.dev, xe_device_sanitize, xe);
 
 err_fini_display:
 	xe_display_driver_remove(xe);
-- 
2.44.0


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

* ✓ CI.Patch_applied: success for series starting with [1/8] drm/xe/device_sysfs: switch over to devm
  2024-04-29 12:14 [PATCH 1/8] drm/xe/device_sysfs: switch over to devm Matthew Auld
                   ` (6 preceding siblings ...)
  2024-04-29 12:14 ` [PATCH 8/8] drm/xe/device: move xe_device_sanitize over " Matthew Auld
@ 2024-04-29 12:21 ` Patchwork
  2024-04-29 12:21 ` ✗ CI.checkpatch: warning " Patchwork
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 28+ messages in thread
From: Patchwork @ 2024-04-29 12:21 UTC (permalink / raw)
  To: Matthew Auld; +Cc: intel-xe

== Series Details ==

Series: series starting with [1/8] drm/xe/device_sysfs: switch over to devm
URL   : https://patchwork.freedesktop.org/series/133021/
State : success

== Summary ==

=== Applying kernel patches on branch 'drm-tip' with base: ===
Base commit: ea200da5ea98 drm-tip: 2024y-04m-29d-12h-11m-57s UTC integration manifest
=== git am output follows ===
Applying: drm/xe/device_sysfs: switch over to devm
Applying: drm/xe: covert sysfs over to devm
Applying: drm/xe/ggtt: use drm_dev_enter to mark device section
Applying: drm/xe/guc: move guc_fini over to devm
Applying: drm/xe/guc_pc: move pc_fini to devm
Applying: drm/xe/irq: move irq_uninstall over to devm
Applying: drm/xe/device: move flr to devm
Applying: drm/xe/device: move xe_device_sanitize over to devm



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

* ✗ CI.checkpatch: warning for series starting with [1/8] drm/xe/device_sysfs: switch over to devm
  2024-04-29 12:14 [PATCH 1/8] drm/xe/device_sysfs: switch over to devm Matthew Auld
                   ` (7 preceding siblings ...)
  2024-04-29 12:21 ` ✓ CI.Patch_applied: success for series starting with [1/8] drm/xe/device_sysfs: switch " Patchwork
@ 2024-04-29 12:21 ` Patchwork
  2024-04-29 12:22 ` ✓ CI.KUnit: success " Patchwork
  2024-05-06  8:04 ` [PATCH 1/8] " Andrzej Hajda
  10 siblings, 0 replies; 28+ messages in thread
From: Patchwork @ 2024-04-29 12:21 UTC (permalink / raw)
  To: Matthew Auld; +Cc: intel-xe

== Series Details ==

Series: series starting with [1/8] drm/xe/device_sysfs: switch over to devm
URL   : https://patchwork.freedesktop.org/series/133021/
State : warning

== Summary ==

+ KERNEL=/kernel
+ git clone https://gitlab.freedesktop.org/drm/maintainer-tools mt
Cloning into 'mt'...
warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/
+ git -C mt rev-list -n1 origin/master
0daf0be5bb95eb0a0e42275e00a0e42d8d8fd543
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit 9c18830bb4582f52be777a47965a188b000e9f09
Author: Matthew Auld <matthew.auld@intel.com>
Date:   Mon Apr 29 13:14:44 2024 +0100

    drm/xe/device: move xe_device_sanitize over to devm
    
    Disable GuC submission when removing the device.
    
    Signed-off-by: Matthew Auld <matthew.auld@intel.com>
    Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
+ /mt/dim checkpatch ea200da5ea9860ec9e7b772607760c19fdfdd2fc drm-intel
16661a9b028f drm/xe/device_sysfs: switch over to devm
2ca1b992b692 drm/xe: covert sysfs over to devm
9c5ec23bdf77 drm/xe/ggtt: use drm_dev_enter to mark device section
-:12: WARNING:COMMIT_LOG_USE_LINK: Unknown link reference 'References:', use 'Link:' or 'Closes:' instead
#12: 
References: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1717

total: 0 errors, 1 warnings, 0 checks, 46 lines checked
a81cd75e276a drm/xe/guc: move guc_fini over to devm
-:13: WARNING:COMMIT_LOG_USE_LINK: Unknown link reference 'References:', use 'Link:' or 'Closes:' instead
#13: 
References: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1717

total: 0 errors, 1 warnings, 0 checks, 16 lines checked
26d8a2e07397 drm/xe/guc_pc: move pc_fini to devm
92b581687e5c drm/xe/irq: move irq_uninstall over to devm
d78034329650 drm/xe/device: move flr to devm
9c18830bb458 drm/xe/device: move xe_device_sanitize over to devm



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

* ✓ CI.KUnit: success for series starting with [1/8] drm/xe/device_sysfs: switch over to devm
  2024-04-29 12:14 [PATCH 1/8] drm/xe/device_sysfs: switch over to devm Matthew Auld
                   ` (8 preceding siblings ...)
  2024-04-29 12:21 ` ✗ CI.checkpatch: warning " Patchwork
@ 2024-04-29 12:22 ` Patchwork
  2024-05-06  8:04 ` [PATCH 1/8] " Andrzej Hajda
  10 siblings, 0 replies; 28+ messages in thread
From: Patchwork @ 2024-04-29 12:22 UTC (permalink / raw)
  To: Matthew Auld; +Cc: intel-xe

== Series Details ==

Series: series starting with [1/8] drm/xe/device_sysfs: switch over to devm
URL   : https://patchwork.freedesktop.org/series/133021/
State : success

== Summary ==

+ trap cleanup EXIT
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/xe/.kunitconfig
[12:21:39] Configuring KUnit Kernel ...
Generating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
[12:21:43] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make ARCH=um O=.kunit --jobs=48
../arch/x86/um/user-offsets.c:17:6: warning: no previous prototype for ‘foo’ [-Wmissing-prototypes]
   17 | void foo(void)
      |      ^~~
In file included from ../arch/um/kernel/asm-offsets.c:1:
../arch/x86/um/shared/sysdep/kernel-offsets.h:9:6: warning: no previous prototype for ‘foo’ [-Wmissing-prototypes]
    9 | void foo(void)
      |      ^~~
../arch/x86/um/bugs_64.c:9:6: warning: no previous prototype for ‘arch_check_bugs’ [-Wmissing-prototypes]
    9 | void arch_check_bugs(void)
      |      ^~~~~~~~~~~~~~~
../arch/x86/um/bugs_64.c:13:6: warning: no previous prototype for ‘arch_examine_signal’ [-Wmissing-prototypes]
   13 | void arch_examine_signal(int sig, struct uml_pt_regs *regs)
      |      ^~~~~~~~~~~~~~~~~~~
../arch/x86/um/fault.c:18:5: warning: no previous prototype for ‘arch_fixup’ [-Wmissing-prototypes]
   18 | int arch_fixup(unsigned long address, struct uml_pt_regs *regs)
      |     ^~~~~~~~~~
../arch/x86/um/vdso/um_vdso.c:16:5: warning: no previous prototype for ‘__vdso_clock_gettime’ [-Wmissing-prototypes]
   16 | int __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts)
      |     ^~~~~~~~~~~~~~~~~~~~
../arch/x86/um/vdso/um_vdso.c:30:5: warning: no previous prototype for ‘__vdso_gettimeofday’ [-Wmissing-prototypes]
   30 | int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
      |     ^~~~~~~~~~~~~~~~~~~
../arch/x86/um/vdso/um_vdso.c:44:21: warning: no previous prototype for ‘__vdso_time’ [-Wmissing-prototypes]
   44 | __kernel_old_time_t __vdso_time(__kernel_old_time_t *t)
      |                     ^~~~~~~~~~~
../arch/x86/um/vdso/um_vdso.c:57:1: warning: no previous prototype for ‘__vdso_getcpu’ [-Wmissing-prototypes]
   57 | __vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused)
      | ^~~~~~~~~~~~~
../arch/x86/um/os-Linux/registers.c:146:15: warning: no previous prototype for ‘get_thread_reg’ [-Wmissing-prototypes]
  146 | unsigned long get_thread_reg(int reg, jmp_buf *buf)
      |               ^~~~~~~~~~~~~~
../arch/x86/um/os-Linux/mcontext.c:7:6: warning: no previous prototype for ‘get_regs_from_mc’ [-Wmissing-prototypes]
    7 | void get_regs_from_mc(struct uml_pt_regs *regs, mcontext_t *mc)
      |      ^~~~~~~~~~~~~~~~
../arch/um/os-Linux/skas/process.c:107:6: warning: no previous prototype for ‘wait_stub_done’ [-Wmissing-prototypes]
  107 | void wait_stub_done(int pid)
      |      ^~~~~~~~~~~~~~
../arch/um/os-Linux/skas/process.c:683:6: warning: no previous prototype for ‘__switch_mm’ [-Wmissing-prototypes]
  683 | void __switch_mm(struct mm_id *mm_idp)
      |      ^~~~~~~~~~~
../arch/um/kernel/skas/mmu.c:17:5: warning: no previous prototype for ‘init_new_context’ [-Wmissing-prototypes]
   17 | int init_new_context(struct task_struct *task, struct mm_struct *mm)
      |     ^~~~~~~~~~~~~~~~
../arch/um/kernel/skas/mmu.c:60:6: warning: no previous prototype for ‘destroy_context’ [-Wmissing-prototypes]
   60 | void destroy_context(struct mm_struct *mm)
      |      ^~~~~~~~~~~~~~~
../arch/um/kernel/skas/process.c:36:12: warning: no previous prototype for ‘start_uml’ [-Wmissing-prototypes]
   36 | int __init start_uml(void)
      |            ^~~~~~~~~
../arch/um/os-Linux/main.c:187:7: warning: no previous prototype for ‘__wrap_malloc’ [-Wmissing-prototypes]
  187 | void *__wrap_malloc(int size)
      |       ^~~~~~~~~~~~~
../arch/um/os-Linux/main.c:208:7: warning: no previous prototype for ‘__wrap_calloc’ [-Wmissing-prototypes]
  208 | void *__wrap_calloc(int n, int size)
      |       ^~~~~~~~~~~~~
../arch/um/os-Linux/main.c:222:6: warning: no previous prototype for ‘__wrap_free’ [-Wmissing-prototypes]
  222 | void __wrap_free(void *ptr)
      |      ^~~~~~~~~~~
../arch/um/os-Linux/mem.c:28:6: warning: no previous prototype for ‘kasan_map_memory’ [-Wmissing-prototypes]
   28 | void kasan_map_memory(void *start, size_t len)
      |      ^~~~~~~~~~~~~~~~
../arch/um/os-Linux/mem.c:212:13: warning: no previous prototype for ‘check_tmpexec’ [-Wmissing-prototypes]
  212 | void __init check_tmpexec(void)
      |             ^~~~~~~~~~~~~
../arch/um/os-Linux/signal.c:75:6: warning: no previous prototype for ‘sig_handler’ [-Wmissing-prototypes]
   75 | void sig_handler(int sig, struct siginfo *si, mcontext_t *mc)
      |      ^~~~~~~~~~~
../arch/um/os-Linux/signal.c:111:6: warning: no previous prototype for ‘timer_alarm_handler’ [-Wmissing-prototypes]
  111 | void timer_alarm_handler(int sig, struct siginfo *unused_si, mcontext_t *mc)
      |      ^~~~~~~~~~~~~~~~~~~
../arch/um/os-Linux/start_up.c:301:12: warning: no previous prototype for ‘parse_iomem’ [-Wmissing-prototypes]
  301 | int __init parse_iomem(char *str, int *add)
      |            ^~~~~~~~~~~
../arch/x86/um/ptrace_64.c:111:5: warning: no previous prototype for ‘poke_user’ [-Wmissing-prototypes]
  111 | int poke_user(struct task_struct *child, long addr, long data)
      |     ^~~~~~~~~
../arch/x86/um/ptrace_64.c:171:5: warning: no previous prototype for ‘peek_user’ [-Wmissing-prototypes]
  171 | int peek_user(struct task_struct *child, long addr, long data)
      |     ^~~~~~~~~
../arch/x86/um/signal.c:560:6: warning: no previous prototype for ‘sys_rt_sigreturn’ [-Wmissing-prototypes]
  560 | long sys_rt_sigreturn(void)
      |      ^~~~~~~~~~~~~~~~
../arch/um/kernel/mem.c:202:8: warning: no previous prototype for ‘pgd_alloc’ [-Wmissing-prototypes]
  202 | pgd_t *pgd_alloc(struct mm_struct *mm)
      |        ^~~~~~~~~
../arch/um/kernel/mem.c:215:7: warning: no previous prototype for ‘uml_kmalloc’ [-Wmissing-prototypes]
  215 | void *uml_kmalloc(int size, int flags)
      |       ^~~~~~~~~~~
../arch/um/kernel/process.c:51:5: warning: no previous prototype for ‘pid_to_processor_id’ [-Wmissing-prototypes]
   51 | int pid_to_processor_id(int pid)
      |     ^~~~~~~~~~~~~~~~~~~
../arch/um/kernel/process.c:87:7: warning: no previous prototype for ‘__switch_to’ [-Wmissing-prototypes]
   87 | void *__switch_to(struct task_struct *from, struct task_struct *to)
      |       ^~~~~~~~~~~
../arch/um/kernel/process.c:140:6: warning: no previous prototype for ‘fork_handler’ [-Wmissing-prototypes]
  140 | void fork_handler(void)
      |      ^~~~~~~~~~~~
../arch/um/kernel/process.c:217:6: warning: no previous prototype for ‘arch_cpu_idle’ [-Wmissing-prototypes]
  217 | void arch_cpu_idle(void)
      |      ^~~~~~~~~~~~~
../arch/um/kernel/process.c:253:5: warning: no previous prototype for ‘copy_to_user_proc’ [-Wmissing-prototypes]
  253 | int copy_to_user_proc(void __user *to, void *from, int size)
      |     ^~~~~~~~~~~~~~~~~
../arch/um/kernel/process.c:263:5: warning: no previous prototype for ‘clear_user_proc’ [-Wmissing-prototypes]
  263 | int clear_user_proc(void __user *buf, int size)
      |     ^~~~~~~~~~~~~~~
../arch/um/kernel/process.c:271:6: warning: no previous prototype for ‘set_using_sysemu’ [-Wmissing-prototypes]
  271 | void set_using_sysemu(int value)
      |      ^~~~~~~~~~~~~~~~
../arch/um/kernel/process.c:278:5: warning: no previous prototype for ‘get_using_sysemu’ [-Wmissing-prototypes]
  278 | int get_using_sysemu(void)
      |     ^~~~~~~~~~~~~~~~
../arch/um/kernel/process.c:316:12: warning: no previous prototype for ‘make_proc_sysemu’ [-Wmissing-prototypes]
  316 | int __init make_proc_sysemu(void)
      |            ^~~~~~~~~~~~~~~~
../arch/um/kernel/process.c:348:15: warning: no previous prototype for ‘arch_align_stack’ [-Wmissing-prototypes]
  348 | unsigned long arch_align_stack(unsigned long sp)
      |               ^~~~~~~~~~~~~~~~
../arch/um/kernel/reboot.c:45:6: warning: no previous prototype for ‘machine_restart’ [-Wmissing-prototypes]
   45 | void machine_restart(char * __unused)
      |      ^~~~~~~~~~~~~~~
../arch/um/kernel/reboot.c:51:6: warning: no previous prototype for ‘machine_power_off’ [-Wmissing-prototypes]
   51 | void machine_power_off(void)
      |      ^~~~~~~~~~~~~~~~~
../arch/um/kernel/reboot.c:57:6: warning: no previous prototype for ‘machine_halt’ [-Wmissing-prototypes]
   57 | void machine_halt(void)
      |      ^~~~~~~~~~~~
../arch/x86/um/syscalls_64.c:48:6: warning: no previous prototype for ‘arch_switch_to’ [-Wmissing-prototypes]
   48 | void arch_switch_to(struct task_struct *to)
      |      ^~~~~~~~~~~~~~
../arch/um/kernel/tlb.c:579:6: warning: no previous prototype for ‘flush_tlb_mm_range’ [-Wmissing-prototypes]
  579 | void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
      |      ^~~~~~~~~~~~~~~~~~
../arch/um/kernel/tlb.c:594:6: warning: no previous prototype for ‘force_flush_all’ [-Wmissing-prototypes]
  594 | void force_flush_all(void)
      |      ^~~~~~~~~~~~~~~
../arch/um/kernel/um_arch.c:408:19: warning: no previous prototype for ‘read_initrd’ [-Wmissing-prototypes]
  408 | int __init __weak read_initrd(void)
      |                   ^~~~~~~~~~~
../arch/um/kernel/um_arch.c:461:7: warning: no previous prototype for ‘text_poke’ [-Wmissing-prototypes]
  461 | void *text_poke(void *addr, const void *opcode, size_t len)
      |       ^~~~~~~~~
../arch/um/kernel/um_arch.c:473:6: warning: no previous prototype for ‘text_poke_sync’ [-Wmissing-prototypes]
  473 | void text_poke_sync(void)
      |      ^~~~~~~~~~~~~~
../arch/um/kernel/kmsg_dump.c:60:12: warning: no previous prototype for ‘kmsg_dumper_stdout_init’ [-Wmissing-prototypes]
   60 | int __init kmsg_dumper_stdout_init(void)
      |            ^~~~~~~~~~~~~~~~~~~~~~~
../lib/iomap.c:156:5: warning: no previous prototype for ‘ioread64_lo_hi’ [-Wmissing-prototypes]
  156 | u64 ioread64_lo_hi(const void __iomem *addr)
      |     ^~~~~~~~~~~~~~
../lib/iomap.c:163:5: warning: no previous prototype for ‘ioread64_hi_lo’ [-Wmissing-prototypes]
  163 | u64 ioread64_hi_lo(const void __iomem *addr)
      |     ^~~~~~~~~~~~~~
../lib/iomap.c:170:5: warning: no previous prototype for ‘ioread64be_lo_hi’ [-Wmissing-prototypes]
  170 | u64 ioread64be_lo_hi(const void __iomem *addr)
      |     ^~~~~~~~~~~~~~~~
../lib/iomap.c:178:5: warning: no previous prototype for ‘ioread64be_hi_lo’ [-Wmissing-prototypes]
  178 | u64 ioread64be_hi_lo(const void __iomem *addr)
      |     ^~~~~~~~~~~~~~~~
../lib/iomap.c:264:6: warning: no previous prototype for ‘iowrite64_lo_hi’ [-Wmissing-prototypes]
  264 | void iowrite64_lo_hi(u64 val, void __iomem *addr)
      |      ^~~~~~~~~~~~~~~
../lib/iomap.c:272:6: warning: no previous prototype for ‘iowrite64_hi_lo’ [-Wmissing-prototypes]
  272 | void iowrite64_hi_lo(u64 val, void __iomem *addr)
      |      ^~~~~~~~~~~~~~~
../lib/iomap.c:280:6: warning: no previous prototype for ‘iowrite64be_lo_hi’ [-Wmissing-prototypes]
  280 | void iowrite64be_lo_hi(u64 val, void __iomem *addr)
      |      ^~~~~~~~~~~~~~~~~
../lib/iomap.c:288:6: warning: no previous prototype for ‘iowrite64be_hi_lo’ [-Wmissing-prototypes]
  288 | void iowrite64be_hi_lo(u64 val, void __iomem *addr)
      |      ^~~~~~~~~~~~~~~~~
stty: 'standard input': Inappropriate ioctl for device

[12:22:08] Starting KUnit Kernel (1/1)...
[12:22:08] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[12:22:09] =================== guc_dbm (7 subtests) ===================
[12:22:09] [PASSED] test_empty
[12:22:09] [PASSED] test_default
[12:22:09] ======================== test_size  ========================
[12:22:09] [PASSED] 4
[12:22:09] [PASSED] 8
[12:22:09] [PASSED] 32
[12:22:09] [PASSED] 256
[12:22:09] ==================== [PASSED] test_size ====================
[12:22:09] ======================= test_reuse  ========================
[12:22:09] [PASSED] 4
[12:22:09] [PASSED] 8
[12:22:09] [PASSED] 32
[12:22:09] [PASSED] 256
[12:22:09] =================== [PASSED] test_reuse ====================
[12:22:09] =================== test_range_overlap  ====================
[12:22:09] [PASSED] 4
[12:22:09] [PASSED] 8
[12:22:09] [PASSED] 32
[12:22:09] [PASSED] 256
[12:22:09] =============== [PASSED] test_range_overlap ================
[12:22:09] =================== test_range_compact  ====================
[12:22:09] [PASSED] 4
[12:22:09] [PASSED] 8
[12:22:09] [PASSED] 32
[12:22:09] [PASSED] 256
[12:22:09] =============== [PASSED] test_range_compact ================
[12:22:09] ==================== test_range_spare  =====================
[12:22:09] [PASSED] 4
[12:22:09] [PASSED] 8
[12:22:09] [PASSED] 32
[12:22:09] [PASSED] 256
[12:22:09] ================ [PASSED] test_range_spare =================
[12:22:09] ===================== [PASSED] guc_dbm =====================
[12:22:09] =================== guc_idm (6 subtests) ===================
[12:22:09] [PASSED] bad_init
[12:22:09] [PASSED] no_init
[12:22:09] [PASSED] init_fini
[12:22:09] [PASSED] check_used
[12:22:09] [PASSED] check_quota
[12:22:09] [PASSED] check_all
[12:22:09] ===================== [PASSED] guc_idm =====================
[12:22:09] ================== no_relay (3 subtests) ===================
[12:22:09] [PASSED] xe_drops_guc2pf_if_not_ready
[12:22:09] [PASSED] xe_drops_guc2vf_if_not_ready
[12:22:09] [PASSED] xe_rejects_send_if_not_ready
[12:22:09] ==================== [PASSED] no_relay =====================
[12:22:09] ================== pf_relay (14 subtests) ==================
[12:22:09] [PASSED] pf_rejects_guc2pf_too_short
[12:22:09] [PASSED] pf_rejects_guc2pf_too_long
[12:22:09] [PASSED] pf_rejects_guc2pf_no_payload
[12:22:09] [PASSED] pf_fails_no_payload
[12:22:09] [PASSED] pf_fails_bad_origin
[12:22:09] [PASSED] pf_fails_bad_type
[12:22:09] [PASSED] pf_txn_reports_error
[12:22:09] [PASSED] pf_txn_sends_pf2guc
[12:22:09] [PASSED] pf_sends_pf2guc
[12:22:09] [SKIPPED] pf_loopback_nop
[12:22:09] [SKIPPED] pf_loopback_echo
[12:22:09] [SKIPPED] pf_loopback_fail
[12:22:09] [SKIPPED] pf_loopback_busy
[12:22:09] [SKIPPED] pf_loopback_retry
[12:22:09] ==================== [PASSED] pf_relay =====================
[12:22:09] ================== vf_relay (3 subtests) ===================
[12:22:09] [PASSED] vf_rejects_guc2vf_too_short
[12:22:09] [PASSED] vf_rejects_guc2vf_too_long
[12:22:09] [PASSED] vf_rejects_guc2vf_no_payload
[12:22:09] ==================== [PASSED] vf_relay =====================
[12:22:09] ================= pf_service (11 subtests) =================
[12:22:09] [PASSED] pf_negotiate_any
[12:22:09] [PASSED] pf_negotiate_base_match
[12:22:09] [PASSED] pf_negotiate_base_newer
[12:22:09] [PASSED] pf_negotiate_base_next
[12:22:09] [SKIPPED] pf_negotiate_base_older
[12:22:09] [PASSED] pf_negotiate_base_prev
[12:22:09] [PASSED] pf_negotiate_latest_match
[12:22:09] [PASSED] pf_negotiate_latest_newer
[12:22:09] [PASSED] pf_negotiate_latest_next
[12:22:09] [SKIPPED] pf_negotiate_latest_older
[12:22:09] [SKIPPED] pf_negotiate_latest_prev
[12:22:09] =================== [PASSED] pf_service ====================
[12:22:09] ===================== lmtt (1 subtest) =====================
[12:22:09] ======================== test_ops  =========================
[12:22:09] [PASSED] 2-level
[12:22:09] [PASSED] multi-level
[12:22:09] ==================== [PASSED] test_ops =====================
[12:22:09] ====================== [PASSED] lmtt =======================
[12:22:09] ==================== xe_bo (2 subtests) ====================
[12:22:09] [SKIPPED] xe_ccs_migrate_kunit
[12:22:09] [SKIPPED] xe_bo_evict_kunit
[12:22:09] ===================== [SKIPPED] xe_bo ======================
[12:22:09] ================== xe_dma_buf (1 subtest) ==================
[12:22:09] [SKIPPED] xe_dma_buf_kunit
[12:22:09] =================== [SKIPPED] xe_dma_buf ===================
[12:22:09] ================== xe_migrate (1 subtest) ==================
[12:22:09] [SKIPPED] xe_migrate_sanity_kunit
[12:22:09] =================== [SKIPPED] xe_migrate ===================
[12:22:09] =================== xe_mocs (2 subtests) ===================
[12:22:09] [SKIPPED] xe_live_mocs_kernel_kunit
[12:22:09] [SKIPPED] xe_live_mocs_reset_kunit
[12:22:09] ==================== [SKIPPED] xe_mocs =====================
[12:22:09] =================== xe_pci (2 subtests) ====================
[12:22:09] [PASSED] xe_gmdid_graphics_ip
[12:22:09] [PASSED] xe_gmdid_media_ip
[12:22:09] ===================== [PASSED] xe_pci ======================
[12:22:09] ==================== xe_rtp (1 subtest) ====================
[12:22:09] ================== xe_rtp_process_tests  ===================
[12:22:09] [PASSED] coalesce-same-reg
[12:22:09] [PASSED] no-match-no-add
[12:22:09] [PASSED] no-match-no-add-multiple-rules
[12:22:09] [PASSED] two-regs-two-entries
[12:22:09] [PASSED] clr-one-set-other
[12:22:09] [PASSED] set-field
[12:22:09] [PASSED] conflict-duplicate
[12:22:09] [PASSED] conflict-not-disjoint
[12:22:09] [PASSED] conflict-reg-type
[12:22:09] ============== [PASSED] xe_rtp_process_tests ===============
[12:22:09] ===================== [PASSED] xe_rtp ======================
[12:22:09] ==================== xe_wa (1 subtest) =====================
[12:22:09] ======================== xe_wa_gt  =========================
[12:22:09] [PASSED] TIGERLAKE (B0)
[12:22:09] [PASSED] DG1 (A0)
[12:22:09] [PASSED] DG1 (B0)
[12:22:09] [PASSED] ALDERLAKE_S (A0)
[12:22:09] [PASSED] ALDERLAKE_S (B0)
[12:22:09] [PASSED] ALDERLAKE_S (C0)
[12:22:09] [PASSED] ALDERLAKE_S (D0)
[12:22:09] [PASSED] ALDERLAKE_P (A0)
[12:22:09] [PASSED] ALDERLAKE_P (B0)
[12:22:09] [PASSED] ALDERLAKE_P (C0)
[12:22:09] [PASSED] ALDERLAKE_S_RPLS (D0)
[12:22:09] [PASSED] ALDERLAKE_P_RPLU (E0)
[12:22:09] [PASSED] DG2_G10 (C0)
[12:22:09] [PASSED] DG2_G11 (B1)
[12:22:09] [PASSED] DG2_G12 (A1)
[12:22:09] [PASSED] METEORLAKE (g:A0, m:A0)
[12:22:09] [PASSED] METEORLAKE (g:A0, m:A0)
[12:22:09] [PASSED] METEORLAKE (g:A0, m:A0)
[12:22:09] [PASSED] LUNARLAKE (g:A0, m:A0)
[12:22:09] [PASSED] LUNARLAKE (g:B0, m:A0)
[12:22:09] ==================== [PASSED] xe_wa_gt =====================
[12:22:09] ====================== [PASSED] xe_wa ======================
[12:22:09] ============================================================
[12:22:09] Testing complete. Ran 98 tests: passed: 84, skipped: 14
[12:22:09] Elapsed time: 29.409s total, 4.199s configuring, 24.990s building, 0.209s running

+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/tests/.kunitconfig
[12:22:09] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
[12:22:10] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make ARCH=um O=.kunit --jobs=48
In file included from ../arch/um/kernel/asm-offsets.c:1:
../arch/x86/um/shared/sysdep/kernel-offsets.h:9:6: warning: no previous prototype for ‘foo’ [-Wmissing-prototypes]
    9 | void foo(void)
      |      ^~~
../arch/x86/um/ptrace_64.c:111:5: warning: no previous prototype for ‘poke_user’ [-Wmissing-prototypes]
  111 | int poke_user(struct task_struct *child, long addr, long data)
      |     ^~~~~~~~~
../arch/x86/um/ptrace_64.c:171:5: warning: no previous prototype for ‘peek_user’ [-Wmissing-prototypes]
  171 | int peek_user(struct task_struct *child, long addr, long data)
      |     ^~~~~~~~~
../arch/um/kernel/mem.c:202:8: warning: no previous prototype for ‘pgd_alloc’ [-Wmissing-prototypes]
  202 | pgd_t *pgd_alloc(struct mm_struct *mm)
      |        ^~~~~~~~~
../arch/um/kernel/mem.c:215:7: warning: no previous prototype for ‘uml_kmalloc’ [-Wmissing-prototypes]
  215 | void *uml_kmalloc(int size, int flags)
      |       ^~~~~~~~~~~
../arch/um/kernel/process.c:51:5: warning: no previous prototype for ‘pid_to_processor_id’ [-Wmissing-prototypes]
   51 | int pid_to_processor_id(int pid)
      |     ^~~~~~~~~~~~~~~~~~~
../arch/um/kernel/process.c:87:7: warning: no previous prototype for ‘__switch_to’ [-Wmissing-prototypes]
   87 | void *__switch_to(struct task_struct *from, struct task_struct *to)
      |       ^~~~~~~~~~~
../arch/um/kernel/process.c:140:6: warning: no previous prototype for ‘fork_handler’ [-Wmissing-prototypes]
  140 | void fork_handler(void)
      |      ^~~~~~~~~~~~
../arch/um/kernel/process.c:217:6: warning: no previous prototype for ‘arch_cpu_idle’ [-Wmissing-prototypes]
  217 | void arch_cpu_idle(void)
      |      ^~~~~~~~~~~~~
../arch/um/kernel/process.c:253:5: warning: no previous prototype for ‘copy_to_user_proc’ [-Wmissing-prototypes]
  253 | int copy_to_user_proc(void __user *to, void *from, int size)
      |     ^~~~~~~~~~~~~~~~~
../arch/um/kernel/process.c:263:5: warning: no previous prototype for ‘clear_user_proc’ [-Wmissing-prototypes]
  263 | int clear_user_proc(void __user *buf, int size)
      |     ^~~~~~~~~~~~~~~
../arch/um/kernel/process.c:271:6: warning: no previous prototype for ‘set_using_sysemu’ [-Wmissing-prototypes]
  271 | void set_using_sysemu(int value)
      |      ^~~~~~~~~~~~~~~~
../arch/um/kernel/process.c:278:5: warning: no previous prototype for ‘get_using_sysemu’ [-Wmissing-prototypes]
  278 | int get_using_sysemu(void)
      |     ^~~~~~~~~~~~~~~~
../arch/um/kernel/process.c:316:12: warning: no previous prototype for ‘make_proc_sysemu’ [-Wmissing-prototypes]
  316 | int __init make_proc_sysemu(void)
      |            ^~~~~~~~~~~~~~~~
../arch/um/kernel/process.c:348:15: warning: no previous prototype for ‘arch_align_stack’ [-Wmissing-prototypes]
  348 | unsigned long arch_align_stack(unsigned long sp)
      |               ^~~~~~~~~~~~~~~~
../arch/x86/um/signal.c:560:6: warning: no previous prototype for ‘sys_rt_sigreturn’ [-Wmissing-prototypes]
  560 | long sys_rt_sigreturn(void)
      |      ^~~~~~~~~~~~~~~~
../arch/um/kernel/reboot.c:45:6: warning: no previous prototype for ‘machine_restart’ [-Wmissing-prototypes]
   45 | void machine_restart(char * __unused)
      |      ^~~~~~~~~~~~~~~
../arch/um/kernel/reboot.c:51:6: warning: no previous prototype for ‘machine_power_off’ [-Wmissing-prototypes]
   51 | void machine_power_off(void)
      |      ^~~~~~~~~~~~~~~~~
../arch/um/kernel/reboot.c:57:6: warning: no previous prototype for ‘machine_halt’ [-Wmissing-prototypes]
   57 | void machine_halt(void)
      |      ^~~~~~~~~~~~
../arch/um/kernel/tlb.c:579:6: warning: no previous prototype for ‘flush_tlb_mm_range’ [-Wmissing-prototypes]
  579 | void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
      |      ^~~~~~~~~~~~~~~~~~
../arch/um/kernel/tlb.c:594:6: warning: no previous prototype for ‘force_flush_all’ [-Wmissing-prototypes]
  594 | void force_flush_all(void)
      |      ^~~~~~~~~~~~~~~
../arch/x86/um/syscalls_64.c:48:6: warning: no previous prototype for ‘arch_switch_to’ [-Wmissing-prototypes]
   48 | void arch_switch_to(struct task_struct *to)
      |      ^~~~~~~~~~~~~~
../arch/um/kernel/um_arch.c:408:19: warning: no previous prototype for ‘read_initrd’ [-Wmissing-prototypes]
  408 | int __init __weak read_initrd(void)
      |                   ^~~~~~~~~~~
../arch/um/kernel/um_arch.c:461:7: warning: no previous prototype for ‘text_poke’ [-Wmissing-prototypes]
  461 | void *text_poke(void *addr, const void *opcode, size_t len)
      |       ^~~~~~~~~
../arch/um/kernel/um_arch.c:473:6: warning: no previous prototype for ‘text_poke_sync’ [-Wmissing-prototypes]
  473 | void text_poke_sync(void)
      |      ^~~~~~~~~~~~~~
../arch/um/kernel/kmsg_dump.c:60:12: warning: no previous prototype for ‘kmsg_dumper_stdout_init’ [-Wmissing-prototypes]
   60 | int __init kmsg_dumper_stdout_init(void)
      |            ^~~~~~~~~~~~~~~~~~~~~~~
../arch/um/kernel/skas/mmu.c:17:5: warning: no previous prototype for ‘init_new_context’ [-Wmissing-prototypes]
   17 | int init_new_context(struct task_struct *task, struct mm_struct *mm)
      |     ^~~~~~~~~~~~~~~~
../arch/um/kernel/skas/mmu.c:60:6: warning: no previous prototype for ‘destroy_context’ [-Wmissing-prototypes]
   60 | void destroy_context(struct mm_struct *mm)
      |      ^~~~~~~~~~~~~~~
../arch/um/kernel/skas/process.c:36:12: warning: no previous prototype for ‘start_uml’ [-Wmissing-prototypes]
   36 | int __init start_uml(void)
      |            ^~~~~~~~~
../lib/iomap.c:156:5: warning: no previous prototype for ‘ioread64_lo_hi’ [-Wmissing-prototypes]
  156 | u64 ioread64_lo_hi(const void __iomem *addr)
      |     ^~~~~~~~~~~~~~
../lib/iomap.c:163:5: warning: no previous prototype for ‘ioread64_hi_lo’ [-Wmissing-prototypes]
  163 | u64 ioread64_hi_lo(const void __iomem *addr)
      |     ^~~~~~~~~~~~~~
../lib/iomap.c:170:5: warning: no previous prototype for ‘ioread64be_lo_hi’ [-Wmissing-prototypes]
  170 | u64 ioread64be_lo_hi(const void __iomem *addr)
      |     ^~~~~~~~~~~~~~~~
../lib/iomap.c:178:5: warning: no previous prototype for ‘ioread64be_hi_lo’ [-Wmissing-prototypes]
  178 | u64 ioread64be_hi_lo(const void __iomem *addr)
      |     ^~~~~~~~~~~~~~~~
../lib/iomap.c:264:6: warning: no previous prototype for ‘iowrite64_lo_hi’ [-Wmissing-prototypes]
  264 | void iowrite64_lo_hi(u64 val, void __iomem *addr)
      |      ^~~~~~~~~~~~~~~
../lib/iomap.c:272:6: warning: no previous prototype for ‘iowrite64_hi_lo’ [-Wmissing-prototypes]
  272 | void iowrite64_hi_lo(u64 val, void __iomem *addr)
      |      ^~~~~~~~~~~~~~~
../lib/iomap.c:280:6: warning: no previous prototype for ‘iowrite64be_lo_hi’ [-Wmissing-prototypes]
  280 | void iowrite64be_lo_hi(u64 val, void __iomem *addr)
      |      ^~~~~~~~~~~~~~~~~
../lib/iomap.c:288:6: warning: no previous prototype for ‘iowrite64be_hi_lo’ [-Wmissing-prototypes]
  288 | void iowrite64be_hi_lo(u64 val, void __iomem *addr)
      |      ^~~~~~~~~~~~~~~~~

[12:22:32] Starting KUnit Kernel (1/1)...
[12:22:32] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[12:22:32] ============ drm_test_pick_cmdline (2 subtests) ============
[12:22:32] [PASSED] drm_test_pick_cmdline_res_1920_1080_60
[12:22:32] =============== drm_test_pick_cmdline_named  ===============
[12:22:32] [PASSED] NTSC
[12:22:32] [PASSED] NTSC-J
[12:22:32] [PASSED] PAL
[12:22:32] [PASSED] PAL-M
[12:22:32] =========== [PASSED] drm_test_pick_cmdline_named ===========
[12:22:32] ============== [PASSED] drm_test_pick_cmdline ==============
[12:22:32] ================== drm_buddy (7 subtests) ==================
[12:22:32] [PASSED] drm_test_buddy_alloc_limit
[12:22:32] [PASSED] drm_test_buddy_alloc_optimistic
[12:22:32] [PASSED] drm_test_buddy_alloc_pessimistic
[12:22:32] [PASSED] drm_test_buddy_alloc_pathological
[12:22:32] [PASSED] drm_test_buddy_alloc_contiguous
[12:22:32] [PASSED] drm_test_buddy_alloc_clear
[12:22:32] [PASSED] drm_test_buddy_alloc_range_bias
[12:22:32] ==================== [PASSED] drm_buddy ====================
[12:22:32] ============= drm_cmdline_parser (40 subtests) =============
[12:22:32] [PASSED] drm_test_cmdline_force_d_only
[12:22:32] [PASSED] drm_test_cmdline_force_D_only_dvi
[12:22:32] [PASSED] drm_test_cmdline_force_D_only_hdmi
[12:22:32] [PASSED] drm_test_cmdline_force_D_only_not_digital
[12:22:32] [PASSED] drm_test_cmdline_force_e_only
[12:22:32] [PASSED] drm_test_cmdline_res
[12:22:32] [PASSED] drm_test_cmdline_res_vesa
[12:22:32] [PASSED] drm_test_cmdline_res_vesa_rblank
[12:22:32] [PASSED] drm_test_cmdline_res_rblank
[12:22:32] [PASSED] drm_test_cmdline_res_bpp
[12:22:32] [PASSED] drm_test_cmdline_res_refresh
[12:22:32] [PASSED] drm_test_cmdline_res_bpp_refresh
[12:22:32] [PASSED] drm_test_cmdline_res_bpp_refresh_interlaced
[12:22:32] [PASSED] drm_test_cmdline_res_bpp_refresh_margins
[12:22:32] [PASSED] drm_test_cmdline_res_bpp_refresh_force_off
[12:22:32] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on
[12:22:32] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on_analog
[12:22:32] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on_digital
[12:22:32] [PASSED] drm_test_cmdline_res_bpp_refresh_interlaced_margins_force_on
[12:22:32] [PASSED] drm_test_cmdline_res_margins_force_on
[12:22:32] [PASSED] drm_test_cmdline_res_vesa_margins
[12:22:32] [PASSED] drm_test_cmdline_name
[12:22:32] [PASSED] drm_test_cmdline_name_bpp
[12:22:32] [PASSED] drm_test_cmdline_name_option
[12:22:32] [PASSED] drm_test_cmdline_name_bpp_option
[12:22:32] [PASSED] drm_test_cmdline_rotate_0
[12:22:32] [PASSED] drm_test_cmdline_rotate_90
[12:22:32] [PASSED] drm_test_cmdline_rotate_180
[12:22:32] [PASSED] drm_test_cmdline_rotate_270
[12:22:32] [PASSED] drm_test_cmdline_hmirror
[12:22:32] [PASSED] drm_test_cmdline_vmirror
[12:22:32] [PASSED] drm_test_cmdline_margin_options
[12:22:32] [PASSED] drm_test_cmdline_multiple_options
[12:22:32] [PASSED] drm_test_cmdline_bpp_extra_and_option
[12:22:32] [PASSED] drm_test_cmdline_extra_and_option
[12:22:32] [PASSED] drm_test_cmdline_freestanding_options
[12:22:32] [PASSED] drm_test_cmdline_freestanding_force_e_and_options
[12:22:32] [PASSED] drm_test_cmdline_panel_orientation
[12:22:32] ================ drm_test_cmdline_invalid  =================
[12:22:32] [PASSED] margin_only
[12:22:32] [PASSED] interlace_only
[12:22:32] [PASSED] res_missing_x
[12:22:32] [PASSED] res_missing_y
[12:22:32] [PASSED] res_bad_y
[12:22:32] [PASSED] res_missing_y_bpp
[12:22:32] [PASSED] res_bad_bpp
[12:22:32] [PASSED] res_bad_refresh
[12:22:32] [PASSED] res_bpp_refresh_force_on_off
[12:22:32] [PASSED] res_invalid_mode
[12:22:32] [PASSED] res_bpp_wrong_place_mode
[12:22:32] [PASSED] name_bpp_refresh
[12:22:32] [PASSED] name_refresh
[12:22:32] [PASSED] name_refresh_wrong_mode
[12:22:32] [PASSED] name_refresh_invalid_mode
[12:22:32] [PASSED] rotate_multiple
[12:22:32] [PASSED] rotate_invalid_val
[12:22:32] [PASSED] rotate_truncated
[12:22:32] [PASSED] invalid_option
[12:22:32] [PASSED] invalid_tv_option
[12:22:32] [PASSED] truncated_tv_option
[12:22:32] ============ [PASSED] drm_test_cmdline_invalid =============
[12:22:32] =============== drm_test_cmdline_tv_options  ===============
[12:22:32] [PASSED] NTSC
[12:22:32] [PASSED] NTSC_443
[12:22:32] [PASSED] NTSC_J
[12:22:32] [PASSED] PAL
[12:22:32] [PASSED] PAL_M
[12:22:32] [PASSED] PAL_N
[12:22:32] [PASSED] SECAM
[12:22:32] =========== [PASSED] drm_test_cmdline_tv_options ===========
[12:22:32] =============== [PASSED] drm_cmdline_parser ================
[12:22:32] ============= drmm_connector_init (3 subtests) =============
[12:22:32] [PASSED] drm_test_drmm_connector_init
[12:22:32] [PASSED] drm_test_drmm_connector_init_null_ddc
[12:22:32] ========= drm_test_drmm_connector_init_type_valid  =========
[12:22:32] [PASSED] Unknown
[12:22:32] [PASSED] VGA
[12:22:32] [PASSED] DVI-I
[12:22:32] [PASSED] DVI-D
[12:22:32] [PASSED] DVI-A
[12:22:32] [PASSED] Composite
[12:22:32] [PASSED] SVIDEO
[12:22:32] [PASSED] LVDS
[12:22:32] [PASSED] Component
[12:22:32] [PASSED] DIN
[12:22:32] [PASSED] DP
[12:22:32] [PASSED] HDMI-A
[12:22:32] [PASSED] HDMI-B
[12:22:32] [PASSED] TV
[12:22:32] [PASSED] eDP
[12:22:32] [PASSED] Virtual
[12:22:32] [PASSED] DSI
[12:22:32] [PASSED] DPI
[12:22:32] [PASSED] Writeback
[12:22:32] [PASSED] SPI
[12:22:32] [PASSED] USB
[12:22:32] ===== [PASSED] drm_test_drmm_connector_init_type_valid =====
[12:22:32] =============== [PASSED] drmm_connector_init ===============
[12:22:32] ========== drm_get_tv_mode_from_name (2 subtests) ==========
[12:22:32] ========== drm_test_get_tv_mode_from_name_valid  ===========
[12:22:32] [PASSED] NTSC
[12:22:32] [PASSED] NTSC-443
[12:22:32] [PASSED] NTSC-J
[12:22:32] [PASSED] PAL
[12:22:32] [PASSED] PAL-M
[12:22:32] [PASSED] PAL-N
[12:22:32] [PASSED] SECAM
[12:22:32] ====== [PASSED] drm_test_get_tv_mode_from_name_valid =======
[12:22:32] [PASSED] drm_test_get_tv_mode_from_name_truncated
[12:22:32] ============ [PASSED] drm_get_tv_mode_from_name ============
[12:22:32] ============= drm_damage_helper (21 subtests) ==============
[12:22:32] [PASSED] drm_test_damage_iter_no_damage
[12:22:32] [PASSED] drm_test_damage_iter_no_damage_fractional_src
[12:22:32] [PASSED] drm_test_damage_iter_no_damage_src_moved
[12:22:32] [PASSED] drm_test_damage_iter_no_damage_fractional_src_moved
[12:22:32] [PASSED] drm_test_damage_iter_no_damage_not_visible
[12:22:32] [PASSED] drm_test_damage_iter_no_damage_no_crtc
[12:22:32] [PASSED] drm_test_damage_iter_no_damage_no_fb
[12:22:32] [PASSED] drm_test_damage_iter_simple_damage
[12:22:32] [PASSED] drm_test_damage_iter_single_damage
[12:22:32] [PASSED] drm_test_damage_iter_single_damage_intersect_src
[12:22:32] [PASSED] drm_test_damage_iter_single_damage_outside_src
[12:22:32] [PASSED] drm_test_damage_iter_single_damage_fractional_src
[12:22:32] [PASSED] drm_test_damage_iter_single_damage_intersect_fractional_src
[12:22:32] [PASSED] drm_test_damage_iter_single_damage_outside_fractional_src
[12:22:32] [PASSED] drm_test_damage_iter_single_damage_src_moved
[12:22:32] [PASSED] drm_test_damage_iter_single_damage_fractional_src_moved
[12:22:32] [PASSED] drm_test_damage_iter_damage
[12:22:32] [PASSED] drm_test_damage_iter_damage_one_intersect
[12:22:32] [PASSED] drm_test_damage_iter_damage_one_outside
[12:22:32] [PASSED] drm_test_damage_iter_damage_src_moved
[12:22:32] [PASSED] drm_test_damage_iter_damage_not_visible
[12:22:32] ================ [PASSED] drm_damage_helper ================
[12:22:32] ============== drm_dp_mst_helper (3 subtests) ==============
[12:22:32] ============== drm_test_dp_mst_calc_pbn_mode  ==============
[12:22:32] [PASSED] Clock 154000 BPP 30 DSC disabled
[12:22:32] [PASSED] Clock 234000 BPP 30 DSC disabled
[12:22:32] [PASSED] Clock 297000 BPP 24 DSC disabled
[12:22:32] [PASSED] Clock 332880 BPP 24 DSC enabled
[12:22:32] [PASSED] Clock 324540 BPP 24 DSC enabled
[12:22:32] ========== [PASSED] drm_test_dp_mst_calc_pbn_mode ==========
[12:22:32] ============== drm_test_dp_mst_calc_pbn_div  ===============
[12:22:32] [PASSED] Link rate 2000000 lane count 4
[12:22:32] [PASSED] Link rate 2000000 lane count 2
[12:22:32] [PASSED] Link rate 2000000 lane count 1
[12:22:32] [PASSED] Link rate 1350000 lane count 4
[12:22:32] [PASSED] Link rate 1350000 lane count 2
[12:22:32] [PASSED] Link rate 1350000 lane count 1
[12:22:32] [PASSED] Link rate 1000000 lane count 4
[12:22:32] [PASSED] Link rate 1000000 lane count 2
[12:22:32] [PASSED] Link rate 1000000 lane count 1
[12:22:32] [PASSED] Link rate 810000 lane count 4
[12:22:32] [PASSED] Link rate 810000 lane count 2
[12:22:32] [PASSED] Link rate 810000 lane count 1
[12:22:32] [PASSED] Link rate 540000 lane count 4
[12:22:32] [PASSED] Link rate 540000 lane count 2
[12:22:32] [PASSED] Link rate 540000 lane count 1
[12:22:32] [PASSED] Link rate 270000 lane count 4
[12:22:32] [PASSED] Link rate 270000 lane count 2
[12:22:32] [PASSED] Link rate 270000 lane count 1
[12:22:32] [PASSED] Link rate 162000 lane count 4
[12:22:32] [PASSED] Link rate 162000 lane count 2
[12:22:32] [PASSED] Link rate 162000 lane count 1
[12:22:32] ========== [PASSED] drm_test_dp_mst_calc_pbn_div ===========
[12:22:32] ========= drm_test_dp_mst_sideband_msg_req_decode  =========
[12:22:32] [PASSED] DP_ENUM_PATH_RESOURCES with port number
[12:22:32] [PASSED] DP_POWER_UP_PHY with port number
[12:22:32] [PASSED] DP_POWER_DOWN_PHY with port number
[12:22:32] [PASSED] DP_ALLOCATE_PAYLOAD with SDP stream sinks
[12:22:32] [PASSED] DP_ALLOCATE_PAYLOAD with port number
[12:22:32] [PASSED] DP_ALLOCATE_PAYLOAD with VCPI
[12:22:32] [PASSED] DP_ALLOCATE_PAYLOAD with PBN
[12:22:32] [PASSED] DP_QUERY_PAYLOAD with port number
[12:22:32] [PASSED] DP_QUERY_PAYLOAD with VCPI
[12:22:32] [PASSED] DP_REMOTE_DPCD_READ with port number
[12:22:32] [PASSED] DP_REMOTE_DPCD_READ with DPCD address
[12:22:32] [PASSED] DP_REMOTE_DPCD_READ with max number of bytes
[12:22:32] [PASSED] DP_REMOTE_DPCD_WRITE with port number
[12:22:32] [PASSED] DP_REMOTE_DPCD_WRITE with DPCD address
[12:22:32] [PASSED] DP_REMOTE_DPCD_WRITE with data array
[12:22:32] [PASSED] DP_REMOTE_I2C_READ with port number
[12:22:32] [PASSED] DP_REMOTE_I2C_READ with I2C device ID
[12:22:32] [PASSED] DP_REMOTE_I2C_READ with transactions array
[12:22:32] [PASSED] DP_REMOTE_I2C_WRITE with port number
[12:22:32] [PASSED] DP_REMOTE_I2C_WRITE with I2C device ID
[12:22:32] [PASSED] DP_REMOTE_I2C_WRITE with data array
[12:22:32] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream ID
[12:22:32] [PASSED] DP_QUERY_STREAM_ENC_STATUS with client ID
[12:22:32] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream event
[12:22:32] [PASSED] DP_QUERY_STREAM_ENC_STATUS with valid stream event
[12:22:32] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream behavior
[12:22:32] [PASSED] DP_QUERY_STREAM_ENC_STATUS with a valid stream behavior
[12:22:32] ===== [PASSED] drm_test_dp_mst_sideband_msg_req_decode =====
[12:22:32] ================ [PASSED] drm_dp_mst_helper ================
[12:22:32] ================== drm_exec (7 subtests) ===================
[12:22:32] [PASSED] sanitycheck
[12:22:32] [PASSED] test_lock
[12:22:32] [PASSED] test_lock_unlock
[12:22:32] [PASSED] test_duplicates
[12:22:32] [PASSED] test_prepare
[12:22:32] [PASSED] test_prepare_array
[12:22:32] [PASSED] test_multiple_loops
[12:22:32] ==================== [PASSED] drm_exec =====================
[12:22:32] =========== drm_format_helper_test (17 subtests) ===========
[12:22:32] ============== drm_test_fb_xrgb8888_to_gray8  ==============
[12:22:32] [PASSED] single_pixel_source_buffer
[12:22:32] [PASSED] single_pixel_clip_rectangle
[12:22:32] [PASSED] well_known_colors
[12:22:32] [PASSED] destination_pitch
[12:22:32] ========== [PASSED] drm_test_fb_xrgb8888_to_gray8 ==========
[12:22:32] ============= drm_test_fb_xrgb8888_to_rgb332  ==============
[12:22:32] [PASSED] single_pixel_source_buffer
[12:22:32] [PASSED] single_pixel_clip_rectangle
[12:22:32] [PASSED] well_known_colors
[12:22:32] [PASSED] destination_pitch
[12:22:32] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb332 ==========
[12:22:32] ============= drm_test_fb_xrgb8888_to_rgb565  ==============
[12:22:32] [PASSED] single_pixel_source_buffer
[12:22:32] [PASSED] single_pixel_clip_rectangle
[12:22:32] [PASSED] well_known_colors
[12:22:32] [PASSED] destination_pitch
[12:22:32] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb565 ==========
[12:22:32] ============ drm_test_fb_xrgb8888_to_xrgb1555  =============
[12:22:32] [PASSED] single_pixel_source_buffer
[12:22:32] [PASSED] single_pixel_clip_rectangle
[12:22:32] [PASSED] well_known_colors
[12:22:32] [PASSED] destination_pitch
[12:22:32] ======== [PASSED] drm_test_fb_xrgb8888_to_xrgb1555 =========
[12:22:32] ============ drm_test_fb_xrgb8888_to_argb1555  =============
[12:22:32] [PASSED] single_pixel_source_buffer
[12:22:32] [PASSED] single_pixel_clip_rectangle
[12:22:32] [PASSED] well_known_colors
[12:22:32] [PASSED] destination_pitch
[12:22:32] ======== [PASSED] drm_test_fb_xrgb8888_to_argb1555 =========
[12:22:32] ============ drm_test_fb_xrgb8888_to_rgba5551  =============
[12:22:32] [PASSED] single_pixel_source_buffer
[12:22:32] [PASSED] single_pixel_clip_rectangle
[12:22:32] [PASSED] well_known_colors
[12:22:32] [PASSED] destination_pitch
[12:22:32] ======== [PASSED] drm_test_fb_xrgb8888_to_rgba5551 =========
[12:22:32] ============= drm_test_fb_xrgb8888_to_rgb888  ==============
[12:22:32] [PASSED] single_pixel_source_buffer
[12:22:32] [PASSED] single_pixel_clip_rectangle
[12:22:32] [PASSED] well_known_colors
[12:22:32] [PASSED] destination_pitch
[12:22:32] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb888 ==========
[12:22:32] ============ drm_test_fb_xrgb8888_to_argb8888  =============
[12:22:32] [PASSED] single_pixel_source_buffer
[12:22:32] [PASSED] single_pixel_clip_rectangle
[12:22:32] [PASSED] well_known_colors
[12:22:32] [PASSED] destination_pitch
[12:22:32] ======== [PASSED] drm_test_fb_xrgb8888_to_argb8888 =========
[12:22:32] =========== drm_test_fb_xrgb8888_to_xrgb2101010  ===========
[12:22:32] [PASSED] single_pixel_source_buffer
[12:22:32] [PASSED] single_pixel_clip_rectangle
[12:22:32] [PASSED] well_known_colors
[12:22:32] [PASSED] destination_pitch
[12:22:32] ======= [PASSED] drm_test_fb_xrgb8888_to_xrgb2101010 =======
[12:22:32] =========== drm_test_fb_xrgb8888_to_argb2101010  ===========
[12:22:32] [PASSED] single_pixel_source_buffer
[12:22:32] [PASSED] single_pixel_clip_rectangle
[12:22:32] [PASSED] well_known_colors
[12:22:32] [PASSED] destination_pitch
[12:22:32] ======= [PASSED] drm_test_fb_xrgb8888_to_argb2101010 =======
[12:22:32] ============== drm_test_fb_xrgb8888_to_mono  ===============
[12:22:32] [PASSED] single_pixel_source_buffer
[12:22:32] [PASSED] single_pixel_clip_rectangle
[12:22:32] [PASSED] well_known_colors
[12:22:32] [PASSED] destination_pitch
[12:22:32] ========== [PASSED] drm_test_fb_xrgb8888_to_mono ===========
[12:22:32] ==================== drm_test_fb_swab  =====================
[12:22:32] [PASSED] single_pixel_source_buffer
[12:22:32] [PASSED] single_pixel_clip_rectangle
[12:22:32] [PASSED] well_known_colors
[12:22:32] [PASSED] destination_pitch
[12:22:32] ================ [PASSED] drm_test_fb_swab =================
[12:22:32] ============ drm_test_fb_xrgb8888_to_xbgr8888  =============
[12:22:32] [PASSED] single_pixel_source_buffer
[12:22:32] [PASSED] single_pixel_clip_rectangle
[12:22:32] [PASSED] well_known_colors
[12:22:32] [PASSED] destination_pitch
[12:22:32] ======== [PASSED] drm_test_fb_xrgb8888_to_xbgr8888 =========
[12:22:32] ============ drm_test_fb_xrgb8888_to_abgr8888  =============
[12:22:32] [PASSED] single_pixel_source_buffer
[12:22:32] [PASSED] single_pixel_clip_rectangle
[12:22:32] [PASSED] well_known_colors
[12:22:32] [PASSED] destination_pitch
[12:22:32] ======== [PASSED] drm_test_fb_xrgb8888_to_abgr8888 =========
[12:22:32] ================= drm_test_fb_clip_offset  =================
[12:22:32] [PASSED] pass through
[12:22:32] [PASSED] horizontal offset
[12:22:32] [PASSED] vertical offset
[12:22:32] [PASSED] horizontal and vertical offset
[12:22:32] [PASSED] horizontal offset (custom pitch)
[12:22:32] [PASSED] vertical offset (custom pitch)
[12:22:32] [PASSED] horizontal and vertical offset (custom pitch)
[12:22:32] ============= [PASSED] drm_test_fb_clip_offset =============
[12:22:32] ============== drm_test_fb_build_fourcc_list  ==============
[12:22:32] [PASSED] no native formats
[12:22:32] [PASSED] XRGB8888 as native format
[12:22:32] [PASSED] remove duplicates
[12:22:32] [PASSED] convert alpha formats
[12:22:32] [PASSED] random formats
[12:22:32] ========== [PASSED] drm_test_fb_build_fourcc_list ==========
[12:22:32] =================== drm_test_fb_memcpy  ====================
[12:22:32] [PASSED] single_pixel_source_buffer: XR24 little-endian (0x34325258)
[12:22:32] [PASSED] single_pixel_source_buffer: XRA8 little-endian (0x38415258)
[12:22:32] [PASSED] single_pixel_source_buffer: YU24 little-endian (0x34325559)
[12:22:32] [PASSED] single_pixel_clip_rectangle: XB24 little-endian (0x34324258)
[12:22:32] [PASSED] single_pixel_clip_rectangle: XRA8 little-endian (0x38415258)
[12:22:32] [PASSED] single_pixel_clip_rectangle: YU24 little-endian (0x34325559)
[12:22:32] [PASSED] well_known_colors: XB24 little-endian (0x34324258)
[12:22:32] [PASSED] well_known_colors: XRA8 little-endian (0x38415258)
[12:22:32] [PASSED] well_known_colors: YU24 little-endian (0x34325559)
[12:22:32] [PASSED] destination_pitch: XB24 little-endian (0x34324258)
[12:22:32] [PASSED] destination_pitch: XRA8 little-endian (0x38415258)
[12:22:32] [PASSED] destination_pitch: YU24 little-endian (0x34325559)
[12:22:32] =============== [PASSED] drm_test_fb_memcpy ================
[12:22:32] ============= [PASSED] drm_format_helper_test ==============
[12:22:32] ================= drm_format (18 subtests) =================
[12:22:32] [PASSED] drm_test_format_block_width_invalid
[12:22:32] [PASSED] drm_test_format_block_width_one_plane
[12:22:32] [PASSED] drm_test_format_block_width_two_plane
[12:22:32] [PASSED] drm_test_format_block_width_three_plane
[12:22:32] [PASSED] drm_test_format_block_width_tiled
[12:22:32] [PASSED] drm_test_format_block_height_invalid
[12:22:32] [PASSED] drm_test_format_block_height_one_plane
[12:22:32] [PASSED] drm_test_format_block_height_two_plane
[12:22:32] [PASSED] drm_test_format_block_height_three_plane
[12:22:32] [PASSED] drm_test_format_block_height_tiled
[12:22:32] [PASSED] drm_test_format_min_pitch_invalid
[12:22:32] [PASSED] drm_test_format_min_pitch_one_plane_8bpp
[12:22:32] [PASSED] drm_test_format_min_pitch_one_plane_16bpp
[12:22:32] [PASSED] drm_test_format_min_pitch_one_plane_24bpp
[12:22:32] [PASSED] drm_test_format_min_pitch_one_plane_32bpp
[12:22:32] [PASSED] drm_test_format_min_pitch_two_plane
[12:22:32] [PASSED] drm_test_format_min_pitch_three_plane_8bpp
[12:22:32] [PASSED] drm_test_format_min_pitch_tiled
[12:22:32] =================== [PASSED] drm_format ====================
[12:22:32] =============== drm_framebuffer (1 subtest) ================
[12:22:32] =============== drm_test_framebuffer_create  ===============
[12:22:32] [PASSED] ABGR8888 normal sizes
[12:22:32] [PASSED] ABGR8888 max sizes
[12:22:32] [PASSED] ABGR8888 pitch greater than min required
[12:22:32] [PASSED] ABGR8888 pitch less than min required
[12:22:32] [PASSED] ABGR8888 Invalid width
[12:22:32] [PASSED] ABGR8888 Invalid buffer handle
[12:22:32] [PASSED] No pixel format
[12:22:32] [PASSED] ABGR8888 Width 0
[12:22:32] [PASSED] ABGR8888 Height 0
[12:22:32] [PASSED] ABGR8888 Out of bound height * pitch combination
[12:22:32] [PASSED] ABGR8888 Large buffer offset
[12:22:32] [PASSED] ABGR8888 Set DRM_MODE_FB_MODIFIERS without modifiers
[12:22:32] [PASSED] ABGR8888 Valid buffer modifier
[12:22:32] [PASSED] ABGR8888 Invalid buffer modifier(DRM_FORMAT_MOD_SAMSUNG_64_32_TILE)
[12:22:32] [PASSED] ABGR8888 Extra pitches without DRM_MODE_FB_MODIFIERS
[12:22:32] [PASSED] ABGR8888 Extra pitches with DRM_MODE_FB_MODIFIERS
[12:22:32] [PASSED] NV12 Normal sizes
[12:22:32] [PASSED] NV12 Max sizes
[12:22:32] [PASSED] NV12 Invalid pitch
[12:22:32] [PASSED] NV12 Invalid modifier/missing DRM_MODE_FB_MODIFIERS flag
[12:22:32] [PASSED] NV12 different  modifier per-plane
[12:22:32] [PASSED] NV12 with DRM_FORMAT_MOD_SAMSUNG_64_32_TILE
[12:22:32] [PASSED] NV12 Valid modifiers without DRM_MODE_FB_MODIFIERS
[12:22:32] [PASSED] NV12 Modifier for inexistent plane
[12:22:32] [PASSED] NV12 Handle for inexistent plane
[12:22:32] [PASSED] NV12 Handle for inexistent plane without DRM_MODE_FB_MODIFIERS
[12:22:32] [PASSED] YVU420 DRM_MODE_FB_MODIFIERS set without modifier
[12:22:32] [PASSED] YVU420 Normal sizes
[12:22:32] [PASSED] YVU420 Max sizes
[12:22:32] [PASSED] YVU420 Invalid pitch
[12:22:32] [PASSED] YVU420 Different pitches
[12:22:32] [PASSED] YVU420 Different buffer offsets/pitches
[12:22:32] [PASSED] YVU420 Modifier set just for plane 0, without DRM_MODE_FB_MODIFIERS
[12:22:32] [PASSED] YVU420 Modifier set just for planes 0, 1, without DRM_MODE_FB_MODIFIERS
[12:22:32] [PASSED] YVU420 Modifier set just for plane 0, 1, with DRM_MODE_FB_MODIFIERS
[12:22:32] [PASSED] YVU420 Valid modifier
[12:22:32] [PASSED] YVU420 Different modifiers per plane
[12:22:32] [PASSED] YVU420 Modifier for inexistent plane
[12:22:32] [PASSED] X0L2 Normal sizes
[12:22:32] [PASSED] X0L2 Max sizes
[12:22:32] [PASSED] X0L2 Invalid pitch
[12:22:32] [PASSED] X0L2 Pitch greater than minimum required
[12:22:32] [PASSED] X0L2 Handle for inexistent plane
[12:22:32] [PASSED] X0L2 Offset for inexistent plane, without DRM_MODE_FB_MODIFIERS set
[12:22:32] [PASSED] X0L2 Modifier without DRM_MODE_FB_MODIFIERS set
[12:22:32] [PASSED] X0L2 Valid modifier
[12:22:32] [PASSED] X0L2 Modifier for inexistent plane
[12:22:32] =========== [PASSED] drm_test_framebuffer_create ===========
[12:22:32] ================= [PASSED] drm_framebuffer =================
[12:22:32] ================ drm_gem_shmem (8 subtests) ================
[12:22:32] [PASSED] drm_gem_shmem_test_obj_create
[12:22:32] [PASSED] drm_gem_shmem_test_obj_create_private
[12:22:32] [PASSED] drm_gem_shmem_test_pin_pages
[12:22:32] [PASSED] drm_gem_shmem_test_vmap
[12:22:32] [PASSED] drm_gem_shmem_test_get_pages_sgt
[12:22:32] [PASSED] drm_gem_shmem_test_get_sg_table
[12:22:32] [PASSED] drm_gem_shmem_test_madvise
[12:22:32] [PASSED] drm_gem_shmem_test_purge
[12:22:32] ================== [PASSED] drm_gem_shmem ==================
[12:22:32] ================= drm_managed (2 subtests) =================
[12:22:32] [PASSED] drm_test_managed_release_action
[12:22:32] [PASSED] drm_test_managed_run_action
[12:22:32] =================== [PASSED] drm_managed ===================
[12:22:32] =================== drm_mm (6 subtests) ====================
[12:22:32] [PASSED] drm_test_mm_init
[12:22:32] [PASSED] drm_test_mm_debug
[12:22:32] [PASSED] drm_test_mm_align32
[12:22:32] [PASSED] drm_test_mm_align64
[12:22:32] [PASSED] drm_test_mm_lowest
[12:22:32] [PASSED] drm_test_mm_highest
[12:22:32] ===================== [PASSED] drm_mm ======================
[12:22:32] ============= drm_modes_analog_tv (4 subtests) =============
[12:22:32] [PASSED] drm_test_modes_analog_tv_ntsc_480i
[12:22:32] [PASSED] drm_test_modes_analog_tv_ntsc_480i_inlined
[12:22:32] [PASSED] drm_test_modes_analog_tv_pal_576i
[12:22:32] [PASSED] drm_test_modes_analog_tv_pal_576i_inlined
[12:22:32] =============== [PASSED] drm_modes_analog_tv ===============
[12:22:32] ============== drm_plane_helper (2 subtests) ===============
[12:22:32] =============== drm_test_check_plane_state  ================
[12:22:32] [PASSED] clipping_simple
[12:22:32] [PASSED] clipping_rotate_reflect
[12:22:32] [PASSED] positioning_simple
[12:22:32] [PASSED] upscaling
[12:22:32] [PASSED] downscaling
[12:22:32] [PASSED] rounding1
[12:22:32] [PASSED] rounding2
[12:22:32] [PASSED] rounding3
[12:22:32] [PASSED] rounding4
[12:22:32] =========== [PASSED] drm_test_check_plane_state ============
[12:22:32] =========== drm_test_check_invalid_plane_state  ============
[12:22:32] [PASSED] positioning_invalid
[12:22:32] [PASSED] upscaling_invalid
[12:22:32] [PASSED] downscaling_invalid
[12:22:32] ======= [PASSED] drm_test_check_invalid_plane_state ========
[12:22:32] ================ [PASSED] drm_plane_helper =================
[12:22:32] ====== drm_connector_helper_tv_get_modes (1 subtest) =======
[12:22:32] ====== drm_test_connector_helper_tv_get_modes_check  =======
[12:22:32] [PASSED] None
[12:22:32] [PASSED] PAL
[12:22:32] [PASSED] NTSC
[12:22:32] [PASSED] Both, NTSC Default
[12:22:32] [PASSED] Both, PAL Default
[12:22:32] [PASSED] Both, NTSC Default, with PAL on command-line
[12:22:32] [PASSED] Both, PAL Default, with NTSC on command-line
[12:22:32] == [PASSED] drm_test_connector_helper_tv_get_modes_check ===
[12:22:32] ======== [PASSED] drm_connector_helper_tv_get_modes ========
[12:22:32] ================== drm_rect (9 subtests) ===================
[12:22:32] [PASSED] drm_test_rect_clip_scaled_div_by_zero
[12:22:32] [PASSED] drm_test_rect_clip_scaled_not_clipped
[12:22:32] [PASSED] drm_test_rect_clip_scaled_clipped
stty: 'standard input': Inappropriate ioctl for device
[12:22:32] [PASSED] drm_test_rect_clip_scaled_signed_vs_unsigned
[12:22:32] ================= drm_test_rect_intersect  =================
[12:22:32] [PASSED] top-left x bottom-right: 2x2+1+1 x 2x2+0+0
[12:22:32] [PASSED] top-right x bottom-left: 2x2+0+0 x 2x2+1-1
[12:22:32] [PASSED] bottom-left x top-right: 2x2+1-1 x 2x2+0+0
[12:22:32] [PASSED] bottom-right x top-left: 2x2+0+0 x 2x2+1+1
[12:22:32] [PASSED] right x left: 2x1+0+0 x 3x1+1+0
[12:22:32] [PASSED] left x right: 3x1+1+0 x 2x1+0+0
[12:22:32] [PASSED] up x bottom: 1x2+0+0 x 1x3+0-1
[12:22:32] [PASSED] bottom x up: 1x3+0-1 x 1x2+0+0
[12:22:32] [PASSED] touching corner: 1x1+0+0 x 2x2+1+1
[12:22:32] [PASSED] touching side: 1x1+0+0 x 1x1+1+0
[12:22:32] [PASSED] equal rects: 2x2+0+0 x 2x2+0+0
[12:22:32] [PASSED] inside another: 2x2+0+0 x 1x1+1+1
[12:22:32] [PASSED] far away: 1x1+0+0 x 1x1+3+6
[12:22:32] [PASSED] points intersecting: 0x0+5+10 x 0x0+5+10
[12:22:32] [PASSED] points not intersecting: 0x0+0+0 x 0x0+5+10
[12:22:32] ============= [PASSED] drm_test_rect_intersect =============
[12:22:32] ================ drm_test_rect_calc_hscale  ================
[12:22:32] [PASSED] normal use
[12:22:32] [PASSED] out of max range
[12:22:32] [PASSED] out of min range
[12:22:32] [PASSED] zero dst
[12:22:32] [PASSED] negative src
[12:22:32] [PASSED] negative dst
[12:22:32] ============ [PASSED] drm_test_rect_calc_hscale ============
[12:22:32] ================ drm_test_rect_calc_vscale  ================
[12:22:32] [PASSED] normal use
[12:22:32] [PASSED] out of max range
[12:22:32] [PASSED] out of min range
[12:22:32] [PASSED] zero dst
[12:22:32] [PASSED] negative src
[12:22:32] [PASSED] negative dst
[12:22:32] ============ [PASSED] drm_test_rect_calc_vscale ============
[12:22:32] ================== drm_test_rect_rotate  ===================
[12:22:32] [PASSED] reflect-x
[12:22:32] [PASSED] reflect-y
[12:22:32] [PASSED] rotate-0
[12:22:32] [PASSED] rotate-90
[12:22:32] [PASSED] rotate-180
[12:22:32] [PASSED] rotate-270
[12:22:32] ============== [PASSED] drm_test_rect_rotate ===============
[12:22:32] ================ drm_test_rect_rotate_inv  =================
[12:22:32] [PASSED] reflect-x
[12:22:32] [PASSED] reflect-y
[12:22:32] [PASSED] rotate-0
[12:22:32] [PASSED] rotate-90
[12:22:32] [PASSED] rotate-180
[12:22:32] [PASSED] rotate-270
[12:22:32] ============ [PASSED] drm_test_rect_rotate_inv =============
[12:22:32] ==================== [PASSED] drm_rect =====================
[12:22:32] ============================================================
[12:22:32] Testing complete. Ran 417 tests: passed: 417
[12:22:32] Elapsed time: 23.653s total, 1.663s configuring, 21.806s building, 0.147s running

+ cleanup
++ stat -c %u:%g /kernel
+ chown -R 1003:1003 /kernel



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

* Re: [PATCH 2/8] drm/xe: covert sysfs over to devm
  2024-04-29 12:14 ` [PATCH 2/8] drm/xe: covert sysfs " Matthew Auld
@ 2024-04-29 13:28   ` Rodrigo Vivi
  2024-04-29 13:52     ` Lucas De Marchi
  2024-05-06  8:07   ` [PATCH 2/8] drm/xe: covert sysfs over to devm Andrzej Hajda
  1 sibling, 1 reply; 28+ messages in thread
From: Rodrigo Vivi @ 2024-04-29 13:28 UTC (permalink / raw)
  To: Matthew Auld; +Cc: intel-xe

On Mon, Apr 29, 2024 at 01:14:38PM +0100, Matthew Auld wrote:
> Hotunplugging the device seems to result in stuff like:
> 
> kobject_add_internal failed for tile0 with -EEXIST, don't try to
> register things with the same name in the same directory.
> 
> We only remove the sysfs as part of drmm, however that is tied to the
> lifetime of the driver instance and not the device underneath. Attempt
> to fix by using devm for all of the remaining sysfs stuff related to the
> device.

hmmm... so basically we should use the drmm only for the global module
stuff and the devm for things that are per device?

> 
> Closes: https://gitlab.freedesktop.org/dt srm/xe/kernel/-/issues/1667
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_gt_ccs_mode.c           |  4 ++--
>  drivers/gpu/drm/xe/xe_gt_freq.c               |  4 ++--
>  drivers/gpu/drm/xe/xe_gt_idle.c               |  4 ++--
>  drivers/gpu/drm/xe/xe_gt_sysfs.c              |  4 ++--
>  drivers/gpu/drm/xe/xe_gt_throttle_sysfs.c     |  4 ++--
>  drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c | 12 ++++++------
>  drivers/gpu/drm/xe/xe_tile_sysfs.c            |  4 ++--
>  drivers/gpu/drm/xe/xe_vram_freq.c             |  4 ++--
>  8 files changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_gt_ccs_mode.c b/drivers/gpu/drm/xe/xe_gt_ccs_mode.c
> index 396aeb5b9924..890da8870b0d 100644
> --- a/drivers/gpu/drm/xe/xe_gt_ccs_mode.c
> +++ b/drivers/gpu/drm/xe/xe_gt_ccs_mode.c
> @@ -150,7 +150,7 @@ static const struct attribute *gt_ccs_mode_attrs[] = {
>  	NULL,
>  };
>  
> -static void xe_gt_ccs_mode_sysfs_fini(struct drm_device *drm, void *arg)
> +static void xe_gt_ccs_mode_sysfs_fini(void *arg)
>  {
>  	struct xe_gt *gt = arg;
>  
> @@ -182,5 +182,5 @@ int xe_gt_ccs_mode_sysfs_init(struct xe_gt *gt)
>  	if (err)
>  		return err;
>  
> -	return drmm_add_action_or_reset(&xe->drm, xe_gt_ccs_mode_sysfs_fini, gt);
> +	return devm_add_action_or_reset(xe->drm.dev, xe_gt_ccs_mode_sysfs_fini, gt);
>  }
> diff --git a/drivers/gpu/drm/xe/xe_gt_freq.c b/drivers/gpu/drm/xe/xe_gt_freq.c
> index 855de40e40ea..e0305942644c 100644
> --- a/drivers/gpu/drm/xe/xe_gt_freq.c
> +++ b/drivers/gpu/drm/xe/xe_gt_freq.c
> @@ -209,7 +209,7 @@ static const struct attribute *freq_attrs[] = {
>  	NULL
>  };
>  
> -static void freq_fini(struct drm_device *drm, void *arg)
> +static void freq_fini(void *arg)
>  {
>  	struct kobject *kobj = arg;
>  
> @@ -237,7 +237,7 @@ int xe_gt_freq_init(struct xe_gt *gt)
>  	if (!gt->freq)
>  		return -ENOMEM;
>  
> -	err = drmm_add_action_or_reset(&xe->drm, freq_fini, gt->freq);
> +	err = devm_add_action(xe->drm.dev, freq_fini, gt->freq);
>  	if (err)
>  		return err;
>  
> diff --git a/drivers/gpu/drm/xe/xe_gt_idle.c b/drivers/gpu/drm/xe/xe_gt_idle.c
> index 8fc0f3f6ecc5..9e907033f32b 100644
> --- a/drivers/gpu/drm/xe/xe_gt_idle.c
> +++ b/drivers/gpu/drm/xe/xe_gt_idle.c
> @@ -144,7 +144,7 @@ static const struct attribute *gt_idle_attrs[] = {
>  	NULL,
>  };
>  
> -static void gt_idle_sysfs_fini(struct drm_device *drm, void *arg)
> +static void gt_idle_sysfs_fini(void *arg)
>  {
>  	struct kobject *kobj = arg;
>  
> @@ -181,7 +181,7 @@ int xe_gt_idle_sysfs_init(struct xe_gt_idle *gtidle)
>  		return err;
>  	}
>  
> -	return drmm_add_action_or_reset(&xe->drm, gt_idle_sysfs_fini, kobj);
> +	return devm_add_action_or_reset(xe->drm.dev, gt_idle_sysfs_fini, kobj);
>  }
>  
>  void xe_gt_idle_enable_c6(struct xe_gt *gt)
> diff --git a/drivers/gpu/drm/xe/xe_gt_sysfs.c b/drivers/gpu/drm/xe/xe_gt_sysfs.c
> index 1e5971072bc8..a05c3699e8b9 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sysfs.c
> @@ -22,7 +22,7 @@ static const struct kobj_type xe_gt_sysfs_kobj_type = {
>  	.sysfs_ops = &kobj_sysfs_ops,
>  };
>  
> -static void gt_sysfs_fini(struct drm_device *drm, void *arg)
> +static void gt_sysfs_fini(void *arg)
>  {
>  	struct xe_gt *gt = arg;
>  
> @@ -51,5 +51,5 @@ int xe_gt_sysfs_init(struct xe_gt *gt)
>  
>  	gt->sysfs = &kg->base;
>  
> -	return drmm_add_action_or_reset(&xe->drm, gt_sysfs_fini, gt);
> +	return devm_add_action(xe->drm.dev, gt_sysfs_fini, gt);
>  }
> diff --git a/drivers/gpu/drm/xe/xe_gt_throttle_sysfs.c b/drivers/gpu/drm/xe/xe_gt_throttle_sysfs.c
> index fbe21a8599ca..c9e04151286d 100644
> --- a/drivers/gpu/drm/xe/xe_gt_throttle_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_gt_throttle_sysfs.c
> @@ -229,7 +229,7 @@ static const struct attribute_group throttle_group_attrs = {
>  	.attrs = throttle_attrs,
>  };
>  
> -static void gt_throttle_sysfs_fini(struct drm_device *drm, void *arg)
> +static void gt_throttle_sysfs_fini(void *arg)
>  {
>  	struct xe_gt *gt = arg;
>  
> @@ -245,5 +245,5 @@ int xe_gt_throttle_sysfs_init(struct xe_gt *gt)
>  	if (err)
>  		return err;
>  
> -	return drmm_add_action_or_reset(&xe->drm, gt_throttle_sysfs_fini, gt);
> +	return devm_add_action_or_reset(xe->drm.dev, gt_throttle_sysfs_fini, gt);
>  }
> diff --git a/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c b/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c
> index 844ec68cbbb8..258078a6b461 100644
> --- a/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c
> @@ -492,7 +492,7 @@ static const struct attribute * const files[] = {
>  	NULL
>  };
>  
> -static void kobj_xe_hw_engine_class_fini(struct drm_device *drm, void *arg)
> +static void kobj_xe_hw_engine_class_fini(void *arg)
>  {
>  	struct kobject *kobj = arg;
>  
> @@ -517,7 +517,7 @@ kobj_xe_hw_engine_class(struct xe_device *xe, struct kobject *parent, const char
>  	}
>  	keclass->xe = xe;
>  
> -	err = drmm_add_action_or_reset(&xe->drm, kobj_xe_hw_engine_class_fini,
> +	err = devm_add_action_or_reset(xe->drm.dev, kobj_xe_hw_engine_class_fini,
>  				       &keclass->base);
>  	if (err)
>  		return NULL;
> @@ -525,7 +525,7 @@ kobj_xe_hw_engine_class(struct xe_device *xe, struct kobject *parent, const char
>  	return keclass;
>  }
>  
> -static void hw_engine_class_defaults_fini(struct drm_device *drm, void *arg)
> +static void hw_engine_class_defaults_fini(void *arg)
>  {
>  	struct kobject *kobj = arg;
>  
> @@ -552,7 +552,7 @@ static int xe_add_hw_engine_class_defaults(struct xe_device *xe,
>  	if (err)
>  		goto err_object;
>  
> -	return drmm_add_action_or_reset(&xe->drm, hw_engine_class_defaults_fini, kobj);
> +	return devm_add_action_or_reset(xe->drm.dev, hw_engine_class_defaults_fini, kobj);
>  
>  err_object:
>  	kobject_put(kobj);
> @@ -611,7 +611,7 @@ static const struct kobj_type xe_hw_engine_sysfs_kobj_type = {
>  	.sysfs_ops = &xe_hw_engine_class_sysfs_ops,
>  };
>  
> -static void hw_engine_class_sysfs_fini(struct drm_device *drm, void *arg)
> +static void hw_engine_class_sysfs_fini(void *arg)
>  {
>  	struct kobject *kobj = arg;
>  
> @@ -698,7 +698,7 @@ int xe_hw_engine_class_sysfs_init(struct xe_gt *gt)
>  			goto err_object;
>  	}
>  
> -	return drmm_add_action_or_reset(&xe->drm, hw_engine_class_sysfs_fini, kobj);
> +	return devm_add_action_or_reset(xe->drm.dev, hw_engine_class_sysfs_fini, kobj);
>  
>  err_object:
>  	kobject_put(kobj);
> diff --git a/drivers/gpu/drm/xe/xe_tile_sysfs.c b/drivers/gpu/drm/xe/xe_tile_sysfs.c
> index 64661403afcd..b804234a6551 100644
> --- a/drivers/gpu/drm/xe/xe_tile_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_tile_sysfs.c
> @@ -22,7 +22,7 @@ static const struct kobj_type xe_tile_sysfs_kobj_type = {
>  	.sysfs_ops = &kobj_sysfs_ops,
>  };
>  
> -static void tile_sysfs_fini(struct drm_device *drm, void *arg)
> +static void tile_sysfs_fini(void *arg)
>  {
>  	struct xe_tile *tile = arg;
>  
> @@ -55,5 +55,5 @@ int xe_tile_sysfs_init(struct xe_tile *tile)
>  	if (err)
>  		return err;
>  
> -	return drmm_add_action_or_reset(&xe->drm, tile_sysfs_fini, tile);
> +	return devm_add_action_or_reset(xe->drm.dev, tile_sysfs_fini, tile);
>  }
> diff --git a/drivers/gpu/drm/xe/xe_vram_freq.c b/drivers/gpu/drm/xe/xe_vram_freq.c
> index 3e21ddc6e60c..99ff95e408e0 100644
> --- a/drivers/gpu/drm/xe/xe_vram_freq.c
> +++ b/drivers/gpu/drm/xe/xe_vram_freq.c
> @@ -87,7 +87,7 @@ static const struct attribute_group freq_group_attrs = {
>  	.attrs = freq_attrs,
>  };
>  
> -static void vram_freq_sysfs_fini(struct drm_device *drm, void *arg)
> +static void vram_freq_sysfs_fini(void *arg)
>  {
>  	struct kobject *kobj = arg;
>  
> @@ -122,5 +122,5 @@ int xe_vram_freq_sysfs_init(struct xe_tile *tile)
>  		return err;
>  	}
>  
> -	return drmm_add_action_or_reset(&xe->drm, vram_freq_sysfs_fini, kobj);
> +	return devm_add_action_or_reset(xe->drm.dev, vram_freq_sysfs_fini, kobj);
>  }
> -- 
> 2.44.0
> 

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

* Re: [PATCH 2/8] drm/xe: covert sysfs over to devm
  2024-04-29 13:28   ` Rodrigo Vivi
@ 2024-04-29 13:52     ` Lucas De Marchi
  2024-04-29 15:17       ` Matthew Auld
  0 siblings, 1 reply; 28+ messages in thread
From: Lucas De Marchi @ 2024-04-29 13:52 UTC (permalink / raw)
  To: Rodrigo Vivi; +Cc: Matthew Auld, intel-xe

On Mon, Apr 29, 2024 at 09:28:00AM GMT, Rodrigo Vivi wrote:
>On Mon, Apr 29, 2024 at 01:14:38PM +0100, Matthew Auld wrote:
>> Hotunplugging the device seems to result in stuff like:
>>
>> kobject_add_internal failed for tile0 with -EEXIST, don't try to
>> register things with the same name in the same directory.
>>
>> We only remove the sysfs as part of drmm, however that is tied to the
>> lifetime of the driver instance and not the device underneath. Attempt
>> to fix by using devm for all of the remaining sysfs stuff related to the
>> device.
>
>hmmm... so basically we should use the drmm only for the global module
>stuff and the devm for things that are per device?

that doesn't make much sense. drmm is supposed to run when the driver
unbinds from the device... basically when all refcounts are gone with
drm_dev_put().  Are we keeping a ref we shouldn't?

Lucas De Marchi

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

* Re: [PATCH 2/8] drm/xe: covert sysfs over to devm
  2024-04-29 13:52     ` Lucas De Marchi
@ 2024-04-29 15:17       ` Matthew Auld
  2024-04-29 18:45         ` Rodrigo Vivi
  0 siblings, 1 reply; 28+ messages in thread
From: Matthew Auld @ 2024-04-29 15:17 UTC (permalink / raw)
  To: Lucas De Marchi, Rodrigo Vivi; +Cc: intel-xe

On 29/04/2024 14:52, Lucas De Marchi wrote:
> On Mon, Apr 29, 2024 at 09:28:00AM GMT, Rodrigo Vivi wrote:
>> On Mon, Apr 29, 2024 at 01:14:38PM +0100, Matthew Auld wrote:
>>> Hotunplugging the device seems to result in stuff like:
>>>
>>> kobject_add_internal failed for tile0 with -EEXIST, don't try to
>>> register things with the same name in the same directory.
>>>
>>> We only remove the sysfs as part of drmm, however that is tied to the
>>> lifetime of the driver instance and not the device underneath. Attempt
>>> to fix by using devm for all of the remaining sysfs stuff related to the
>>> device.
>>
>> hmmm... so basically we should use the drmm only for the global module
>> stuff and the devm for things that are per device?
> 
> that doesn't make much sense. drmm is supposed to run when the driver
> unbinds from the device... basically when all refcounts are gone with
> drm_dev_put().  Are we keeping a ref we shouldn't?

It's run when all refcounts are dropped for that particular drm_device, 
but that is separate from the physical device underneath (struct 
device). For example if something has an open driver fd the drmm release 
action is not going to be called until after that is also closed. But in 
the meantime we might have already removed the pci device and 
re-attached it to a newly allocated drm_device/xe_driver instance, like 
with hotunplug.

For example, currently we don't even call basic stuff like guc_fini() 
etc. when removing the pci device, but rather when the drm_device is 
released, which sounds quite broken.

So roughly drmm is for drm_device software level stuff and devm is for 
stuff that needs to happen when removing the device. See also the doc 
for drmm:
https://elixir.bootlin.com/linux/v6.8-rc1/source/drivers/gpu/drm/drm_managed.c#L23

Also: https://docs.kernel.org/gpu/drm-uapi.html#device-hot-unplug

> 
> Lucas De Marchi

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

* Re: [PATCH 2/8] drm/xe: covert sysfs over to devm
  2024-04-29 15:17       ` Matthew Auld
@ 2024-04-29 18:45         ` Rodrigo Vivi
  2024-04-29 21:28           ` Lucas De Marchi
  0 siblings, 1 reply; 28+ messages in thread
From: Rodrigo Vivi @ 2024-04-29 18:45 UTC (permalink / raw)
  To: Matthew Auld, aravind.iddamsetty, michal.winiarski
  Cc: Lucas De Marchi, intel-xe

On Mon, Apr 29, 2024 at 04:17:54PM +0100, Matthew Auld wrote:
> On 29/04/2024 14:52, Lucas De Marchi wrote:
> > On Mon, Apr 29, 2024 at 09:28:00AM GMT, Rodrigo Vivi wrote:
> > > On Mon, Apr 29, 2024 at 01:14:38PM +0100, Matthew Auld wrote:
> > > > Hotunplugging the device seems to result in stuff like:
> > > > 
> > > > kobject_add_internal failed for tile0 with -EEXIST, don't try to
> > > > register things with the same name in the same directory.
> > > > 
> > > > We only remove the sysfs as part of drmm, however that is tied to the
> > > > lifetime of the driver instance and not the device underneath. Attempt
> > > > to fix by using devm for all of the remaining sysfs stuff related to the
> > > > device.
> > > 
> > > hmmm... so basically we should use the drmm only for the global module
> > > stuff and the devm for things that are per device?
> > 
> > that doesn't make much sense. drmm is supposed to run when the driver
> > unbinds from the device... basically when all refcounts are gone with
> > drm_dev_put().  Are we keeping a ref we shouldn't?
> 
> It's run when all refcounts are dropped for that particular drm_device, but
> that is separate from the physical device underneath (struct device). For
> example if something has an open driver fd the drmm release action is not
> going to be called until after that is also closed. But in the meantime we
> might have already removed the pci device and re-attached it to a newly
> allocated drm_device/xe_driver instance, like with hotunplug.
> 
> For example, currently we don't even call basic stuff like guc_fini() etc.
> when removing the pci device, but rather when the drm_device is released,
> which sounds quite broken.
> 
> So roughly drmm is for drm_device software level stuff and devm is for stuff
> that needs to happen when removing the device. See also the doc for drmm:
> https://elixir.bootlin.com/linux/v6.8-rc1/source/drivers/gpu/drm/drm_managed.c#L23
> 
> Also: https://docs.kernel.org/gpu/drm-uapi.html#device-hot-unplug

Cc: Aravind and Michal since this likely relates to the FLR discussion...

but it looks to me that we should move more towards the devm_ and limit
the usage of drmm_ to some very specific cases...

> 
> > 
> > Lucas De Marchi

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

* Re: [PATCH 2/8] drm/xe: covert sysfs over to devm
  2024-04-29 18:45         ` Rodrigo Vivi
@ 2024-04-29 21:28           ` Lucas De Marchi
  2024-04-30  8:43             ` Jani Nikula
  2024-04-30 13:29             ` drmm vs devm (was Re: [PATCH 2/8] drm/xe: covert sysfs over to devm) Daniel Vetter
  0 siblings, 2 replies; 28+ messages in thread
From: Lucas De Marchi @ 2024-04-29 21:28 UTC (permalink / raw)
  To: Rodrigo Vivi; +Cc: Matthew Auld, aravind.iddamsetty, michal.winiarski, intel-xe

On Mon, Apr 29, 2024 at 02:45:26PM GMT, Rodrigo Vivi wrote:
>On Mon, Apr 29, 2024 at 04:17:54PM +0100, Matthew Auld wrote:
>> On 29/04/2024 14:52, Lucas De Marchi wrote:
>> > On Mon, Apr 29, 2024 at 09:28:00AM GMT, Rodrigo Vivi wrote:
>> > > On Mon, Apr 29, 2024 at 01:14:38PM +0100, Matthew Auld wrote:
>> > > > Hotunplugging the device seems to result in stuff like:
>> > > >
>> > > > kobject_add_internal failed for tile0 with -EEXIST, don't try to
>> > > > register things with the same name in the same directory.
>> > > >
>> > > > We only remove the sysfs as part of drmm, however that is tied to the
>> > > > lifetime of the driver instance and not the device underneath. Attempt
>> > > > to fix by using devm for all of the remaining sysfs stuff related to the
>> > > > device.
>> > >
>> > > hmmm... so basically we should use the drmm only for the global module
>> > > stuff and the devm for things that are per device?
>> >
>> > that doesn't make much sense. drmm is supposed to run when the driver
>> > unbinds from the device... basically when all refcounts are gone with
>> > drm_dev_put().  Are we keeping a ref we shouldn't?
>>
>> It's run when all refcounts are dropped for that particular drm_device, but
>> that is separate from the physical device underneath (struct device). For
>> example if something has an open driver fd the drmm release action is not
>> going to be called until after that is also closed. But in the meantime we
>> might have already removed the pci device and re-attached it to a newly
>> allocated drm_device/xe_driver instance, like with hotunplug.
>>
>> For example, currently we don't even call basic stuff like guc_fini() etc.
>> when removing the pci device, but rather when the drm_device is released,
>> which sounds quite broken.
>>
>> So roughly drmm is for drm_device software level stuff and devm is for stuff
>> that needs to happen when removing the device. See also the doc for drmm:
>> https://elixir.bootlin.com/linux/v6.8-rc1/source/drivers/gpu/drm/drm_managed.c#L23
>>
>> Also: https://docs.kernel.org/gpu/drm-uapi.html#device-hot-unplug

yeah... I think you convinced me

>
>Cc: Aravind and Michal since this likely relates to the FLR discussion...
>
>but it looks to me that we should move more towards the devm_ and limit
>the usage of drmm_ to some very specific cases...

agreed,

Lucas De Marchi

>
>>
>> >
>> > Lucas De Marchi

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

* Re: [PATCH 2/8] drm/xe: covert sysfs over to devm
  2024-04-29 21:28           ` Lucas De Marchi
@ 2024-04-30  8:43             ` Jani Nikula
  2024-04-30  9:42               ` Aravind Iddamsetty
  2024-04-30 13:29             ` drmm vs devm (was Re: [PATCH 2/8] drm/xe: covert sysfs over to devm) Daniel Vetter
  1 sibling, 1 reply; 28+ messages in thread
From: Jani Nikula @ 2024-04-30  8:43 UTC (permalink / raw)
  To: Lucas De Marchi, Rodrigo Vivi
  Cc: Matthew Auld, aravind.iddamsetty, michal.winiarski, intel-xe

On Mon, 29 Apr 2024, Lucas De Marchi <lucas.demarchi@intel.com> wrote:
> On Mon, Apr 29, 2024 at 02:45:26PM GMT, Rodrigo Vivi wrote:
>>On Mon, Apr 29, 2024 at 04:17:54PM +0100, Matthew Auld wrote:
>>> On 29/04/2024 14:52, Lucas De Marchi wrote:
>>> > On Mon, Apr 29, 2024 at 09:28:00AM GMT, Rodrigo Vivi wrote:
>>> > > On Mon, Apr 29, 2024 at 01:14:38PM +0100, Matthew Auld wrote:
>>> > > > Hotunplugging the device seems to result in stuff like:
>>> > > >
>>> > > > kobject_add_internal failed for tile0 with -EEXIST, don't try to
>>> > > > register things with the same name in the same directory.
>>> > > >
>>> > > > We only remove the sysfs as part of drmm, however that is tied to the
>>> > > > lifetime of the driver instance and not the device underneath. Attempt
>>> > > > to fix by using devm for all of the remaining sysfs stuff related to the
>>> > > > device.
>>> > >
>>> > > hmmm... so basically we should use the drmm only for the global module
>>> > > stuff and the devm for things that are per device?
>>> >
>>> > that doesn't make much sense. drmm is supposed to run when the driver
>>> > unbinds from the device... basically when all refcounts are gone with
>>> > drm_dev_put().  Are we keeping a ref we shouldn't?
>>>
>>> It's run when all refcounts are dropped for that particular drm_device, but
>>> that is separate from the physical device underneath (struct device). For
>>> example if something has an open driver fd the drmm release action is not
>>> going to be called until after that is also closed. But in the meantime we
>>> might have already removed the pci device and re-attached it to a newly
>>> allocated drm_device/xe_driver instance, like with hotunplug.
>>>
>>> For example, currently we don't even call basic stuff like guc_fini() etc.
>>> when removing the pci device, but rather when the drm_device is released,
>>> which sounds quite broken.
>>>
>>> So roughly drmm is for drm_device software level stuff and devm is for stuff
>>> that needs to happen when removing the device. See also the doc for drmm:
>>> https://elixir.bootlin.com/linux/v6.8-rc1/source/drivers/gpu/drm/drm_managed.c#L23
>>>
>>> Also: https://docs.kernel.org/gpu/drm-uapi.html#device-hot-unplug
>
> yeah... I think you convinced me

You've all also convinced me this is a PITA to get right for every
contribution. If there's one thing I've learned, people will just cargo
cult this stuff, and pick one or the other depending on what they happen
to see. Needs vigilant review.

BR,
Jani.


>
>>
>>Cc: Aravind and Michal since this likely relates to the FLR discussion...
>>
>>but it looks to me that we should move more towards the devm_ and limit
>>the usage of drmm_ to some very specific cases...
>
> agreed,
>
> Lucas De Marchi
>
>>
>>>
>>> >
>>> > Lucas De Marchi

-- 
Jani Nikula, Intel

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

* Re: [PATCH 2/8] drm/xe: covert sysfs over to devm
  2024-04-30  8:43             ` Jani Nikula
@ 2024-04-30  9:42               ` Aravind Iddamsetty
  2024-04-30 10:51                 ` Matthew Auld
  0 siblings, 1 reply; 28+ messages in thread
From: Aravind Iddamsetty @ 2024-04-30  9:42 UTC (permalink / raw)
  To: Jani Nikula, Lucas De Marchi, Rodrigo Vivi
  Cc: Matthew Auld, michal.winiarski, intel-xe


On 30/04/24 14:13, Jani Nikula wrote:
> On Mon, 29 Apr 2024, Lucas De Marchi <lucas.demarchi@intel.com> wrote:
>> On Mon, Apr 29, 2024 at 02:45:26PM GMT, Rodrigo Vivi wrote:
>>> On Mon, Apr 29, 2024 at 04:17:54PM +0100, Matthew Auld wrote:
>>>> On 29/04/2024 14:52, Lucas De Marchi wrote:
>>>>> On Mon, Apr 29, 2024 at 09:28:00AM GMT, Rodrigo Vivi wrote:
>>>>>> On Mon, Apr 29, 2024 at 01:14:38PM +0100, Matthew Auld wrote:
>>>>>>> Hotunplugging the device seems to result in stuff like:
>>>>>>>
>>>>>>> kobject_add_internal failed for tile0 with -EEXIST, don't try to
>>>>>>> register things with the same name in the same directory.
>>>>>>>
>>>>>>> We only remove the sysfs as part of drmm, however that is tied to the
>>>>>>> lifetime of the driver instance and not the device underneath. Attempt
>>>>>>> to fix by using devm for all of the remaining sysfs stuff related to the
>>>>>>> device.
>>>>>> hmmm... so basically we should use the drmm only for the global module
>>>>>> stuff and the devm for things that are per device?
>>>>> that doesn't make much sense. drmm is supposed to run when the driver
>>>>> unbinds from the device... basically when all refcounts are gone with
>>>>> drm_dev_put().  Are we keeping a ref we shouldn't?
>>>> It's run when all refcounts are dropped for that particular drm_device, but
>>>> that is separate from the physical device underneath (struct device). For
>>>> example if something has an open driver fd the drmm release action is not
>>>> going to be called until after that is also closed. But in the meantime we
>>>> might have already removed the pci device and re-attached it to a newly
>>>> allocated drm_device/xe_driver instance, like with hotunplug.
>>>>
>>>> For example, currently we don't even call basic stuff like guc_fini() etc.
>>>> when removing the pci device, but rather when the drm_device is released,
>>>> which sounds quite broken.
>>>>
>>>> So roughly drmm is for drm_device software level stuff and devm is for stuff
>>>> that needs to happen when removing the device. See also the doc for drmm:
>>>> https://elixir.bootlin.com/linux/v6.8-rc1/source/drivers/gpu/drm/drm_managed.c#L23
>>>>
>>>> Also: https://docs.kernel.org/gpu/drm-uapi.html#device-hot-unplug
>> yeah... I think you convinced me
> You've all also convinced me this is a PITA to get right for every
> contribution. If there's one thing I've learned, people will just cargo
> cult this stuff, and pick one or the other depending on what they happen
> to see. Needs vigilant review.
>
> BR,
> Jani.
>
>
>>> Cc: Aravind and Michal since this likely relates to the FLR discussion...
>>>
>>> but it looks to me that we should move more towards the devm_ and limit
>>> the usage of drmm_ to some very specific cases...

Hi Matt,

so if we do not destroy the previous instance from drm_device and re create a new one I
believe the drm_device naming keeps changing I believe it is allowed from driver pov but
from system or UMDs pov can they expect the card to be renamed.

eg: /dev/dri/card0 ->> /dev/dri/card1

Thanks,
Aravind.
>> agreed,
>>
>> Lucas De Marchi
>>
>>>>> Lucas De Marchi

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

* Re: [PATCH 2/8] drm/xe: covert sysfs over to devm
  2024-04-30  9:42               ` Aravind Iddamsetty
@ 2024-04-30 10:51                 ` Matthew Auld
  0 siblings, 0 replies; 28+ messages in thread
From: Matthew Auld @ 2024-04-30 10:51 UTC (permalink / raw)
  To: Aravind Iddamsetty, Jani Nikula, Lucas De Marchi, Rodrigo Vivi
  Cc: michal.winiarski, intel-xe

On 30/04/2024 10:42, Aravind Iddamsetty wrote:
> 
> On 30/04/24 14:13, Jani Nikula wrote:
>> On Mon, 29 Apr 2024, Lucas De Marchi <lucas.demarchi@intel.com> wrote:
>>> On Mon, Apr 29, 2024 at 02:45:26PM GMT, Rodrigo Vivi wrote:
>>>> On Mon, Apr 29, 2024 at 04:17:54PM +0100, Matthew Auld wrote:
>>>>> On 29/04/2024 14:52, Lucas De Marchi wrote:
>>>>>> On Mon, Apr 29, 2024 at 09:28:00AM GMT, Rodrigo Vivi wrote:
>>>>>>> On Mon, Apr 29, 2024 at 01:14:38PM +0100, Matthew Auld wrote:
>>>>>>>> Hotunplugging the device seems to result in stuff like:
>>>>>>>>
>>>>>>>> kobject_add_internal failed for tile0 with -EEXIST, don't try to
>>>>>>>> register things with the same name in the same directory.
>>>>>>>>
>>>>>>>> We only remove the sysfs as part of drmm, however that is tied to the
>>>>>>>> lifetime of the driver instance and not the device underneath. Attempt
>>>>>>>> to fix by using devm for all of the remaining sysfs stuff related to the
>>>>>>>> device.
>>>>>>> hmmm... so basically we should use the drmm only for the global module
>>>>>>> stuff and the devm for things that are per device?
>>>>>> that doesn't make much sense. drmm is supposed to run when the driver
>>>>>> unbinds from the device... basically when all refcounts are gone with
>>>>>> drm_dev_put().  Are we keeping a ref we shouldn't?
>>>>> It's run when all refcounts are dropped for that particular drm_device, but
>>>>> that is separate from the physical device underneath (struct device). For
>>>>> example if something has an open driver fd the drmm release action is not
>>>>> going to be called until after that is also closed. But in the meantime we
>>>>> might have already removed the pci device and re-attached it to a newly
>>>>> allocated drm_device/xe_driver instance, like with hotunplug.
>>>>>
>>>>> For example, currently we don't even call basic stuff like guc_fini() etc.
>>>>> when removing the pci device, but rather when the drm_device is released,
>>>>> which sounds quite broken.
>>>>>
>>>>> So roughly drmm is for drm_device software level stuff and devm is for stuff
>>>>> that needs to happen when removing the device. See also the doc for drmm:
>>>>> https://elixir.bootlin.com/linux/v6.8-rc1/source/drivers/gpu/drm/drm_managed.c#L23
>>>>>
>>>>> Also: https://docs.kernel.org/gpu/drm-uapi.html#device-hot-unplug
>>> yeah... I think you convinced me
>> You've all also convinced me this is a PITA to get right for every
>> contribution. If there's one thing I've learned, people will just cargo
>> cult this stuff, and pick one or the other depending on what they happen
>> to see. Needs vigilant review.
>>
>> BR,
>> Jani.
>>
>>
>>>> Cc: Aravind and Michal since this likely relates to the FLR discussion...
>>>>
>>>> but it looks to me that we should move more towards the devm_ and limit
>>>> the usage of drmm_ to some very specific cases...
> 
> Hi Matt,
> 
> so if we do not destroy the previous instance from drm_device and re create a new one I
> believe the drm_device naming keeps changing I believe it is allowed from driver pov but
> from system or UMDs pov can they expect the card to be renamed.
> 
> eg: /dev/dri/card0 ->> /dev/dri/card1

Yes, that looks to be the case. We get a completely new drm_device with 
a different card number. The card0 will still be there until the 
corresponding drm_device instance can be safely released, assuming 
something is still keeping it alive.

 From the drm docs:

"From userspace perspective everything needs to keep on working more or 
less, until userspace stops using the disappeared DRM device and closes 
it completely. Userspace will learn of the device disappearance from the 
device removed uevent, ioctls returning ENODEV (or driver-specific 
ioctls returning driver-specific things), or open() returning ENXIO.

Only after userspace has closed all relevant DRM device and dmabuf file 
descriptors and removed all mmaps, the DRM driver can tear down its 
instance for the device that no longer exists. If the same physical 
device somehow comes back in the mean time, it shall be a new DRM device."

> 
> Thanks,
> Aravind.
>>> agreed,
>>>
>>> Lucas De Marchi
>>>
>>>>>> Lucas De Marchi

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

* drmm vs devm (was Re: [PATCH 2/8] drm/xe: covert sysfs over to devm)
  2024-04-29 21:28           ` Lucas De Marchi
  2024-04-30  8:43             ` Jani Nikula
@ 2024-04-30 13:29             ` Daniel Vetter
  1 sibling, 0 replies; 28+ messages in thread
From: Daniel Vetter @ 2024-04-30 13:29 UTC (permalink / raw)
  To: Lucas De Marchi
  Cc: Rodrigo Vivi, Matthew Auld, aravind.iddamsetty, michal.winiarski,
	intel-xe, DRI Development

Adding dri-devel because this is kinda more important.

On Mon, Apr 29, 2024 at 04:28:42PM -0500, Lucas De Marchi wrote:
> On Mon, Apr 29, 2024 at 02:45:26PM GMT, Rodrigo Vivi wrote:
> > On Mon, Apr 29, 2024 at 04:17:54PM +0100, Matthew Auld wrote:
> > > On 29/04/2024 14:52, Lucas De Marchi wrote:
> > > > On Mon, Apr 29, 2024 at 09:28:00AM GMT, Rodrigo Vivi wrote:
> > > > > On Mon, Apr 29, 2024 at 01:14:38PM +0100, Matthew Auld wrote:
> > > > > > Hotunplugging the device seems to result in stuff like:
> > > > > >
> > > > > > kobject_add_internal failed for tile0 with -EEXIST, don't try to
> > > > > > register things with the same name in the same directory.
> > > > > >
> > > > > > We only remove the sysfs as part of drmm, however that is tied to the
> > > > > > lifetime of the driver instance and not the device underneath. Attempt
> > > > > > to fix by using devm for all of the remaining sysfs stuff related to the
> > > > > > device.
> > > > >
> > > > > hmmm... so basically we should use the drmm only for the global module
> > > > > stuff and the devm for things that are per device?
> > > >
> > > > that doesn't make much sense. drmm is supposed to run when the driver
> > > > unbinds from the device... basically when all refcounts are gone with
> > > > drm_dev_put().  Are we keeping a ref we shouldn't?
> > > 
> > > It's run when all refcounts are dropped for that particular drm_device, but
> > > that is separate from the physical device underneath (struct device). For
> > > example if something has an open driver fd the drmm release action is not
> > > going to be called until after that is also closed. But in the meantime we
> > > might have already removed the pci device and re-attached it to a newly
> > > allocated drm_device/xe_driver instance, like with hotunplug.
> > > 
> > > For example, currently we don't even call basic stuff like guc_fini() etc.
> > > when removing the pci device, but rather when the drm_device is released,
> > > which sounds quite broken.
> > > 
> > > So roughly drmm is for drm_device software level stuff and devm is for stuff
> > > that needs to happen when removing the device. See also the doc for drmm:
> > > https://elixir.bootlin.com/linux/v6.8-rc1/source/drivers/gpu/drm/drm_managed.c#L23
> > > 
> > > Also: https://docs.kernel.org/gpu/drm-uapi.html#device-hot-unplug
> 
> yeah... I think you convinced me

So rule of thumb:

- devm is for hardware stuff, so like removeing pci mmaps, releasing
  interrupt handlers, cleaning up anything hw related. Because after devm
  respective driver unbind, all that stuff is gone, _even_ when you hold
  onto a struct device reference. Because all that struct device
  reference guarantees is that the software structure stays around as a
  valid memory reference.

- devm is also for remove uapi. Unfortunately we're not quite at the world
  where devm_drm_dev_register is possible, because on the unload side that
  must be done first, and there's still a few things drivers need to do
  after that which isn't fully devm/drmm-ified.

- drmm is for anything software related, so data structures and stuff like
  that. If you have a devm_kmalloc, you very, very likely have a bug. This
  is were you tear down all your software datastructures, which means if
  you have that interleaved with the hw teardown in e.g. guc_fini you have
  some serious work cut out for you. drmm stuff is tied to the drm_device
  lifetime as the core drm uapi interface thing which might stick around
  for much longer than the drm_dev_unregister.

- Finally, when going from the sw side to hw side you must wrap such
  access with drm_dev_enter/exit, or you have races. This is also where
  using drmm and devm for everything really helps, because it gives you a
  very strong hint when you're going from the sw world to the hw world.

  As an example, all the callbacks on the various kms objects are in the
  sw world (so need to be cleaned up with drmm), but the moment you access
  hw (e.g. any mmio) you need to protect that with a drm_dev_enter/exit

Using devm for everything means you have a use-after-free on the sw side,
otoh using devm means you have use-after-free on the hw side (like a
physical hotunplug might reallocate your mmio range to another thunderbolt
device that has been plugged in meanwhile).

It's definitely big time fun all around :-/

Oh also, please help improve the docs on this stuff, I'm trying to make
sure it's all there and ideally the various pieces link to the other
parts, but it's tricky and I understand this stuff to much to spot the
gaps ...

Cheers, Sima

> 
> > 
> > Cc: Aravind and Michal since this likely relates to the FLR discussion...
> > 
> > but it looks to me that we should move more towards the devm_ and limit
> > the usage of drmm_ to some very specific cases...
> 
> agreed,
> 
> Lucas De Marchi
> 
> > 
> > > 
> > > >
> > > > Lucas De Marchi

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [PATCH 1/8] drm/xe/device_sysfs: switch over to devm
  2024-04-29 12:14 [PATCH 1/8] drm/xe/device_sysfs: switch over to devm Matthew Auld
                   ` (9 preceding siblings ...)
  2024-04-29 12:22 ` ✓ CI.KUnit: success " Patchwork
@ 2024-05-06  8:04 ` Andrzej Hajda
  10 siblings, 0 replies; 28+ messages in thread
From: Andrzej Hajda @ 2024-05-06  8:04 UTC (permalink / raw)
  To: Matthew Auld, intel-xe; +Cc: Rodrigo Vivi

On 29.04.2024 14:14, Matthew Auld wrote:
> When hotunplugging the device we currently hit:
> 
> kernfs: can not remove 'vram_d3cold_threshold', no directory
> 
> Due to directory already being removed. Using drmm for sysfs device
> stuff like vram_d3cold_threshold doesn't really make sense when you
> consider hot unplugging of the pci device. In such a case the device is
> removed however the drmm release action will only fire once the driver
> instance can be released, which can be long after the device has already
> been hotunplugged. Rather use devm which is directly tied to the device
> and should be called when it is removed.
> 
> Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1432
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>

I am not sure why this patch is separate from the next one, IMO they 
could be merged.

Apparently I have started working on similar issue [1], anyway I was 
later and took care only of sysfs stuff, thx Lucas for response.

Anyway:
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>

[1]: https://patchwork.freedesktop.org/series/133080/

Regards
Andrzej

> ---
>   drivers/gpu/drm/xe/xe_device_sysfs.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_device_sysfs.c b/drivers/gpu/drm/xe/xe_device_sysfs.c
> index 21677b8cd977..7375937934fa 100644
> --- a/drivers/gpu/drm/xe/xe_device_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_device_sysfs.c
> @@ -69,7 +69,7 @@ vram_d3cold_threshold_store(struct device *dev, struct device_attribute *attr,
>   
>   static DEVICE_ATTR_RW(vram_d3cold_threshold);
>   
> -static void xe_device_sysfs_fini(struct drm_device *drm, void *arg)
> +static void xe_device_sysfs_fini(void *arg)
>   {
>   	struct xe_device *xe = arg;
>   
> @@ -85,5 +85,5 @@ int xe_device_sysfs_init(struct xe_device *xe)
>   	if (ret)
>   		return ret;
>   
> -	return drmm_add_action_or_reset(&xe->drm, xe_device_sysfs_fini, xe);
> +	return devm_add_action_or_reset(dev, xe_device_sysfs_fini, xe);
>   }


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

* Re: [PATCH 2/8] drm/xe: covert sysfs over to devm
  2024-04-29 12:14 ` [PATCH 2/8] drm/xe: covert sysfs " Matthew Auld
  2024-04-29 13:28   ` Rodrigo Vivi
@ 2024-05-06  8:07   ` Andrzej Hajda
  1 sibling, 0 replies; 28+ messages in thread
From: Andrzej Hajda @ 2024-05-06  8:07 UTC (permalink / raw)
  To: Matthew Auld, intel-xe; +Cc: Rodrigo Vivi

On 29.04.2024 14:14, Matthew Auld wrote:
> Hotunplugging the device seems to result in stuff like:
> 
> kobject_add_internal failed for tile0 with -EEXIST, don't try to
> register things with the same name in the same directory.
> 
> We only remove the sysfs as part of drmm, however that is tied to the
> lifetime of the driver instance and not the device underneath. Attempt
> to fix by using devm for all of the remaining sysfs stuff related to the
> device.
> 
> Closes: https://gitlab.freedesktop.org/dt srm/xe/kernel/-/issues/1667
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>

As mentioned in prev comment, it could be merged with the prev patch.

Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>

Regards
Andrzej

> ---
>   drivers/gpu/drm/xe/xe_gt_ccs_mode.c           |  4 ++--
>   drivers/gpu/drm/xe/xe_gt_freq.c               |  4 ++--
>   drivers/gpu/drm/xe/xe_gt_idle.c               |  4 ++--
>   drivers/gpu/drm/xe/xe_gt_sysfs.c              |  4 ++--
>   drivers/gpu/drm/xe/xe_gt_throttle_sysfs.c     |  4 ++--
>   drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c | 12 ++++++------
>   drivers/gpu/drm/xe/xe_tile_sysfs.c            |  4 ++--
>   drivers/gpu/drm/xe/xe_vram_freq.c             |  4 ++--
>   8 files changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_gt_ccs_mode.c b/drivers/gpu/drm/xe/xe_gt_ccs_mode.c
> index 396aeb5b9924..890da8870b0d 100644
> --- a/drivers/gpu/drm/xe/xe_gt_ccs_mode.c
> +++ b/drivers/gpu/drm/xe/xe_gt_ccs_mode.c
> @@ -150,7 +150,7 @@ static const struct attribute *gt_ccs_mode_attrs[] = {
>   	NULL,
>   };
>   
> -static void xe_gt_ccs_mode_sysfs_fini(struct drm_device *drm, void *arg)
> +static void xe_gt_ccs_mode_sysfs_fini(void *arg)
>   {
>   	struct xe_gt *gt = arg;
>   
> @@ -182,5 +182,5 @@ int xe_gt_ccs_mode_sysfs_init(struct xe_gt *gt)
>   	if (err)
>   		return err;
>   
> -	return drmm_add_action_or_reset(&xe->drm, xe_gt_ccs_mode_sysfs_fini, gt);
> +	return devm_add_action_or_reset(xe->drm.dev, xe_gt_ccs_mode_sysfs_fini, gt);
>   }
> diff --git a/drivers/gpu/drm/xe/xe_gt_freq.c b/drivers/gpu/drm/xe/xe_gt_freq.c
> index 855de40e40ea..e0305942644c 100644
> --- a/drivers/gpu/drm/xe/xe_gt_freq.c
> +++ b/drivers/gpu/drm/xe/xe_gt_freq.c
> @@ -209,7 +209,7 @@ static const struct attribute *freq_attrs[] = {
>   	NULL
>   };
>   
> -static void freq_fini(struct drm_device *drm, void *arg)
> +static void freq_fini(void *arg)
>   {
>   	struct kobject *kobj = arg;
>   
> @@ -237,7 +237,7 @@ int xe_gt_freq_init(struct xe_gt *gt)
>   	if (!gt->freq)
>   		return -ENOMEM;
>   
> -	err = drmm_add_action_or_reset(&xe->drm, freq_fini, gt->freq);
> +	err = devm_add_action(xe->drm.dev, freq_fini, gt->freq);
>   	if (err)
>   		return err;
>   
> diff --git a/drivers/gpu/drm/xe/xe_gt_idle.c b/drivers/gpu/drm/xe/xe_gt_idle.c
> index 8fc0f3f6ecc5..9e907033f32b 100644
> --- a/drivers/gpu/drm/xe/xe_gt_idle.c
> +++ b/drivers/gpu/drm/xe/xe_gt_idle.c
> @@ -144,7 +144,7 @@ static const struct attribute *gt_idle_attrs[] = {
>   	NULL,
>   };
>   
> -static void gt_idle_sysfs_fini(struct drm_device *drm, void *arg)
> +static void gt_idle_sysfs_fini(void *arg)
>   {
>   	struct kobject *kobj = arg;
>   
> @@ -181,7 +181,7 @@ int xe_gt_idle_sysfs_init(struct xe_gt_idle *gtidle)
>   		return err;
>   	}
>   
> -	return drmm_add_action_or_reset(&xe->drm, gt_idle_sysfs_fini, kobj);
> +	return devm_add_action_or_reset(xe->drm.dev, gt_idle_sysfs_fini, kobj);
>   }
>   
>   void xe_gt_idle_enable_c6(struct xe_gt *gt)
> diff --git a/drivers/gpu/drm/xe/xe_gt_sysfs.c b/drivers/gpu/drm/xe/xe_gt_sysfs.c
> index 1e5971072bc8..a05c3699e8b9 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sysfs.c
> @@ -22,7 +22,7 @@ static const struct kobj_type xe_gt_sysfs_kobj_type = {
>   	.sysfs_ops = &kobj_sysfs_ops,
>   };
>   
> -static void gt_sysfs_fini(struct drm_device *drm, void *arg)
> +static void gt_sysfs_fini(void *arg)
>   {
>   	struct xe_gt *gt = arg;
>   
> @@ -51,5 +51,5 @@ int xe_gt_sysfs_init(struct xe_gt *gt)
>   
>   	gt->sysfs = &kg->base;
>   
> -	return drmm_add_action_or_reset(&xe->drm, gt_sysfs_fini, gt);
> +	return devm_add_action(xe->drm.dev, gt_sysfs_fini, gt);
>   }
> diff --git a/drivers/gpu/drm/xe/xe_gt_throttle_sysfs.c b/drivers/gpu/drm/xe/xe_gt_throttle_sysfs.c
> index fbe21a8599ca..c9e04151286d 100644
> --- a/drivers/gpu/drm/xe/xe_gt_throttle_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_gt_throttle_sysfs.c
> @@ -229,7 +229,7 @@ static const struct attribute_group throttle_group_attrs = {
>   	.attrs = throttle_attrs,
>   };
>   
> -static void gt_throttle_sysfs_fini(struct drm_device *drm, void *arg)
> +static void gt_throttle_sysfs_fini(void *arg)
>   {
>   	struct xe_gt *gt = arg;
>   
> @@ -245,5 +245,5 @@ int xe_gt_throttle_sysfs_init(struct xe_gt *gt)
>   	if (err)
>   		return err;
>   
> -	return drmm_add_action_or_reset(&xe->drm, gt_throttle_sysfs_fini, gt);
> +	return devm_add_action_or_reset(xe->drm.dev, gt_throttle_sysfs_fini, gt);
>   }
> diff --git a/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c b/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c
> index 844ec68cbbb8..258078a6b461 100644
> --- a/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c
> @@ -492,7 +492,7 @@ static const struct attribute * const files[] = {
>   	NULL
>   };
>   
> -static void kobj_xe_hw_engine_class_fini(struct drm_device *drm, void *arg)
> +static void kobj_xe_hw_engine_class_fini(void *arg)
>   {
>   	struct kobject *kobj = arg;
>   
> @@ -517,7 +517,7 @@ kobj_xe_hw_engine_class(struct xe_device *xe, struct kobject *parent, const char
>   	}
>   	keclass->xe = xe;
>   
> -	err = drmm_add_action_or_reset(&xe->drm, kobj_xe_hw_engine_class_fini,
> +	err = devm_add_action_or_reset(xe->drm.dev, kobj_xe_hw_engine_class_fini,
>   				       &keclass->base);
>   	if (err)
>   		return NULL;
> @@ -525,7 +525,7 @@ kobj_xe_hw_engine_class(struct xe_device *xe, struct kobject *parent, const char
>   	return keclass;
>   }
>   
> -static void hw_engine_class_defaults_fini(struct drm_device *drm, void *arg)
> +static void hw_engine_class_defaults_fini(void *arg)
>   {
>   	struct kobject *kobj = arg;
>   
> @@ -552,7 +552,7 @@ static int xe_add_hw_engine_class_defaults(struct xe_device *xe,
>   	if (err)
>   		goto err_object;
>   
> -	return drmm_add_action_or_reset(&xe->drm, hw_engine_class_defaults_fini, kobj);
> +	return devm_add_action_or_reset(xe->drm.dev, hw_engine_class_defaults_fini, kobj);
>   
>   err_object:
>   	kobject_put(kobj);
> @@ -611,7 +611,7 @@ static const struct kobj_type xe_hw_engine_sysfs_kobj_type = {
>   	.sysfs_ops = &xe_hw_engine_class_sysfs_ops,
>   };
>   
> -static void hw_engine_class_sysfs_fini(struct drm_device *drm, void *arg)
> +static void hw_engine_class_sysfs_fini(void *arg)
>   {
>   	struct kobject *kobj = arg;
>   
> @@ -698,7 +698,7 @@ int xe_hw_engine_class_sysfs_init(struct xe_gt *gt)
>   			goto err_object;
>   	}
>   
> -	return drmm_add_action_or_reset(&xe->drm, hw_engine_class_sysfs_fini, kobj);
> +	return devm_add_action_or_reset(xe->drm.dev, hw_engine_class_sysfs_fini, kobj);
>   
>   err_object:
>   	kobject_put(kobj);
> diff --git a/drivers/gpu/drm/xe/xe_tile_sysfs.c b/drivers/gpu/drm/xe/xe_tile_sysfs.c
> index 64661403afcd..b804234a6551 100644
> --- a/drivers/gpu/drm/xe/xe_tile_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_tile_sysfs.c
> @@ -22,7 +22,7 @@ static const struct kobj_type xe_tile_sysfs_kobj_type = {
>   	.sysfs_ops = &kobj_sysfs_ops,
>   };
>   
> -static void tile_sysfs_fini(struct drm_device *drm, void *arg)
> +static void tile_sysfs_fini(void *arg)
>   {
>   	struct xe_tile *tile = arg;
>   
> @@ -55,5 +55,5 @@ int xe_tile_sysfs_init(struct xe_tile *tile)
>   	if (err)
>   		return err;
>   
> -	return drmm_add_action_or_reset(&xe->drm, tile_sysfs_fini, tile);
> +	return devm_add_action_or_reset(xe->drm.dev, tile_sysfs_fini, tile);
>   }
> diff --git a/drivers/gpu/drm/xe/xe_vram_freq.c b/drivers/gpu/drm/xe/xe_vram_freq.c
> index 3e21ddc6e60c..99ff95e408e0 100644
> --- a/drivers/gpu/drm/xe/xe_vram_freq.c
> +++ b/drivers/gpu/drm/xe/xe_vram_freq.c
> @@ -87,7 +87,7 @@ static const struct attribute_group freq_group_attrs = {
>   	.attrs = freq_attrs,
>   };
>   
> -static void vram_freq_sysfs_fini(struct drm_device *drm, void *arg)
> +static void vram_freq_sysfs_fini(void *arg)
>   {
>   	struct kobject *kobj = arg;
>   
> @@ -122,5 +122,5 @@ int xe_vram_freq_sysfs_init(struct xe_tile *tile)
>   		return err;
>   	}
>   
> -	return drmm_add_action_or_reset(&xe->drm, vram_freq_sysfs_fini, kobj);
> +	return devm_add_action_or_reset(xe->drm.dev, vram_freq_sysfs_fini, kobj);
>   }


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

* Re: [PATCH 3/8] drm/xe/ggtt: use drm_dev_enter to mark device section
  2024-04-29 12:14 ` [PATCH 3/8] drm/xe/ggtt: use drm_dev_enter to mark device section Matthew Auld
@ 2024-05-06  8:42   ` Andrzej Hajda
  0 siblings, 0 replies; 28+ messages in thread
From: Andrzej Hajda @ 2024-05-06  8:42 UTC (permalink / raw)
  To: Matthew Auld, intel-xe; +Cc: Rodrigo Vivi

On 29.04.2024 14:14, Matthew Auld wrote:
> Device can be hotunplugged before we start destroying gem objects. In
> such a case don't touch the GGTT entries, trigger any invalidations or
> mess around with rpm.  This should already be taken care of when
> removing the device, we just need to take care of dealing with the
> software state, like removing the mm node.
> 
> References: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1717
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_ggtt.c | 34 ++++++++++++++++++++++------------
>   1 file changed, 22 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c
> index 0d541f55b4fc..7c05d3f7e1a4 100644
> --- a/drivers/gpu/drm/xe/xe_ggtt.c
> +++ b/drivers/gpu/drm/xe/xe_ggtt.c
> @@ -8,6 +8,7 @@
>   #include <linux/io-64-nonatomic-lo-hi.h>
>   #include <linux/sizes.h>
>   
> +#include <drm/drm_drv.h>
>   #include <drm/drm_managed.h>
>   #include <drm/i915_drm.h>
>   
> @@ -433,18 +434,27 @@ int xe_ggtt_insert_bo(struct xe_ggtt *ggtt, struct xe_bo *bo)
>   void xe_ggtt_remove_node(struct xe_ggtt *ggtt, struct drm_mm_node *node,
>   			 bool invalidate)
>   {
> -	xe_pm_runtime_get_noresume(tile_to_xe(ggtt->tile));
> -
> -	mutex_lock(&ggtt->lock);
> -	xe_ggtt_clear(ggtt, node->start, node->size);
> -	drm_mm_remove_node(node);
> -	node->size = 0;
> -	mutex_unlock(&ggtt->lock);
> -
> -	if (invalidate)
> -		xe_ggtt_invalidate(ggtt);
> -
> -	xe_pm_runtime_put(tile_to_xe(ggtt->tile));
> +	struct xe_device *xe = tile_to_xe(ggtt->tile);
> +	int idx;
> +
> +	if (drm_dev_enter(&xe->drm, &idx)) {
> +		xe_pm_runtime_get_noresume(xe);
> +		mutex_lock(&ggtt->lock);
> +		xe_ggtt_clear(ggtt, node->start, node->size);
> +		drm_mm_remove_node(node);
> +		node->size = 0;
> +		mutex_unlock(&ggtt->lock);
> +
> +		if (invalidate)
> +			xe_ggtt_invalidate(ggtt);
> +		xe_pm_runtime_put(xe);
> +		drm_dev_exit(idx);
> +	} else {
> +		mutex_lock(&ggtt->lock);
> +		drm_mm_remove_node(node);
> +		node->size = 0;
> +		mutex_unlock(&ggtt->lock);
> +	}


There is little redundancy between both 'if' branches, I wonder
it it wouldn't be better to do sth like:
	bool driver_bound = drm_dev_enter(&xe->drm, &idx);

	if (driver_bound)
		xe_pm_runtime_get_noresume(xe);
	mutex_lock(&ggtt->lock);
	if (driver_bound)
		xe_ggtt_clear(ggtt, node->start, node->size);
	drm_mm_remove_node(node);
	node->size = 0;
	mutex_unlock(&ggtt->lock);
	if (!driver_bound)
		return;

	if (invalidate)
		xe_ggtt_invalidate(ggtt);
	xe_pm_runtime_put(xe);
	drm_dev_exit(idx);

No big feelings.

One related thing: drm_dev_unplug is called from 
xe_device_remove_display, sounds slightly misleading as drm_dev is not 
only about display. Maybe xe_device_remove_display should be 
incorporated into xe_device_remove to make it more clear, and more 
symmetric with drm_dev_register called from xe_device_probe.

Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>

Regards
Andrzej


>   }
>   
>   void xe_ggtt_remove_bo(struct xe_ggtt *ggtt, struct xe_bo *bo)


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

* Re: [PATCH 4/8] drm/xe/guc: move guc_fini over to devm
  2024-04-29 12:14 ` [PATCH 4/8] drm/xe/guc: move guc_fini over to devm Matthew Auld
@ 2024-05-06  9:03   ` Andrzej Hajda
  0 siblings, 0 replies; 28+ messages in thread
From: Andrzej Hajda @ 2024-05-06  9:03 UTC (permalink / raw)
  To: Matthew Auld, intel-xe; +Cc: Rodrigo Vivi

On 29.04.2024 14:14, Matthew Auld wrote:
> Make sure to actually call this when the device is removed. Currently we
> only trigger it when the driver instance goes away, but that doesn't
> work too well with hotunplug, since device can be removed and re-probed
> with a new driver instance, where the guc_fini() is called too late.
> Move the fini over to devm to ensure this is called when device is
> removed.
> 
> References: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1717
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>

Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>

Regards
Andrzej

> ---
>   drivers/gpu/drm/xe/xe_guc.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
> index 0c9938e0ab8c..97e2b62df486 100644
> --- a/drivers/gpu/drm/xe/xe_guc.c
> +++ b/drivers/gpu/drm/xe/xe_guc.c
> @@ -239,7 +239,7 @@ static void guc_write_params(struct xe_guc *guc)
>   		xe_mmio_write32(gt, SOFT_SCRATCH(1 + i), guc->params[i]);
>   }
>   
> -static void guc_fini(struct drm_device *drm, void *arg)
> +static void guc_fini(void *arg)
>   {
>   	struct xe_guc *guc = arg;
>   	struct xe_gt *gt = guc_to_gt(guc);
> @@ -323,7 +323,7 @@ int xe_guc_init(struct xe_guc *guc)
>   	if (ret)
>   		goto out;
>   
> -	ret = drmm_add_action_or_reset(&xe->drm, guc_fini, guc);
> +	ret = devm_add_action_or_reset(xe->drm.dev, guc_fini, guc);
>   	if (ret)
>   		goto out;
>   


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

* Re: [PATCH 5/8] drm/xe/guc_pc: move pc_fini to devm
  2024-04-29 12:14 ` [PATCH 5/8] drm/xe/guc_pc: move pc_fini " Matthew Auld
@ 2024-05-06  9:11   ` Andrzej Hajda
  0 siblings, 0 replies; 28+ messages in thread
From: Andrzej Hajda @ 2024-05-06  9:11 UTC (permalink / raw)
  To: Matthew Auld, intel-xe; +Cc: Rodrigo Vivi

On 29.04.2024 14:14, Matthew Auld wrote:
> Here we are touching the HW/GuC and presumably this should happen when
> the device is removed. Currently if you hotunplug the device this is
> skipped if there is already open driver instance.
> 
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>

Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>

Regards
Andrzej
> ---
>   drivers/gpu/drm/xe/xe_guc_pc.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_guc_pc.c b/drivers/gpu/drm/xe/xe_guc_pc.c
> index 8fc757900ed1..8c855afd1144 100644
> --- a/drivers/gpu/drm/xe/xe_guc_pc.c
> +++ b/drivers/gpu/drm/xe/xe_guc_pc.c
> @@ -892,7 +892,7 @@ int xe_guc_pc_stop(struct xe_guc_pc *pc)
>    * @drm: DRM device
>    * @arg: opaque pointer that should point to Xe_GuC_PC instance
>    */
> -static void xe_guc_pc_fini(struct drm_device *drm, void *arg)
> +static void xe_guc_pc_fini(void *arg)
>   {
>   	struct xe_guc_pc *pc = arg;
>   	struct xe_device *xe = pc_to_xe(pc);
> @@ -940,5 +940,5 @@ int xe_guc_pc_init(struct xe_guc_pc *pc)
>   
>   	pc->bo = bo;
>   
> -	return drmm_add_action_or_reset(&xe->drm, xe_guc_pc_fini, pc);
> +	return devm_add_action_or_reset(xe->drm.dev, xe_guc_pc_fini, pc);
>   }


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

* Re: [PATCH 6/8] drm/xe/irq: move irq_uninstall over to devm
  2024-04-29 12:14 ` [PATCH 6/8] drm/xe/irq: move irq_uninstall over " Matthew Auld
@ 2024-05-06  9:12   ` Andrzej Hajda
  0 siblings, 0 replies; 28+ messages in thread
From: Andrzej Hajda @ 2024-05-06  9:12 UTC (permalink / raw)
  To: Matthew Auld, intel-xe; +Cc: Rodrigo Vivi

On 29.04.2024 14:14, Matthew Auld wrote:
> Makes sense to trigger this when the device is removed.
> 
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>

Regards
Andrzej
> ---
>   drivers/gpu/drm/xe/xe_irq.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_irq.c b/drivers/gpu/drm/xe/xe_irq.c
> index 996806353171..8ee3c300c5e4 100644
> --- a/drivers/gpu/drm/xe/xe_irq.c
> +++ b/drivers/gpu/drm/xe/xe_irq.c
> @@ -663,7 +663,7 @@ static irq_handler_t xe_irq_handler(struct xe_device *xe)
>   		return xelp_irq_handler;
>   }
>   
> -static void irq_uninstall(struct drm_device *drm, void *arg)
> +static void irq_uninstall(void *arg)
>   {
>   	struct xe_device *xe = arg;
>   	struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
> @@ -723,7 +723,7 @@ int xe_irq_install(struct xe_device *xe)
>   
>   	xe_irq_postinstall(xe);
>   
> -	err = drmm_add_action_or_reset(&xe->drm, irq_uninstall, xe);
> +	err = devm_add_action_or_reset(xe->drm.dev, irq_uninstall, xe);
>   	if (err)
>   		goto free_irq_handler;
>   
> @@ -737,7 +737,7 @@ int xe_irq_install(struct xe_device *xe)
>   
>   void xe_irq_shutdown(struct xe_device *xe)
>   {
> -	irq_uninstall(&xe->drm, xe);
> +	irq_uninstall(xe);
>   }
>   
>   void xe_irq_suspend(struct xe_device *xe)


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

* Re: [PATCH 7/8] drm/xe/device: move flr to devm
  2024-04-29 12:14 ` [PATCH 7/8] drm/xe/device: move flr " Matthew Auld
@ 2024-05-06  9:12   ` Andrzej Hajda
  0 siblings, 0 replies; 28+ messages in thread
From: Andrzej Hajda @ 2024-05-06  9:12 UTC (permalink / raw)
  To: Matthew Auld, intel-xe; +Cc: Rodrigo Vivi

On 29.04.2024 14:14, Matthew Auld wrote:
> Should be called when driver is removed, not when this particular driver
> instance is destroyed.
> 
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>

Regards
Andrzej
> ---
>   drivers/gpu/drm/xe/xe_device.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> index b61f8356e23e..ba917e383f8f 100644
> --- a/drivers/gpu/drm/xe/xe_device.c
> +++ b/drivers/gpu/drm/xe/xe_device.c
> @@ -387,7 +387,7 @@ static void xe_driver_flr(struct xe_device *xe)
>   	xe_mmio_write32(gt, GU_DEBUG, DRIVERFLR_STATUS);
>   }
>   
> -static void xe_driver_flr_fini(struct drm_device *drm, void *arg)
> +static void xe_driver_flr_fini(void *arg)
>   {
>   	struct xe_device *xe = arg;
>   
> @@ -589,7 +589,7 @@ int xe_device_probe(struct xe_device *xe)
>   	err = xe_devcoredump_init(xe);
>   	if (err)
>   		return err;
> -	err = drmm_add_action_or_reset(&xe->drm, xe_driver_flr_fini, xe);
> +	err = devm_add_action_or_reset(xe->drm.dev, xe_driver_flr_fini, xe);
>   	if (err)
>   		return err;
>   


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

* Re: [PATCH 8/8] drm/xe/device: move xe_device_sanitize over to devm
  2024-04-29 12:14 ` [PATCH 8/8] drm/xe/device: move xe_device_sanitize over " Matthew Auld
@ 2024-05-06 17:25   ` Andrzej Hajda
  0 siblings, 0 replies; 28+ messages in thread
From: Andrzej Hajda @ 2024-05-06 17:25 UTC (permalink / raw)
  To: Matthew Auld, intel-xe; +Cc: Rodrigo Vivi

On 29.04.2024 14:14, Matthew Auld wrote:
> Disable GuC submission when removing the device.
> 
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>

Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>

I have tried to test whole patchset with
core_hotunplug@hotrebind
and I still observe attempts to call xe runtime_pm callbacks from 
removed driver(???):
[  135.059797] xe 0000:00:02.0: [drm:drm_managed_release [drm]] REL 
ffff88812b63c240 kmalloc (13 bytes)
[  135.059844] xe 0000:00:02.0: [drm:drm_managed_release [drm]] REL 
ffff88812b63d040 drm_gem_init_release (0 bytes)
[  135.059887] xe 0000:00:02.0: [drm:drm_managed_release [drm]] REL 
ffff88814f73b200 kmalloc (304 bytes)
[  135.059931] xe 0000:00:02.0: [drm:drm_managed_release [drm]] REL 
ffff88812b63c740 drm_minor_alloc_release (8 bytes)
[  135.059995] xe 0000:00:02.0: [drm:drm_managed_release [drm]] REL 
ffff888115620708 kmalloc (40 bytes)
[  135.060065] xe 0000:00:02.0: [drm:drm_managed_release [drm]] REL 
ffff88812b63ca40 drm_minor_alloc_release (8 bytes)
[  135.060161] xe 0000:00:02.0: [drm:drm_managed_release [drm]] REL 
ffff888115620a88 kmalloc (40 bytes)
[  135.060229] xe 0000:00:02.0: [drm:drm_managed_release [drm]] REL 
ffff88812d407e40 drm_dev_init_release (0 bytes)
[  135.060323] [drm:drm_managed_release [drm]] drmres release end
[  136.099951] general protection fault, probably for non-canonical 
address 0xdffffc00000004a3: 0000 [#1] PREEMPT SMP KASAN NOPTI
[  136.099969] KASAN: probably user-memory-access in range 
[0x0000000000002518-0x000000000000251f]
[  136.099977] CPU: 0 PID: 9 Comm: kworker/0:1 Not tainted 6.9.0-rc2-xe+ #25
[  136.099985] Hardware name: Intel Corporation Raptor Lake Client 
Platform/RPL-S ADP-S DDR5 UDIMM CRB, BIOS 
RPLSFWI1.R00.4064.A02.2302091143 02/09/2023
[  136.099994] Workqueue: pm pm_runtime_work
[  136.100010] RIP: 0010:xe_pm_d3cold_allowed_toggle+0x2f/0x2d0 [xe]
[  136.100209] Code: 48 b8 00 00 00 00 00 fc ff df 55 48 89 e5 41 56 41 
55 41 54 53 48 89 fb 48 81 c7 18 25 00 00 48 89 fa 48 c1 ea 03 48 83 ec 
08 <0f> b6 04 02 48 89 fa 83 e2 07 38 d0 7f 08 84 c0 0f 85 21 02 00 00
[  136.100228] RSP: 0018:ffffc900001d7be8 EFLAGS: 00010296
[  136.100237] RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 
0000000000000000
[  136.100246] RDX: 00000000000004a3 RSI: 0000000000000000 RDI: 
0000000000002518
[  136.100255] RBP: ffffc900001d7c10 R08: ffff888117cf43c9 R09: 
ffff888117cf4220
[  136.100263] R10: 0000000000000000 R11: 0000000000000000 R12: 
ffff888117cf40c8
[  136.100271] R13: 0000000000000000 R14: ffffffff82dc8270 R15: 
ffff888117cf43c8
[  136.100280] FS:  0000000000000000(0000) GS:ffff88884dc00000(0000) 
knlGS:0000000000000000
[  136.100290] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  136.100298] CR2: 00005572f1fff388 CR3: 000000012134e000 CR4: 
0000000000750ef0
[  136.100307] PKRU: 55555554
[  136.100312] Call Trace:
[  136.100317]  <TASK>
[  136.100322]  ? show_regs+0x71/0x90
[  136.100331]  ? die_addr+0x41/0xc0
[  136.100339]  ? exc_general_protection+0x15d/0x260
[  136.100352]  ? asm_exc_general_protection+0x27/0x30
[  136.100361]  ? __pfx_pci_pm_runtime_idle+0x10/0x10
[  136.100373]  ? xe_pm_d3cold_allowed_toggle+0x2f/0x2d0 [xe]
[  136.100500]  ? __pfx_pci_pm_runtime_idle+0x10/0x10
[  136.100507]  xe_pci_runtime_idle+0x31/0x50 [xe]
[  136.100629]  pci_pm_runtime_idle+0xb7/0x100
[  136.100637]  rpm_idle+0x1ec/0x5c0
[  136.100646]  pm_runtime_work+0x10e/0x170
[  136.100653]  process_one_work+0x855/0x1a20
[  136.100665]  ? __pfx_process_one_work+0x10/0x10
[  136.100673]  ? move_linked_works+0x12b/0x2d0
[  136.100682]  ? assign_work+0x16f/0x280
[  136.100690]  worker_thread+0x57c/0xd40
[  136.100701]  kthread+0x2f3/0x3f0
[  136.100708]  ? __pfx_worker_thread+0x10/0x10
[  136.100716]  ? __pfx_kthread+0x10/0x10
[  136.100723]  ret_from_fork+0x43/0x90
[  136.100730]  ? __pfx_kthread+0x10/0x10
[  136.100737]  ret_from_fork_asm+0x1a/0x30
[  136.100748]  </TASK>



Regards
Andrzej

> ---
>   drivers/gpu/drm/xe/xe_device.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> index ba917e383f8f..8c3415d7635a 100644
> --- a/drivers/gpu/drm/xe/xe_device.c
> +++ b/drivers/gpu/drm/xe/xe_device.c
> @@ -395,7 +395,7 @@ static void xe_driver_flr_fini(void *arg)
>   		xe_driver_flr(xe);
>   }
>   
> -static void xe_device_sanitize(struct drm_device *drm, void *arg)
> +static void xe_device_sanitize(void *arg)
>   {
>   	struct xe_device *xe = arg;
>   	struct xe_gt *gt;
> @@ -661,7 +661,7 @@ int xe_device_probe(struct xe_device *xe)
>   
>   	xe_hwmon_register(xe);
>   
> -	return drmm_add_action_or_reset(&xe->drm, xe_device_sanitize, xe);
> +	return devm_add_action_or_reset(xe->drm.dev, xe_device_sanitize, xe);
>   
>   err_fini_display:
>   	xe_display_driver_remove(xe);


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

end of thread, other threads:[~2024-05-06 17:25 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-29 12:14 [PATCH 1/8] drm/xe/device_sysfs: switch over to devm Matthew Auld
2024-04-29 12:14 ` [PATCH 2/8] drm/xe: covert sysfs " Matthew Auld
2024-04-29 13:28   ` Rodrigo Vivi
2024-04-29 13:52     ` Lucas De Marchi
2024-04-29 15:17       ` Matthew Auld
2024-04-29 18:45         ` Rodrigo Vivi
2024-04-29 21:28           ` Lucas De Marchi
2024-04-30  8:43             ` Jani Nikula
2024-04-30  9:42               ` Aravind Iddamsetty
2024-04-30 10:51                 ` Matthew Auld
2024-04-30 13:29             ` drmm vs devm (was Re: [PATCH 2/8] drm/xe: covert sysfs over to devm) Daniel Vetter
2024-05-06  8:07   ` [PATCH 2/8] drm/xe: covert sysfs over to devm Andrzej Hajda
2024-04-29 12:14 ` [PATCH 3/8] drm/xe/ggtt: use drm_dev_enter to mark device section Matthew Auld
2024-05-06  8:42   ` Andrzej Hajda
2024-04-29 12:14 ` [PATCH 4/8] drm/xe/guc: move guc_fini over to devm Matthew Auld
2024-05-06  9:03   ` Andrzej Hajda
2024-04-29 12:14 ` [PATCH 5/8] drm/xe/guc_pc: move pc_fini " Matthew Auld
2024-05-06  9:11   ` Andrzej Hajda
2024-04-29 12:14 ` [PATCH 6/8] drm/xe/irq: move irq_uninstall over " Matthew Auld
2024-05-06  9:12   ` Andrzej Hajda
2024-04-29 12:14 ` [PATCH 7/8] drm/xe/device: move flr " Matthew Auld
2024-05-06  9:12   ` Andrzej Hajda
2024-04-29 12:14 ` [PATCH 8/8] drm/xe/device: move xe_device_sanitize over " Matthew Auld
2024-05-06 17:25   ` Andrzej Hajda
2024-04-29 12:21 ` ✓ CI.Patch_applied: success for series starting with [1/8] drm/xe/device_sysfs: switch " Patchwork
2024-04-29 12:21 ` ✗ CI.checkpatch: warning " Patchwork
2024-04-29 12:22 ` ✓ CI.KUnit: success " Patchwork
2024-05-06  8:04 ` [PATCH 1/8] " Andrzej Hajda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox