From: "Lazar, Lijo" <lijo.lazar@amd.com>
To: Gangliang Xie <ganglxie@amd.com>, amd-gfx@lists.freedesktop.org
Cc: tao.zhou1@amd.com, YiPeng.Chai@amd.com, KevinYang.Wang@amd.com
Subject: Re: [PATCH 07/14] drm/amd/ras: add check safety watermark func for pmfw eeprom
Date: Fri, 30 Jan 2026 11:20:27 +0530 [thread overview]
Message-ID: <02c5ca3d-fb75-4410-ab38-da74caf8d367@amd.com> (raw)
In-Reply-To: <20260130022950.1160058-7-ganglxie@amd.com>
On 30-Jan-26 7:59 AM, Gangliang Xie wrote:
> add check safety watermark func for pmfw eeprom
>
> Signed-off-by: Gangliang Xie <ganglxie@amd.com>
> ---
> .../gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c | 3 ++
> drivers/gpu/drm/amd/ras/rascore/ras_core.c | 3 ++
> .../gpu/drm/amd/ras/rascore/ras_eeprom_fw.c | 30 +++++++++++++++++++
> .../gpu/drm/amd/ras/rascore/ras_eeprom_fw.h | 1 +
> 4 files changed, 37 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c b/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c
> index 923bddd0af3a..36c264ab889c 100644
> --- a/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c
> +++ b/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c
> @@ -570,6 +570,9 @@ bool amdgpu_ras_mgr_check_eeprom_safety_watermark(struct amdgpu_device *adev)
> if (!amdgpu_ras_mgr_is_ready(adev))
> return false;
>
> + if (ras_fw_eeprom_supported(ras_mgr->ras_core))
> + return ras_fw_eeprom_check_safety_watermark(ras_mgr->ras_core);
> +
> return ras_eeprom_check_safety_watermark(ras_mgr->ras_core);
> }
>
> diff --git a/drivers/gpu/drm/amd/ras/rascore/ras_core.c b/drivers/gpu/drm/amd/ras/rascore/ras_core.c
> index 91c883f16ae5..1f2ce3749d43 100644
> --- a/drivers/gpu/drm/amd/ras/rascore/ras_core.c
> +++ b/drivers/gpu/drm/amd/ras/rascore/ras_core.c
> @@ -561,6 +561,9 @@ bool ras_core_is_ready(struct ras_core_context *ras_core)
>
> bool ras_core_check_safety_watermark(struct ras_core_context *ras_core)
> {
> + if (ras_fw_eeprom_supported(ras_core))
> + return ras_fw_eeprom_check_safety_watermark(ras_core);
> +
> return ras_eeprom_check_safety_watermark(ras_core);
> }
>
> diff --git a/drivers/gpu/drm/amd/ras/rascore/ras_eeprom_fw.c b/drivers/gpu/drm/amd/ras/rascore/ras_eeprom_fw.c
> index ae63e7394829..34a4161251b3 100644
> --- a/drivers/gpu/drm/amd/ras/rascore/ras_eeprom_fw.c
> +++ b/drivers/gpu/drm/amd/ras/rascore/ras_eeprom_fw.c
> @@ -190,3 +190,33 @@ int ras_fw_eeprom_reset_table(struct ras_core_context *ras_core)
>
> return res;
> }
> +
> +bool ras_fw_eeprom_check_safety_watermark(struct ras_core_context *ras_core)
> +{
Again looks like duplicate logic. ras_eeprom can carry the threshold
config regardless of the access type. There is nothing in here specific
to the way eeprom is accessed.
Thanks,
Lijo
> + struct ras_fw_eeprom_control *control = &ras_core->ras_fw_eeprom;
> + bool ret = false;
> + int bad_page_count;
> +
> + if (!control->record_threshold_config)
> + return false;
> +
> + bad_page_count = ras_umc_get_badpage_count(ras_core);
> +
> + if (bad_page_count > control->record_threshold_count)
> + RAS_DEV_WARN(ras_core->dev, "RAS records:%d exceed threshold:%d",
> + bad_page_count, control->record_threshold_count);
> +
> + if ((control->record_threshold_config == WARN_NONSTOP_OVER_THRESHOLD) ||
> + (control->record_threshold_config == NONSTOP_OVER_THRESHOLD)) {
> + RAS_DEV_WARN(ras_core->dev,
> + "Please consult AMD Service Action Guide (SAG) for appropriate service procedures.\n");
> + ret = false;
> + } else {
> + ras_core->is_rma = true;
> + RAS_DEV_WARN(ras_core->dev,
> + "Please consider adjusting the customized threshold.\n");
> + ret = true;
> + }
> +
> + return ret;
> +}
> diff --git a/drivers/gpu/drm/amd/ras/rascore/ras_eeprom_fw.h b/drivers/gpu/drm/amd/ras/rascore/ras_eeprom_fw.h
> index a1003db3c33b..b0d3eade4377 100644
> --- a/drivers/gpu/drm/amd/ras/rascore/ras_eeprom_fw.h
> +++ b/drivers/gpu/drm/amd/ras/rascore/ras_eeprom_fw.h
> @@ -67,5 +67,6 @@ int ras_fw_get_badpage_ipid(struct ras_core_context *ras_core,
> int ras_fw_erase_ras_table(struct ras_core_context *ras_core,
> uint32_t *result);
> int ras_fw_eeprom_reset_table(struct ras_core_context *ras_core);
> +bool ras_fw_eeprom_check_safety_watermark(struct ras_core_context *ras_core);
>
> #endif
next prev parent reply other threads:[~2026-01-30 5:50 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-30 2:29 [PATCH 01/14] drm/amd/pm: add pmfw eeprom messages into uniras interface Gangliang Xie
2026-01-30 2:29 ` [PATCH 02/14] drm/amd/pm: add feature query interface for uniras Gangliang Xie
2026-01-30 2:29 ` [PATCH 03/14] drm/amd/ras: add pmfw eeprom smu interfaces Gangliang Xie
2026-01-30 3:02 ` Wang, Yang(Kevin)
2026-01-30 4:31 ` Xie, Patrick
2026-01-30 5:41 ` Lazar, Lijo
2026-01-30 8:07 ` Xie, Patrick
2026-01-30 2:29 ` [PATCH 04/14] drm/amd/ras: add uniras smu feature flag init func Gangliang Xie
2026-01-30 2:29 ` [PATCH 05/14] drm/amd/ras: add wrapper funcs for pmfw eeprom Gangliang Xie
2026-01-30 5:44 ` Lazar, Lijo
2026-01-30 2:29 ` [PATCH 06/14] drm/amd/ras: Add table reset func " Gangliang Xie
2026-01-30 5:48 ` Lazar, Lijo
2026-01-30 8:14 ` Xie, Patrick
2026-01-30 2:29 ` [PATCH 07/14] drm/amd/ras: add check safety watermark " Gangliang Xie
2026-01-30 5:50 ` Lazar, Lijo [this message]
2026-01-30 2:29 ` [PATCH 08/14] drm/amd/ras: add append " Gangliang Xie
2026-01-30 5:53 ` Lazar, Lijo
2026-01-30 2:29 ` [PATCH 09/14] drm/amd/ras: make MCA IPID parse global Gangliang Xie
2026-01-30 2:29 ` [PATCH 10/14] drm/amd/ras: add read func for pmfw eeprom Gangliang Xie
2026-01-30 5:57 ` Lazar, Lijo
2026-01-30 2:29 ` [PATCH 11/14] drm/amd/ras: adapt page retirement process " Gangliang Xie
2026-01-30 2:29 ` [PATCH 12/14] drm/amd/ras: add initialization func " Gangliang Xie
2026-01-30 2:29 ` [PATCH 13/14] drm/amd/ras: add check " Gangliang Xie
2026-01-30 2:29 ` [PATCH 14/14] drm/amd/ras: adapt syc info " Gangliang Xie
-- strict thread matches above, loose matches on Subject: below --
2026-01-26 3:55 [PATCH 01/14] drm/amd/pm: add pmfw eeprom messages into uniras interface Gangliang Xie
2026-01-26 3:55 ` [PATCH 07/14] drm/amd/ras: add check safety watermark func for pmfw eeprom Gangliang Xie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=02c5ca3d-fb75-4410-ab38-da74caf8d367@amd.com \
--to=lijo.lazar@amd.com \
--cc=KevinYang.Wang@amd.com \
--cc=YiPeng.Chai@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=ganglxie@amd.com \
--cc=tao.zhou1@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox