Skip to contentSkip to conversation

drm/amdgpu: move uniras IP version check to amdgpu_ras_init

PATCH In review Ce Sun 2 participants 2 messages Jul 7

Subsystems (2)
lore
Share & tools
lore

Ce Sun

author
#0 lore raw

PATCH 1/2 drm/amdgpu: move uniras IP version check to amdgpu_ras_init

Late uniras enable in amdgpu_ras_mgr_sw_init leads to xxx_err_count sysfs node creation failure during NPS mode switching. Move the uniras IP version check into amdgpu_ras_init to set uniras_enabled ahead of sysfs node creation

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c          | 11 +++++++++++
 drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c | 10 +---------
 2 files changed, 12 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +11 -0
index e300d951898d..8ade3da6f132 100644
@@ -3595,6 +3595,17 @@ int amdgpu_ras_init(struct amdgpu_device *adev)
 		goto release_con;
 	}
 
+	switch (amdgpu_ip_version(adev, MP0_HWIP, 0)) {
+	case IP_VERSION(13, 0, 14):
+	case IP_VERSION(13, 0, 12):
+	case IP_VERSION(13, 0, 6):
+		con->uniras_enabled = true;
+		break;
+	default:
+		con->uniras_enabled = false;
+		break;
+	}
+
 	con->update_channel_flag = false;
 	con->features = 0;
 	con->schema = 0;
drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c +1 -9
index b8b831a91bc7..6224c4921a42 100644
@@ -327,15 +327,7 @@ static int amdgpu_ras_mgr_sw_init(struct amdgpu_ip_block *ip_block)
 	struct amdgpu_ras_mgr *ras_mgr;
 	int ret = 0;
 
-	/* Disabled by default */
-	con->uniras_enabled = false;
-
-	if (amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 14) ||
-	    amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 12) ||
-	    amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 6) ||
-	    adev->debug_enable_ras_aca)
-		con->uniras_enabled = true;
-	else
+	if (!con->uniras_enabled)
 		return 0;
 
 	ras_mgr = kzalloc(sizeof(*ras_mgr), GFP_KERNEL);
Signature · 1 line
2.34.1
#1 lore raw

AMD General

Should we move amdgpu_ras_mgr_sw_init into amdgpu_ras_init, and ensure it runs before amdgpu_ras_fs_init?

Regards,
Hawking

-----Original Message-----
From: Sun, Ce(Overlord) <[email protected]>
Sent: Tuesday, July 7, 2026 9:58 PM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Chai, Thomas <[email protected]>; Zhou1, Tao <[email protected]>; Yang, Stanley <[email protected]>; Sun, Ce(Overlord) <[email protected]>
Subject: [PATCH 1/2] drm/amdgpu: move uniras IP version check to amdgpu_ras_init

Late uniras enable in amdgpu_ras_mgr_sw_init leads to xxx_err_count sysfs node creation failure during NPS mode switching. Move the uniras IP version check into amdgpu_ras_init to set uniras_enabled ahead of sysfs node creation

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c          | 11 +++++++++++
 drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c | 10 +---------
 2 files changed, 12 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +11 -0
index e300d951898d..8ade3da6f132 100644
@@ -3595,6 +3595,17 @@ int amdgpu_ras_init(struct amdgpu_device *adev)
                goto release_con;
        }
 
+       switch (amdgpu_ip_version(adev, MP0_HWIP, 0)) {
+       case IP_VERSION(13, 0, 14):
+       case IP_VERSION(13, 0, 12):
+       case IP_VERSION(13, 0, 6):
+               con->uniras_enabled = true;
+               break;
+       default:
+               con->uniras_enabled = false;
+               break;
+       }
+
        con->update_channel_flag = false;
        con->features = 0;
        con->schema = 0;
drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c +1 -9
index b8b831a91bc7..6224c4921a42 100644
@@ -327,15 +327,7 @@ static int amdgpu_ras_mgr_sw_init(struct amdgpu_ip_block *ip_block)
        struct amdgpu_ras_mgr *ras_mgr;
        int ret = 0;
 
-       /* Disabled by default */
-       con->uniras_enabled = false;
-
-       if (amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 14) ||
-           amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 12) ||
-           amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 6) ||
-           adev->debug_enable_ras_aca)
-               con->uniras_enabled = true;
-       else
+       if (!con->uniras_enabled)
                return 0;
 
        ras_mgr = kzalloc(sizeof(*ras_mgr), GFP_KERNEL);

--
2.34.1