All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu: Warn when bad pages approaches 90% threshold
@ 2021-10-21 15:57 Kent Russell
  2021-10-21 15:57 ` [PATCH 2/2] drm/amdgpu: Add kernel parameter support for ignoring bad page threshold Kent Russell
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Kent Russell @ 2021-10-21 15:57 UTC (permalink / raw)
  To: amd-gfx; +Cc: Kent Russell, Luben Tuikov, Mukul Joshi

dmesg doesn't warn when the number of bad pages approaches the
threshold for page retirement. WARN when the number of bad pages
is at 90% or greater for easier checks and planning, instead of waiting
until the GPU is full of bad pages.

Cc: Luben Tuikov <luben.tuikov@amd.com>
Cc: Mukul Joshi <Mukul.Joshi@amd.com>
Signed-off-by: Kent Russell <kent.russell@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
index f4c05ff4b26c..ce5089216474 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
@@ -1077,6 +1077,12 @@ int amdgpu_ras_eeprom_init(struct amdgpu_ras_eeprom_control *control,
 		if (res)
 			DRM_ERROR("RAS table incorrect checksum or error:%d\n",
 				  res);
+
+		/* Warn if we are at 90% of the threshold or above */
+		if ((10 * control->ras_num_recs) >= (ras->bad_page_cnt_threshold * 9))
+			DRM_WARN("RAS records:%u exceeds 90%% of threshold:%d",
+					control->ras_num_recs,
+					ras->bad_page_cnt_threshold);
 	} else if (hdr->header == RAS_TABLE_HDR_BAD &&
 		   amdgpu_bad_page_threshold != 0) {
 		res = __verify_ras_table_checksum(control);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-10-21 17:19 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-21 15:57 [PATCH 1/2] drm/amdgpu: Warn when bad pages approaches 90% threshold Kent Russell
2021-10-21 15:57 ` [PATCH 2/2] drm/amdgpu: Add kernel parameter support for ignoring bad page threshold Kent Russell
2021-10-21 16:21   ` Luben Tuikov
2021-10-21 16:42     ` Russell, Kent
2021-10-21 16:46       ` Luben Tuikov
2021-10-21 16:49         ` Russell, Kent
2021-10-21 16:55           ` Luben Tuikov
2021-10-21 16:31 ` [PATCH 1/2] drm/amdgpu: Warn when bad pages approaches 90% threshold Lazar, Lijo
2021-10-21 16:35   ` Russell, Kent
2021-10-21 16:35 ` Luben Tuikov
2021-10-21 16:44   ` Luben Tuikov
2021-10-21 16:47     ` Russell, Kent
2021-10-21 16:49       ` Luben Tuikov
2021-10-21 17:18   ` Felix Kuehling

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.