[Intel-xe] [PATCH 2/2] drm/xe: Move device sysfs init out of xe_pm_init

Tejas Upadhyay tejas.upadhyay at intel.com
Wed Nov 8 13:54:18 UTC 2023


Device sysfs needs to happen right after device probe.
Currently it is under xe_pm_init() which does not look
correct now as we add more sysfs entries which are not
specific to PM.

Signed-off-by: Tejas Upadhyay <tejas.upadhyay at intel.com>
---
 drivers/gpu/drm/xe/xe_device.c | 3 +++
 drivers/gpu/drm/xe/xe_pm.c     | 5 +----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index 266e0d5d7159..8b6845e29bdc 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -18,6 +18,7 @@
 #include "regs/xe_regs.h"
 #include "xe_bo.h"
 #include "xe_debugfs.h"
+#include "xe_device_sysfs.h"
 #include "xe_display.h"
 #include "xe_dma_buf.h"
 #include "xe_drm_client.h"
@@ -452,6 +453,8 @@ int xe_device_probe(struct xe_device *xe)
 
 	xe_hwmon_register(xe);
 
+	xe_device_sysfs_init(xe);
+
 	err = drmm_add_action_or_reset(&xe->drm, xe_device_sanitize, xe);
 	if (err)
 		return err;
diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
index e31a91cf311c..32009da9bfeb 100644
--- a/drivers/gpu/drm/xe/xe_pm.c
+++ b/drivers/gpu/drm/xe/xe_pm.c
@@ -13,7 +13,6 @@
 #include "xe_bo.h"
 #include "xe_bo_evict.h"
 #include "xe_device.h"
-#include "xe_device_sysfs.h"
 #include "xe_display.h"
 #include "xe_ggtt.h"
 #include "xe_gt.h"
@@ -175,10 +174,8 @@ void xe_pm_init(struct xe_device *xe)
 
 	xe->d3cold.capable = xe_pm_pci_d3cold_capable(pdev);
 
-	if (xe->d3cold.capable) {
-		xe_device_sysfs_init(xe);
+	if (xe->d3cold.capable)
 		xe_pm_set_vram_threshold(xe, DEFAULT_VRAM_THRESHOLD);
-	}
 
 	xe_pm_runtime_init(xe);
 }
-- 
2.25.1



More information about the Intel-xe mailing list