Skip to contentSkip to conversation

drm/amdgpu/ras: Parse all deferred errors with UMC aca handle

PATCH In review Ce Sun 2 participants 4 messages Jun 3 – Jun 5 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

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

Ce Sun

author
#1 lore raw

PATCH 1/2 drm/amdgpu/ras: Parse all deferred errors with UMC aca handle

We should only increase the deferred errors in UMC block

---
 drivers/gpu/drm/amd/ras/rascore/ras_aca_v1_0.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/ras/rascore/ras_aca_v1_0.c +6 -7
index 210fbd8851a6..840610538c1f 100644
@@ -213,7 +213,7 @@ static int aca_parse_umc_bank(struct ras_core_context *ras_core,
 	struct aca_bank_reg *bank = (struct aca_bank_reg *)data;
 	struct aca_bank_ecc *ecc = (struct aca_bank_ecc *)buf;
 	struct aca_ecc_info bank_info;
-	uint32_t ext_error_code;
+	uint32_t ext_error_code, misc0_errcnt;
 	uint64_t status0;
 
 	status0 = bank->regs[ACA_REG_IDX__STATUS];
@@ -228,15 +228,14 @@ static int aca_parse_umc_bank(struct ras_core_context *ras_core,
 	ecc->bank_info.addr = bank->regs[ACA_REG_IDX__ADDR];
 
 	ext_error_code = ACA_REG_STATUS_ERRORCODEEXT(status0);
+	misc0_errcnt = ACA_REG_MISC0_ERRCNT(bank->regs[ACA_REG_IDX__MISC0]);
 
 	if (aca_check_umc_de(ras_core, status0))
-		ecc->de_count = 1;
+		ecc->de_count = misc0_errcnt ? misc0_errcnt : 1;
 	else if (aca_check_umc_ue(ras_core, status0))
-		ecc->ue_count = ext_error_code ?
-			1 : ACA_REG_MISC0_ERRCNT(bank->regs[ACA_REG_IDX__MISC0]);
+		ecc->ue_count = ext_error_code ? 1 : misc0_errcnt;
 	else if (aca_check_umc_ce(ras_core, status0))
-		ecc->ce_count = ext_error_code ?
-			1 : ACA_REG_MISC0_ERRCNT(bank->regs[ACA_REG_IDX__MISC0]);
+		ecc->ce_count = ext_error_code ? 1 : misc0_errcnt;
 
 	return 0;
 }
@@ -266,7 +265,7 @@ static int aca_parse_bank_default(struct ras_core_context *ras_core,
 	ecc->bank_info.addr = bank->regs[ACA_REG_IDX__ADDR];
 
 	if (aca_check_bank_is_de(ras_core, status)) {
-		ecc->de_count = 1;
+		ecc->de_count = 0;
 	} else {
 		if (bank->ecc_type == RAS_ERR_TYPE__UE)
 			ecc->ue_count = 1;
Signature · 1 line
2.34.1
Reviewed-by on v1 1/2
#2 lore raw

AMD General

Quoted 67 lines

-----Original Message-----
From: Sun, Ce(Overlord) <[email protected]>
Sent: Wednesday, June 3, 2026 10:51 AM
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 v1 1/2] drm/amdgpu/ras: Parse all deferred errors with UMC aca handle

We should only increase the deferred errors in UMC block

---
 drivers/gpu/drm/amd/ras/rascore/ras_aca_v1_0.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/ras/rascore/ras_aca_v1_0.c +1 -1
index 210fbd8851a6..840610538c1f 100644
@@ -213,7 +213,7 @@ static int aca_parse_umc_bank(struct ras_core_context
 *ras_core,
      struct aca_bank_reg *bank = (struct aca_bank_reg *)data;
      struct aca_bank_ecc *ecc = (struct aca_bank_ecc *)buf;
      struct aca_ecc_info bank_info;
-     uint32_t ext_error_code;
+     uint32_t ext_error_code, misc0_errcnt;
      uint64_t status0;
 
      status0 = bank->regs[ACA_REG_IDX__STATUS]; @@ -228,15 +228,14
@@ static int aca_parse_umc_bank(struct ras_core_context *ras_core,
      ecc->bank_info.addr = bank->regs[ACA_REG_IDX__ADDR];

      ext_error_code = ACA_REG_STATUS_ERRORCODEEXT(status0);

+ misc0_errcnt = ACA_REG_MISC0_ERRCNT(bank-

Quoted 1 line

regs[ACA_REG_IDX__MISC0]);

if (aca_check_umc_de(ras_core, status0))

drivers/gpu/drm/amd/ras/rascore/ras_aca_v1_0.c +1 -3
-             ecc->de_count = 1;
+             ecc->de_count = misc0_errcnt ? misc0_errcnt : 1;
      else if (aca_check_umc_ue(ras_core, status0))
-             ecc->ue_count = ext_error_code ?
-                     1 : ACA_REG_MISC0_ERRCNT(bank-
Quoted 1 line

regs[ACA_REG_IDX__MISC0]);

drivers/gpu/drm/amd/ras/rascore/ras_aca_v1_0.c +1 -2
+             ecc->ue_count = ext_error_code ? 1 : misc0_errcnt;
      else if (aca_check_umc_ce(ras_core, status0))
-             ecc->ce_count = ext_error_code ?
-                     1 : ACA_REG_MISC0_ERRCNT(bank-
Quoted 1 line

regs[ACA_REG_IDX__MISC0]);

drivers/gpu/drm/amd/ras/rascore/ras_aca_v1_0.c +2 -1
+             ecc->ce_count = ext_error_code ? 1 : misc0_errcnt;
 
      return 0;
 }
@@ -266,7 +265,7 @@ static int aca_parse_bank_default(struct ras_core_context
 *ras_core,
      ecc->bank_info.addr = bank->regs[ACA_REG_IDX__ADDR];
 
      if (aca_check_bank_is_de(ras_core, status)) {
-             ecc->de_count = 1;
+             ecc->de_count = 0;
      } else {
              if (bank->ecc_type == RAS_ERR_TYPE__UE)
                      ecc->ue_count = 1;

--
2.34.1

author
#3 lore raw

PATCH 2/2 drm/amdgpu/ras: adjust the update of RAS bad page number

In reply to a message not in the archive

One eeprom record may not map to unit number of bad pages, Correct the relevant update logic accordingly

---
 drivers/gpu/drm/amd/ras/rascore/ras_umc.c       | 3 ++-
 drivers/gpu/drm/amd/ras/rascore/ras_umc.h       | 2 ++
 drivers/gpu/drm/amd/ras/rascore/ras_umc_v12_0.c | 3 ++-
 3 files changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/ras/rascore/ras_umc.c +2 -1
index e5971c3dd7da..11490048a282 100644
@@ -548,7 +548,8 @@ static int ras_umc_save_bad_pages(struct ras_core_context *ras_core)
 			goto exit;
 		}
 
-		RAS_DEV_INFO(ras_core->dev, "Saved %d pages to EEPROM table.\n", save_count);
+		RAS_DEV_INFO(ras_core->dev, "Saved %d pages to EEPROM table.\n",
+				save_count * ras_core->ras_umc.retire_unit);
 	}
 
 exit:
drivers/gpu/drm/amd/ras/rascore/ras_umc.h +2 -0
index 237525b46b9b..e9e34bbdbd30 100644
@@ -143,6 +143,8 @@ struct ras_umc {
 	u32 pending_ecc_count;
 	/* number of entries dropped because pending_ecc_list was full */
 	u32 pending_ecc_dropped;
+	/* how many pages are retired */
+	u32 retire_unit;
 };
 
 /*
drivers/gpu/drm/amd/ras/rascore/ras_umc_v12_0.c +2 -1
index b809a2f21d73..0064e89ac1ab 100644
@@ -110,6 +110,7 @@ static void __get_nps_pa_flip_bits(struct ras_core_context *ras_core,
 			"Unknown HBM type, set RAS retire flip bits to the value in NPS1 mode.\n");
 		break;
 	}
+	ras_core->ras_umc.retire_unit = 0x1 << flip_bits->bit_num;
 }
 
 static uint64_t  convert_nps_pa_to_row_pa(struct ras_core_context *ras_core,
@@ -166,7 +167,7 @@ static int lookup_bad_pages_in_a_row(struct ras_core_context *ras_core,
 
 	idx = 0;
 	row = 0;
-	retire_unit = 0x1 << flip_bits.bit_num;
+	retire_unit = ras_core->ras_umc.retire_unit;
 	/* loop for all possibilities of retire bits */
 	for (column = 0; column < retire_unit; column++) {
 		soc_pa = row_pa;
Signature · 1 line
2.34.1
#4 lore raw

RE: [PATCH v1 2/2] drm/amdgpu/ras: adjust the update of RAS bad page number

AMD General

As discussed offline, the saved page number can be smaller than save_count * ras_core->ras_umc.retire_unit since page address could be invalid and needs to be excluded.

Tao

Quoted 79 lines

-----Original Message-----
From: Sun, Ce(Overlord) <[email protected]>
Sent: Wednesday, June 3, 2026 10:52 AM
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 v1 2/2] drm/amdgpu/ras: adjust the update of RAS bad page number

One eeprom record may not map to unit number of bad pages, Correct the relevant update logic accordingly

---
 drivers/gpu/drm/amd/ras/rascore/ras_umc.c       | 3 ++-
 drivers/gpu/drm/amd/ras/rascore/ras_umc.h       | 2 ++
 drivers/gpu/drm/amd/ras/rascore/ras_umc_v12_0.c | 3 ++-
 3 files changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/ras/rascore/ras_umc.c +2 -1
index e5971c3dd7da..11490048a282 100644
@@ -548,7 +548,8 @@ static int ras_umc_save_bad_pages(struct
 ras_core_context *ras_core)
                      goto exit;
              }
 
-             RAS_DEV_INFO(ras_core->dev, "Saved %d pages to EEPROM
 table.\n", save_count);
+             RAS_DEV_INFO(ras_core->dev, "Saved %d pages to EEPROM
 table.\n",
+                             save_count * ras_core->ras_umc.retire_unit);
      }

exit:

drivers/gpu/drm/amd/ras/rascore/ras_umc.h +2 -0
index 237525b46b9b..e9e34bbdbd30 100644
@@ -143,6 +143,8 @@ struct ras_umc {
      u32 pending_ecc_count;
      /* number of entries dropped because pending_ecc_list was full */
      u32 pending_ecc_dropped;
+     /* how many pages are retired */
+     u32 retire_unit;
 };
 
 /*
drivers/gpu/drm/amd/ras/rascore/ras_umc_v12_0.c +1 -0
index b809a2f21d73..0064e89ac1ab 100644
@@ -110,6 +110,7 @@ static void __get_nps_pa_flip_bits(struct ras_core_context
 *ras_core,
                      "Unknown HBM type, set RAS retire flip bits to the value in
 NPS1 mode.\n");
              break;
      }
+     ras_core->ras_umc.retire_unit = 0x1 << flip_bits->bit_num;
 }

static uint64_t convert_nps_pa_to_row_pa(struct ras_core_context *ras_core, @@
-166,7 +167,7 @@ static int lookup_bad_pages_in_a_row(struct ras_core_context *ras_core,

      idx = 0;
      row = 0;
drivers/gpu/drm/amd/ras/rascore/ras_umc_v12_0.c +1 -2
-     retire_unit = 0x1 << flip_bits.bit_num;
+     retire_unit = ras_core->ras_umc.retire_unit;
      /* loop for all possibilities of retire bits */
      for (column = 0; column < retire_unit; column++) {
              soc_pa = row_pa;
--

2.34.1