Skip to contentSkip to conversation

enable umc ras ce interrupt

PATCH In review Tao Zhou 4 participants 9 messages Aug 1, 2019 4 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Tao Zhou

author
#0 lore raw

cover enable umc ras ce interrupt

These patches add support for umc ce interrupt, the interrupt is controlled by a error count threshold.

Tao Zhou (4):
drm/amdgpu: support ce interrupt in ras module drm/amdgpu: implement umc ras init function drm/amdgpu: update the calc algorithm of umc ecc error count drm/amdgpu: only uncorrectable error needs gpu reset

 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 12 ++++---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c   |  6 +++-
 drivers/gpu/drm/amd/amdgpu/umc_v6_1.c   | 42 ++++++++++++++++++++++---
 drivers/gpu/drm/amd/amdgpu/umc_v6_1.h   |  7 +++++
 4 files changed, 58 insertions(+), 9 deletions(-)
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#2 lore raw

PATCH 2/4 drm/amdgpu: implement umc ras init function

enable umc ec interrupt and initialize ecc error count

---
 drivers/gpu/drm/amd/amdgpu/umc_v6_1.c | 32 +++++++++++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/umc_v6_1.h |  7 ++++++
 2 files changed, 39 insertions(+)
drivers/gpu/drm/amd/amdgpu/umc_v6_1.c +32 -0
index 5747a0252624..82353f749374 100644
@@ -207,9 +207,41 @@ static void umc_v6_1_query_ras_error_address(struct amdgpu_device *adev,
 	amdgpu_umc_for_each_channel(umc_v6_1_query_error_address);
 }
 
+static void umc_v6_1_ras_init_per_channel(struct amdgpu_device *adev,
+					 struct ras_err_data *err_data,
+					 uint32_t umc_reg_offset, uint32_t channel_index)
+{
+	uint32_t ecc_err_cnt_sel, ecc_err_cnt_sel_addr;
+	uint32_t ecc_err_cnt_addr;
+
+	ecc_err_cnt_sel_addr =
+		SOC15_REG_OFFSET(UMC, 0, mmUMCCH0_0_EccErrCntSel);
+	ecc_err_cnt_addr =
+		SOC15_REG_OFFSET(UMC, 0, mmUMCCH0_0_EccErrCnt);
+
+	/* select the lower chip and check the error count */
+	ecc_err_cnt_sel = RREG32(ecc_err_cnt_sel_addr + umc_reg_offset);
+	ecc_err_cnt_sel = REG_SET_FIELD(ecc_err_cnt_sel, UMCCH0_0_EccErrCntSel,
+					EccErrCntCsSel, 0);
+	/* enable ce error interrupt */
+	ecc_err_cnt_sel = REG_SET_FIELD(ecc_err_cnt_sel, UMCCH0_0_EccErrCntSel,
+					EccErrInt, 0x1);
+	WREG32(ecc_err_cnt_sel_addr + umc_reg_offset, ecc_err_cnt_sel);
+	/* set error count to initial value */
+	WREG32(ecc_err_cnt_addr + umc_reg_offset, UMC_V6_1_CE_CNT_INIT);
+
+	/* select the higher chip and check the err counter */
+	ecc_err_cnt_sel = REG_SET_FIELD(ecc_err_cnt_sel, UMCCH0_0_EccErrCntSel,
+					EccErrCntCsSel, 1);
+	WREG32(ecc_err_cnt_sel_addr + umc_reg_offset, ecc_err_cnt_sel);
+	WREG32(ecc_err_cnt_addr + umc_reg_offset, UMC_V6_1_CE_CNT_INIT);
+}
+
 static void umc_v6_1_ras_init(struct amdgpu_device *adev)
 {
+	void *ras_error_status = NULL;
 
+	amdgpu_umc_for_each_channel(umc_v6_1_ras_init_per_channel);
 }
 
 const struct amdgpu_umc_funcs umc_v6_1_funcs = {
drivers/gpu/drm/amd/amdgpu/umc_v6_1.h +7 -0
index ad4598c0e495..dab9cbd292c5 100644
@@ -37,6 +37,13 @@
 /* UMC regiser per channel offset */
 #define UMC_V6_1_PER_CHANNEL_OFFSET		0x800
 
+/* EccErrCnt max value */
+#define UMC_V6_1_CE_CNT_MAX		0xffff
+/* umc ce interrupt threshold */
+#define UMC_V6_1_CE_INT_THRESHOLD	0xffff
+/* umc ce count initial value */
+#define UMC_V6_1_CE_CNT_INIT	(UMC_V6_1_CE_CNT_MAX - UMC_V6_1_CE_INT_THRESHOLD)
+
 extern const struct amdgpu_umc_funcs umc_v6_1_funcs;
 extern const uint32_t
 	umc_v6_1_channel_idx_tbl[UMC_V6_1_UMC_INSTANCE_NUM][UMC_V6_1_CHANNEL_INSTANCE_NUM];
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#3 lore raw

PATCH 3/4 drm/amdgpu: update the calc algorithm of umc ecc error count

In reply to a message not in the archive

the initial value of ecc error count can be adjusted

---
 drivers/gpu/drm/amd/amdgpu/umc_v6_1.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/umc_v6_1.c +6 -4
index 82353f749374..a1de6f5a2374 100644
@@ -98,9 +98,10 @@ static void umc_v6_1_query_correctable_error_count(struct amdgpu_device *adev,
 	WREG32(ecc_err_cnt_sel_addr + umc_reg_offset, ecc_err_cnt_sel);
 	ecc_err_cnt = RREG32(ecc_err_cnt_addr + umc_reg_offset);
 	*error_count +=
-		REG_GET_FIELD(ecc_err_cnt, UMCCH0_0_EccErrCnt, EccErrCnt);
+		(REG_GET_FIELD(ecc_err_cnt, UMCCH0_0_EccErrCnt, EccErrCnt) -
+		 UMC_V6_1_CE_CNT_INIT);
 	/* clear the lower chip err count */
-	WREG32(ecc_err_cnt_addr + umc_reg_offset, 0);
+	WREG32(ecc_err_cnt_addr + umc_reg_offset, UMC_V6_1_CE_CNT_INIT);
 
 	/* select the higher chip and check the err counter */
 	ecc_err_cnt_sel = REG_SET_FIELD(ecc_err_cnt_sel, UMCCH0_0_EccErrCntSel,
@@ -108,9 +109,10 @@ static void umc_v6_1_query_correctable_error_count(struct amdgpu_device *adev,
 	WREG32(ecc_err_cnt_sel_addr + umc_reg_offset, ecc_err_cnt_sel);
 	ecc_err_cnt = RREG32(ecc_err_cnt_addr + umc_reg_offset);
 	*error_count +=
-		REG_GET_FIELD(ecc_err_cnt, UMCCH0_0_EccErrCnt, EccErrCnt);
+		(REG_GET_FIELD(ecc_err_cnt, UMCCH0_0_EccErrCnt, EccErrCnt) -
+		UMC_V6_1_CE_CNT_INIT);
 	/* clear the higher chip err count */
-	WREG32(ecc_err_cnt_addr + umc_reg_offset, 0);
+	WREG32(ecc_err_cnt_addr + umc_reg_offset, UMC_V6_1_CE_CNT_INIT);
 
 	/* check for SRAM correctable error
 	  MCUMC_STATUS is a 64 bit register */
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#4 lore raw

PATCH 4/4 drm/amdgpu: only uncorrectable error needs gpu reset

In reply to a message not in the archive
---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +5 -1
index 05cbd90d9b6c..b6edad8bb31c 100644
@@ -250,7 +250,11 @@ static int gmc_v9_0_process_ras_data_cb(struct amdgpu_device *adev,
 	 */
 	if (adev->umc.funcs->query_ras_error_address)
 		adev->umc.funcs->query_ras_error_address(adev, err_data);
-	amdgpu_ras_reset_gpu(adev, 0);
+	
+	/* only uncorrectable error needs gpu reset */
+	if (err_data->ue_count)
+		amdgpu_ras_reset_gpu(adev, 0);
+
 	return AMDGPU_RAS_UE;
 }
 
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): [email protected]

Reviewed-by
#6 lore raw

Re: [PATCH 4/4] drm/amdgpu: only uncorrectable error needs gpu reset

Please add a patch description for this patch. With that fixed, the series is:

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Tao Zhou <[email protected]>
Sent: Thursday, August 1, 2019 2:53 AM
To: [email protected] <[email protected]>; Zhang, Hawking <[email protected]>; Li, Dennis <[email protected]>; Chen, Guchun <[email protected]>; Pan, Xinhui <[email protected]>
Cc: Zhou1, Tao <[email protected]>
Subject: [PATCH 4/4] drm/amdgpu: only uncorrectable error needs gpu reset

---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +5 -1
index 05cbd90d9b6c..b6edad8bb31c 100644
@@ -250,7 +250,11 @@ static int gmc_v9_0_process_ras_data_cb(struct amdgpu_device *adev,
          */
         if (adev->umc.funcs->query_ras_error_address)
                 adev->umc.funcs->query_ras_error_address(adev, err_data);
-       amdgpu_ras_reset_gpu(adev, 0);
+
+       /* only uncorrectable error needs gpu reset */
+       if (err_data->ue_count)
+               amdgpu_ras_reset_gpu(adev, 0);
+
         return AMDGPU_RAS_UE;
 }
 

--
2.17.1

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#7 lore raw
In reply to a message not in the archive

1.) Please fix the typo in patch #2 description: ec --> ce 2). Patch #2

+ ecc_err_cnt_sel = REG_SET_FIELD(ecc_err_cnt_sel, UMCCH0_0_EccErrCntSel,
+ EccErrInt, 0x1);
For the EccErrInt field, it should be programed to be (MAX - INIT), correct? but the hardcoded value seems not match with the value calculated by those macro.

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Tao Zhou
Sent: 2019年8月1日 14:54
To: [email protected]; Zhang, Hawking <[email protected]>; Li, Dennis <[email protected]>; Chen, Guchun <[email protected]>; Pan, Xinhui <[email protected]>
Cc: Zhou1, Tao <[email protected]>
Subject: [PATCH 0/4] enable umc ras ce interrupt

These patches add support for umc ce interrupt, the interrupt is controlled by a error count threshold.

Tao Zhou (4):
drm/amdgpu: support ce interrupt in ras module drm/amdgpu: implement umc ras init function drm/amdgpu: update the calc algorithm of umc ecc error count drm/amdgpu: only uncorrectable error needs gpu reset

 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 12 ++++---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c   |  6 +++-
 drivers/gpu/drm/amd/amdgpu/umc_v6_1.c   | 42 ++++++++++++++++++++++---
 drivers/gpu/drm/amd/amdgpu/umc_v6_1.h   |  7 +++++
 4 files changed, 58 insertions(+), 9 deletions(-)

--
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): DM5PR12MB14182B9F7AFD2BB48D479C8EFCDE0-2J9CzHegvk81aAVlcVN8UQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

author
#9 lore raw

EccErrInt field of EccErrCntSel specifies the type of interrupt, it's not threshold. But my comment for the code is not proper, I'll update the comment.

Quoted 46 lines

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: 2019年8月1日 15:52
To: Zhou1, Tao <[email protected]>; [email protected]; Li, Dennis <[email protected]>; Chen, Guchun <[email protected]>; Pan, Xinhui <[email protected]>
Cc: Zhou1, Tao <[email protected]>
Subject: RE: [PATCH 0/4] enable umc ras ce interrupt

1.) Please fix the typo in patch #2 description: ec --> ce 2). Patch #2

(quoted diff) +1 -0
+	ecc_err_cnt_sel = REG_SET_FIELD(ecc_err_cnt_sel,

UMCCH0_0_EccErrCntSel,

(quoted diff) +1 -0
+					EccErrInt, 0x1);

For the EccErrInt field, it should be programed to be (MAX - INIT), correct? but the hardcoded value seems not match with the value calculated by those macro.

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Tao Zhou
Sent: 2019年8月1日 14:54
To: [email protected]; Zhang, Hawking <[email protected]>; Li, Dennis <[email protected]>; Chen, Guchun <[email protected]>; Pan, Xinhui <[email protected]>
Cc: Zhou1, Tao <[email protected]>
Subject: [PATCH 0/4] enable umc ras ce interrupt

These patches add support for umc ce interrupt, the interrupt is controlled by a error count threshold.

Tao Zhou (4):
drm/amdgpu: support ce interrupt in ras module drm/amdgpu: implement umc ras init function drm/amdgpu: update the calc algorithm of umc ecc error count drm/amdgpu: only uncorrectable error needs gpu reset

 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 12 ++++---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c   |  6 +++-
 drivers/gpu/drm/amd/amdgpu/umc_v6_1.c   | 42
++++++++++++++++++++++---
 drivers/gpu/drm/amd/amdgpu/umc_v6_1.h   |  7 +++++
 4 files changed, 58 insertions(+), 9 deletions(-)
Quoted 7 lines

--
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#10 lore raw
In reply to a message not in the archive

1) Patch 1, looks the return value of our callback always returns UE case, but I assume CE case should also be covered. Maybe it's another topic.

	if (ret == AMDGPU_RAS_UE) {

+ /* these counts could be left as 0 if
+ * some blocks do not count error number
+ */
obj->err_data.ue_count += err_data.ue_count;
+ obj->err_data.ce_count += err_data.ce_count;

2) In Patch 2, one unused variable "ras_error_status" is there, do we need to remove it?

static void umc_v6_1_ras_init(struct amdgpu_device *adev) {
+ void *ras_error_status = NULL;

+ amdgpu_umc_for_each_channel(umc_v6_1_ras_init_per_channel);
}

Regards,
Guchun

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: Thursday, August 1, 2019 3:52 PM
To: Zhou1, Tao <[email protected]>; [email protected]; Li, Dennis <[email protected]>; Chen, Guchun <[email protected]>; Pan, Xinhui <[email protected]>
Cc: Zhou1, Tao <[email protected]>
Subject: RE: [PATCH 0/4] enable umc ras ce interrupt

1.) Please fix the typo in patch #2 description: ec --> ce 2). Patch #2

+ ecc_err_cnt_sel = REG_SET_FIELD(ecc_err_cnt_sel, UMCCH0_0_EccErrCntSel,
+ EccErrInt, 0x1);
For the EccErrInt field, it should be programed to be (MAX - INIT), correct? but the hardcoded value seems not match with the value calculated by those macro.

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Tao Zhou
Sent: 2019年8月1日 14:54
To: [email protected]; Zhang, Hawking <[email protected]>; Li, Dennis <[email protected]>; Chen, Guchun <[email protected]>; Pan, Xinhui <[email protected]>
Cc: Zhou1, Tao <[email protected]>
Subject: [PATCH 0/4] enable umc ras ce interrupt

These patches add support for umc ce interrupt, the interrupt is controlled by a error count threshold.

Tao Zhou (4):
drm/amdgpu: support ce interrupt in ras module drm/amdgpu: implement umc ras init function drm/amdgpu: update the calc algorithm of umc ecc error count drm/amdgpu: only uncorrectable error needs gpu reset

 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 12 ++++---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c   |  6 +++-
 drivers/gpu/drm/amd/amdgpu/umc_v6_1.c   | 42 ++++++++++++++++++++++---
 drivers/gpu/drm/amd/amdgpu/umc_v6_1.h   |  7 +++++
 4 files changed, 58 insertions(+), 9 deletions(-)

--
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): BN7PR12MB2707651008335A0DA8DB692CF1DE0-Zx/IyJUqfGLElradEdtikwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

author
#12 lore raw
Quoted 15 lines

-----Original Message-----
From: Chen, Guchun <[email protected]>
Sent: 2019年8月1日 16:22
To: Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; [email protected]; Li, Dennis <[email protected]>; Pan, Xinhui <[email protected]>
Cc: Zhou1, Tao <[email protected]>
Subject: RE: [PATCH 0/4] enable umc ras ce interrupt

1) Patch 1, looks the return value of our callback always returns UE case, but I assume CE case should also be covered. Maybe it's another topic.

	if (ret == AMDGPU_RAS_UE) {

Review

Quoted 5 lines
(quoted diff) +4 -0
+		/* these counts could be left as 0 if
+		 * some blocks do not count error number
+		 */
 		obj->err_data.ue_count += err_data.ue_count;
+		obj->err_data.ce_count += err_data.ce_count;

[Tao] Yes, it's a new topic. CE can also trigger interrupt, and even both ce and ue error can be found in one ras query. I think AMDGPU_RAS_SUCCESS is more suitable here, I'll provide a new patch to fix it.

Review

Quoted 8 lines

2) In Patch 2, one unused variable "ras_error_status" is there, do we need to remove it?

static void umc_v6_1_ras_init(struct amdgpu_device *adev) {

(quoted diff) +2 -0
+	void *ras_error_status = NULL;
 
+	amdgpu_umc_for_each_channel(umc_v6_1_ras_init_per_channel);
 }

[Tao] It's on purpose. amdgpu_umc_for_each_channel macro is a common definition for all umc channel functions, it will transfer ras_error_status to channel function.

Quoted 50 lines

Regards,
Guchun

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: Thursday, August 1, 2019 3:52 PM
To: Zhou1, Tao <[email protected]>; [email protected]; Li, Dennis <[email protected]>; Chen, Guchun <[email protected]>; Pan, Xinhui <[email protected]>
Cc: Zhou1, Tao <[email protected]>
Subject: RE: [PATCH 0/4] enable umc ras ce interrupt

1.) Please fix the typo in patch #2 description: ec --> ce 2). Patch #2

(quoted diff) +1 -0
+	ecc_err_cnt_sel = REG_SET_FIELD(ecc_err_cnt_sel,

UMCCH0_0_EccErrCntSel,

(quoted diff) +1 -0
+					EccErrInt, 0x1);

For the EccErrInt field, it should be programed to be (MAX - INIT), correct? but the hardcoded value seems not match with the value calculated by those macro.

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Tao Zhou
Sent: 2019年8月1日 14:54
To: [email protected]; Zhang, Hawking <[email protected]>; Li, Dennis <[email protected]>; Chen, Guchun <[email protected]>; Pan, Xinhui <[email protected]>
Cc: Zhou1, Tao <[email protected]>
Subject: [PATCH 0/4] enable umc ras ce interrupt

These patches add support for umc ce interrupt, the interrupt is controlled by a error count threshold.

Tao Zhou (4):
drm/amdgpu: support ce interrupt in ras module drm/amdgpu: implement umc ras init function drm/amdgpu: update the calc algorithm of umc ecc error count drm/amdgpu: only uncorrectable error needs gpu reset

 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 12 ++++---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c   |  6 +++-
 drivers/gpu/drm/amd/amdgpu/umc_v6_1.c   | 42
++++++++++++++++++++++---
 drivers/gpu/drm/amd/amdgpu/umc_v6_1.h   |  7 +++++
 4 files changed, 58 insertions(+), 9 deletions(-)
Quoted 7 lines

--
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx