Skip to contentSkip to conversation

drm/admgpu: fix unexpected block id

PATCH Superseded Stanley.Yang 4 participants 8 messages Apr 10, 2023 – Apr 11, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/admgpu: fix unexpected block id

Change-Id Icceb43556eec802f11c2077c1c58a1e92c9df599
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 4 ++++
 drivers/gpu/drm/amd/amdgpu/ta_ras_if.h  | 2 ++
 2 files changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h +4 -0
index ef38f4c93df0..17b3d1992e80 100644
@@ -583,6 +583,10 @@ amdgpu_ras_block_to_ta(enum amdgpu_ras_block block) {
 		return TA_RAS_BLOCK__FUSE;
 	case AMDGPU_RAS_BLOCK__MCA:
 		return TA_RAS_BLOCK__MCA;
+	case AMDGPU_RAS_BLOCK__VCN:
+		return TA_RAS_BLOCK__VCN;
+	case AMDGPU_RAS_BLOCK__JPEG:
+		return TA_RAS_BLOCK__JPEG;
 	default:
 		WARN_ONCE(1, "RAS ERROR: unexpected block id %d\n", block);
 		return TA_RAS_BLOCK__UMC;
drivers/gpu/drm/amd/amdgpu/ta_ras_if.h +2 -0
index 509d8a1945eb..30d0482ac466 100644
@@ -84,6 +84,8 @@ enum ta_ras_block {
 	TA_RAS_BLOCK__MP1,
 	TA_RAS_BLOCK__FUSE,
 	TA_RAS_BLOCK__MCA,
+	TA_RAS_BLOCK__VCN,
+	TA_RAS_BLOCK__JPEG,
 	TA_NUM_BLOCK_MAX
 };
 
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/2 drm/amdgpu: correct ras enabled flag

XGMI RAS should be according to the gmc xmgi supported flag and xgmi physical nodes number.

Change-Id Idf3600b30584b10b528e7237d103d84d5097b7e0
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +8 -0
index 4069bce9479f..d26a93272bf2 100644
@@ -2430,6 +2430,14 @@ static void amdgpu_ras_check_supported(struct amdgpu_device *adev)
 			else
 				adev->ras_hw_enabled &= ~(1 << AMDGPU_RAS_BLOCK__VCN |
 							1 << AMDGPU_RAS_BLOCK__JPEG);
+
+			/*
+			 * XGMI RAS is determined by xgmi supported flags
+			 * and xgmi num physical nodes
+			 */
+			if (!adev->gmc.xgmi.supported ||
+			    adev->gmc.xmgi.num_physical_nodes == 0)
+				adev->ras_hw_enabled &= ~(1 << AMDGPU_RAS_BLOCK__XGMI_WAFL);
 		} else {
 			dev_info(adev->dev, "SRAM ECC is not presented.\n");
 		}
Signature · 1 line
2.17.1
Reviewed-by on v1 2/2
#2 lore raw

RE: [PATCH Review 2/2] drm/amdgpu: correct ras enabled flag

[AMD Official Use Only - General]

The series is:

Quoted 43 lines

-----Original Message-----
From: Stanley.Yang <[email protected]>
Sent: Monday, April 10, 2023 7:48 PM
To: [email protected]; Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>
Cc: Yang, Stanley <[email protected]>
Subject: [PATCH Review 2/2] drm/amdgpu: correct ras enabled flag

XGMI RAS should be according to the gmc xmgi supported flag and xgmi physical nodes number.

Change-Id Idf3600b30584b10b528e7237d103d84d5097b7e0
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0 -0
index 4069bce9479f..d26a93272bf2 100644
@@ -2430,6 +2430,14 @@ static void amdgpu_ras_check_supported(struct
 amdgpu_device *adev)
 			else
 				adev->ras_hw_enabled &= ~(1 <<

AMDGPU_RAS_BLOCK__VCN |
1 <<
AMDGPU_RAS_BLOCK__JPEG);

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +8 -0
+
+			/*
+			 * XGMI RAS is determined by xgmi supported flags
+			 * and xgmi num physical nodes
+			 */
+			if (!adev->gmc.xgmi.supported ||
+			    adev->gmc.xmgi.num_physical_nodes == 0)
+				adev->ras_hw_enabled &= ~(1 <<

AMDGPU_RAS_BLOCK__XGMI_WAFL);

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0 -1
 		} else {
 			dev_info(adev->dev, "SRAM ECC is not presented.\n");
 		}
--

2.17.1

#3 lore raw

Re: [PATCH Review 2/2] drm/amdgpu: correct ras enabled flag

In reply to Stanley.Yang

[AMD Official Use Only - General]

Just check gmc.xmgi.num_physical_nodes == 0 should be good enough for the case that we only have single ALDEBRAN/ARCURUS available in system.

In such case, there is no need to expose xgmi_wafl ras node.

Regards,
Hawking

From: Stanley.Yang <[email protected]>
Date: Monday, April 10, 2023 at 19:48
To: [email protected] <[email protected]>, Zhang, Hawking <[email protected]>, Zhou1, Tao <[email protected]>
Cc: Yang, Stanley <[email protected]>
Subject: [PATCH Review 2/2] drm/amdgpu: correct ras enabled flag
XGMI RAS should be according to the gmc xmgi supported flag
and xgmi physical nodes number.

Change-Id Idf3600b30584b10b528e7237d103d84d5097b7e0
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +8 -0
index 4069bce9479f..d26a93272bf2 100644
@@ -2430,6 +2430,14 @@ static void amdgpu_ras_check_supported(struct amdgpu_device *adev)
                         else
                                 adev->ras_hw_enabled &= ~(1 << AMDGPU_RAS_BLOCK__VCN |
                                                         1 << AMDGPU_RAS_BLOCK__JPEG);
+
+                       /*
+                        * XGMI RAS is determined by xgmi supported flags
+                        * and xgmi num physical nodes
+                        */
+                       if (!adev->gmc.xgmi.supported ||
+                           adev->gmc.xmgi.num_physical_nodes == 0)
+                               adev->ras_hw_enabled &= ~(1 << AMDGPU_RAS_BLOCK__XGMI_WAFL);
                 } else {
                         dev_info(adev->dev, "SRAM ECC is not presented.\n");
                 }

--
2.17.1

#4 lore raw

RE: [PATCH Review 2/2] drm/amdgpu: correct ras enabled flag

[AMD Official Use Only - General]

Thanks Hawking. I will update.

Regards,
Stanley
From: Zhang, Hawking <[email protected]>
Sent: Tuesday, April 11, 2023 12:05 PM
To: Yang, Stanley <[email protected]>; [email protected]; Zhou1, Tao <[email protected]>
Cc: Yang, Stanley <[email protected]>
Subject: Re: [PATCH Review 2/2] drm/amdgpu: correct ras enabled flag

[AMD Official Use Only - General]

Just check gmc.xmgi.num_physical_nodes == 0 should be good enough for the case that we only have single ALDEBRAN/ARCURUS available in system.

In such case, there is no need to expose xgmi_wafl ras node.

Regards,
Hawking

From: Stanley.Yang <[email protected]<mailto:[email protected]>>
Date: Monday, April 10, 2023 at 19:48
To: [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>, Zhang, Hawking <[email protected]<mailto:[email protected]>>, Zhou1, Tao <[email protected]<mailto:[email protected]>>
Cc: Yang, Stanley <[email protected]<mailto:[email protected]>>
Subject: [PATCH Review 2/2] drm/amdgpu: correct ras enabled flag
XGMI RAS should be according to the gmc xmgi supported flag
and xgmi physical nodes number.

Change-Id Idf3600b30584b10b528e7237d103d84d5097b7e0
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +8 -0
index 4069bce9479f..d26a93272bf2 100644
@@ -2430,6 +2430,14 @@ static void amdgpu_ras_check_supported(struct amdgpu_device *adev)
                         else
                                 adev->ras_hw_enabled &= ~(1 << AMDGPU_RAS_BLOCK__VCN |
                                                         1 << AMDGPU_RAS_BLOCK__JPEG);
+
+                       /*
+                        * XGMI RAS is determined by xgmi supported flags
+                        * and xgmi num physical nodes
+                        */
+                       if (!adev->gmc.xgmi.supported ||
+                           adev->gmc.xmgi.num_physical_nodes == 0)
+                               adev->ras_hw_enabled &= ~(1 << AMDGPU_RAS_BLOCK__XGMI_WAFL);
                 } else {
                         dev_info(adev->dev, "SRAM ECC is not presented.\n");
                 }

--
2.17.1

Reviewed-by on v1 1/2
#5 lore raw
In reply to Stanley.Yang

[AMD Official Use Only - General]

Regards,
Hawking

From: Stanley.Yang <[email protected]>
Date: Monday, April 10, 2023 at 19:48
To: [email protected] <[email protected]>, Zhang, Hawking <[email protected]>, Zhou1, Tao <[email protected]>
Cc: Yang, Stanley <[email protected]>
Subject: [PATCH Review 1/2] drm/admgpu: fix unexpected block id

Change-Id Icceb43556eec802f11c2077c1c58a1e92c9df599
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 4 ++++
 drivers/gpu/drm/amd/amdgpu/ta_ras_if.h  | 2 ++
 2 files changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h +4 -0
index ef38f4c93df0..17b3d1992e80 100644
@@ -583,6 +583,10 @@ amdgpu_ras_block_to_ta(enum amdgpu_ras_block block) {
                 return TA_RAS_BLOCK__FUSE;
         case AMDGPU_RAS_BLOCK__MCA:
                 return TA_RAS_BLOCK__MCA;
+       case AMDGPU_RAS_BLOCK__VCN:
+               return TA_RAS_BLOCK__VCN;
+       case AMDGPU_RAS_BLOCK__JPEG:
+               return TA_RAS_BLOCK__JPEG;
         default:
                 WARN_ONCE(1, "RAS ERROR: unexpected block id %d\n", block);
                 return TA_RAS_BLOCK__UMC;
drivers/gpu/drm/amd/amdgpu/ta_ras_if.h +2 -0
index 509d8a1945eb..30d0482ac466 100644
@@ -84,6 +84,8 @@ enum ta_ras_block {
         TA_RAS_BLOCK__MP1,
         TA_RAS_BLOCK__FUSE,
         TA_RAS_BLOCK__MCA,
+       TA_RAS_BLOCK__VCN,
+       TA_RAS_BLOCK__JPEG,
         TA_NUM_BLOCK_MAX
 };
 

--
2.17.1

#6 lore raw
In reply to Stanley.Yang

A spelling typo in subject, s/admgpu/amdgpu :)

Also maybe it's necessary to add a body text in commit message.

Regards,
Guchun

Quoted 50 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Stanley.Yang
Sent: Monday, April 10, 2023 7:48 PM
To: [email protected]; Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>
Cc: Yang, Stanley <[email protected]>
Subject: [PATCH Review 1/2] drm/admgpu: fix unexpected block id

Change-Id Icceb43556eec802f11c2077c1c58a1e92c9df599
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 4 ++++
drivers/gpu/drm/amd/amdgpu/ta_ras_if.h  | 2 ++
 2 files changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h +4 -0
index ef38f4c93df0..17b3d1992e80 100644
@@ -583,6 +583,10 @@ amdgpu_ras_block_to_ta(enum amdgpu_ras_block
 block) {
 		return TA_RAS_BLOCK__FUSE;
 	case AMDGPU_RAS_BLOCK__MCA:
 		return TA_RAS_BLOCK__MCA;
+	case AMDGPU_RAS_BLOCK__VCN:
+		return TA_RAS_BLOCK__VCN;
+	case AMDGPU_RAS_BLOCK__JPEG:
+		return TA_RAS_BLOCK__JPEG;
 	default:
 		WARN_ONCE(1, "RAS ERROR: unexpected block id %d\n",

block);

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h +0 -0
 		return TA_RAS_BLOCK__UMC;
drivers/gpu/drm/amd/amdgpu/ta_ras_if.h +2 -1
index 509d8a1945eb..30d0482ac466 100644
@@ -84,6 +84,8 @@ enum ta_ras_block {
 	TA_RAS_BLOCK__MP1,
 	TA_RAS_BLOCK__FUSE,
 	TA_RAS_BLOCK__MCA,
+	TA_RAS_BLOCK__VCN,
+	TA_RAS_BLOCK__JPEG,
 	TA_NUM_BLOCK_MAX
 };
 
--

2.17.1

#7 lore raw

[AMD Official Use Only - General]

Hi Guchun,

Thanks, will update.

Regards,
Stanley

Quoted 67 lines

-----Original Message-----
From: Chen, Guchun <[email protected]>
Sent: Tuesday, April 11, 2023 12:48 PM
To: Yang, Stanley <[email protected]>; [email protected]; Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>
Cc: Yang, Stanley <[email protected]>
Subject: RE: [PATCH Review 1/2] drm/admgpu: fix unexpected block id

A spelling typo in subject, s/admgpu/amdgpu :)

Also maybe it's necessary to add a body text in commit message.

Regards,
Guchun

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h amdgpu_ras_block_to_ta(enum

Quoted 22 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Stanley.Yang
Sent: Monday, April 10, 2023 7:48 PM
To: [email protected]; Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>
Cc: Yang, Stanley <[email protected]>
Subject: [PATCH Review 1/2] drm/admgpu: fix unexpected block id

Change-Id Icceb43556eec802f11c2077c1c58a1e92c9df599
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 4 ++++
drivers/gpu/drm/amd/amdgpu/ta_ras_if.h  | 2 ++
 2 files changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h +0 -0
index ef38f4c93df0..17b3d1992e80 100644
@@ -583,6 +583,10 @@ amdgpu_ras_block_to_ta(enum

amdgpu_ras_block

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h amdgpu_ras_block_to_ta(enum amdgpu_ras_block block) {

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h +4 -0
 block) {
 		return TA_RAS_BLOCK__FUSE;
 	case AMDGPU_RAS_BLOCK__MCA:
 		return TA_RAS_BLOCK__MCA;
+	case AMDGPU_RAS_BLOCK__VCN:
+		return TA_RAS_BLOCK__VCN;
+	case AMDGPU_RAS_BLOCK__JPEG:
+		return TA_RAS_BLOCK__JPEG;
 	default:
 		WARN_ONCE(1, "RAS ERROR: unexpected block id %d\n",

block);

Quoted 17 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h +0 -0
 		return TA_RAS_BLOCK__UMC;
drivers/gpu/drm/amd/amdgpu/ta_ras_if.h +2 -1
index 509d8a1945eb..30d0482ac466 100644
@@ -84,6 +84,8 @@ enum ta_ras_block {
 	TA_RAS_BLOCK__MP1,
 	TA_RAS_BLOCK__FUSE,
 	TA_RAS_BLOCK__MCA,
+	TA_RAS_BLOCK__VCN,
+	TA_RAS_BLOCK__JPEG,
 	TA_NUM_BLOCK_MAX
 };
 
--

2.17.1