[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <078a6305-415a-4c89-9c5e-096adafded1b@amd.com>
Date: Wed, 14 Feb 2024 09:59:48 -0500
From: Yazen Ghannam <yazen.ghannam@....com>
To: Borislav Petkov <bp@...en8.de>
Cc: yazen.ghannam@....com, tony.luck@...el.com, linux-edac@...r.kernel.org,
linux-kernel@...r.kernel.org, avadhut.naik@....com, john.allen@....com,
muralidhara.mk@....com, naveenkrishna.chatradhi@....com,
sathyapriya.k@....com
Subject: Re: [PATCH 2/2] RAS: Introduce the FRU Memory Poison Manager
On 2/14/2024 6:15 AM, Borislav Petkov wrote:
> On Tue, Feb 13, 2024 at 09:35:16PM -0600, Yazen Ghannam wrote:
>> +static bool has_valid_entries(u64 valid_bits)
>> +{
>> + if (!(valid_bits & FMP_VALID_LIST_ENTRIES))
>> + return false;
>> +
>> + if (!(valid_bits & FMP_VALID_LIST))
>> + return false;
>> +
>> + return true;
>> +}
>
> Rename:
>
> diff --git a/drivers/ras/amd/fmpm.c b/drivers/ras/amd/fmpm.c
> index 090b60d269e7..3da3f40f1efe 100644
> --- a/drivers/ras/amd/fmpm.c
> +++ b/drivers/ras/amd/fmpm.c
> @@ -221,7 +221,7 @@ static int update_record_on_storage(struct fru_rec *rec)
> return ret;
> }
>
> -static bool has_valid_entries(struct fru_rec *rec)
> +static bool rec_has_valid_entries(struct fru_rec *rec)
> {
> if (!(rec->fmp.validation_bits & FMP_VALID_LIST_ENTRIES))
> return false;
> @@ -286,7 +286,7 @@ static void update_fru_record(struct fru_rec *rec, struct mce *m)
> fpd.addr = m->addr;
>
> /* This is the first entry, so just save it. */
> - if (!has_valid_entries(rec))
> + if (!rec_has_valid_entries(rec))
> goto save_fpd;
>
> /* Ignore already recorded errors. */
> @@ -397,7 +397,7 @@ static void retire_mem_records(void)
> for_each_fru(i, rec) {
> fmp = &rec->fmp;
>
> - if (!has_valid_entries(rec))
> + if (!rec_has_valid_entries(rec))
> continue;
>
> cpu = get_cpu_from_fru_id(fmp->fru_id);
>
> ---
>
> and this one:
>
> ---
>
> diff --git a/drivers/ras/amd/fmpm.c b/drivers/ras/amd/fmpm.c
> index 3da3f40f1efe..813cc6a4f435 100644
> --- a/drivers/ras/amd/fmpm.c
> +++ b/drivers/ras/amd/fmpm.c
> @@ -255,12 +255,12 @@ static bool same_fpd(struct cper_fru_poison_desc *old, struct cper_fru_poison_de
> return true;
> }
>
> -static bool is_dup_fpd(struct fru_rec *rec, struct cper_fru_poison_desc *new)
> +static bool rec_has_fpd(struct fru_rec *rec, struct cper_fru_poison_desc *fpd)
> {
> unsigned int i;
>
> for (i = 0; i < rec->fmp.nr_entries; i++) {
> - if (same_fpd(get_fpd(rec, i), new)) {
> + if (same_fpd(get_fpd(rec, i), fpd)) {
> pr_debug("Found duplicate record");
> return true;
> }
> @@ -290,7 +290,7 @@ static void update_fru_record(struct fru_rec *rec, struct mce *m)
> goto save_fpd;
>
> /* Ignore already recorded errors. */
> - if (is_dup_fpd(rec, &fpd))
> + if (rec_has_fpd(rec, &fpd))
> goto out_unlock;
>
> if (rec->fmp.nr_entries >= max_nr_entries) {
>
Okay.
Thanks,
Yazen
Powered by blists - more mailing lists