[PATCH 1/2] drm/amdgpu: Warn when bad pages approaches 90% threshold

Russell, Kent Kent.Russell at amd.com
Thu Oct 21 16:35:53 UTC 2021


[Public]

I had noticed that all of these RAS messages use DRM instead of dev_warn. I wasn't sure if there was a reason for that or not. It's definitely inconsistent.

DRM_ERROR("Partial read for checksum, res:%d\n", res);
DRM_DEBUG_DRIVER("Found existing EEPROM table with %d records",
DRM_ERROR("RAS table incorrect checksum or error:%d\n",
DRM_WARN("RAS records:%u exceeds 90%% of threshold:%d",
DRM_ERROR("RAS Table incorrect checksum or error:%d\n",
dev_info(adev->dev,  "records:%d threshold:%d, resetting RAS table header signature",
dev_err(adev->dev, "RAS records:%d exceed threshold:%d",
dev_warn(adev->dev, "GPU will be initialized due to bad_page_threshold = -2.");
DRM_INFO("Creating a new EEPROM table");

Might be worth making a separate patch to handle those inconsistencies. I agree that device is useful for this kind of error/warning/info

Kent

From: Lazar, Lijo <Lijo.Lazar at amd.com>
Sent: Thursday, October 21, 2021 12:31 PM
To: Russell, Kent <Kent.Russell at amd.com>; amd-gfx at lists.freedesktop.org
Cc: Russell, Kent <Kent.Russell at amd.com>; Tuikov, Luben <Luben.Tuikov at amd.com>; Joshi, Mukul <Mukul.Joshi at amd.com>
Subject: Re: [PATCH 1/2] drm/amdgpu: Warn when bad pages approaches 90% threshold


[Public]

Nit pick - suggest to use dev_warn for easy identification of the device.

Thanks,
Lijo
________________________________
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org<mailto:amd-gfx-bounces at lists.freedesktop.org>> on behalf of Kent Russell <kent.russell at amd.com<mailto:kent.russell at amd.com>>
Sent: Thursday, October 21, 2021 9:27:10 PM
To: amd-gfx at lists.freedesktop.org<mailto:amd-gfx at lists.freedesktop.org> <amd-gfx at lists.freedesktop.org<mailto:amd-gfx at lists.freedesktop.org>>
Cc: Russell, Kent <Kent.Russell at amd.com<mailto:Kent.Russell at amd.com>>; Tuikov, Luben <Luben.Tuikov at amd.com<mailto:Luben.Tuikov at amd.com>>; Joshi, Mukul <Mukul.Joshi at amd.com<mailto:Mukul.Joshi at amd.com>>
Subject: [PATCH 1/2] drm/amdgpu: Warn when bad pages approaches 90% threshold

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 at amd.com<mailto:luben.tuikov at amd.com>>
Cc: Mukul Joshi <Mukul.Joshi at amd.com<mailto:Mukul.Joshi at amd.com>>
Signed-off-by: Kent Russell <kent.russell at amd.com<mailto:kent.russell at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20211021/97c5ac68/attachment-0001.htm>


More information about the amd-gfx mailing list