[PATCH v1] ACPI: extlog: Fix finding the generic error data for v3 structure

Xiaochun Lee posted 1 patch 2 years, 6 months ago
drivers/acpi/acpi_extlog.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH v1] ACPI: extlog: Fix finding the generic error data for v3 structure
Posted by Xiaochun Lee 2 years, 6 months ago
From: Xiaochun Lee <lixc17@lenovo.com>

Fix by using acpi_hest_get_payload( ) to find out the correct
generic error data for v3 structure. The revision v300 generic
error data is different from the old one, so for compatibility
with old and new version, change to a new interface to locate
the right memory error section that was defined in CPER.

Signed-off-by: Xiaochun Lee <lixc17@lenovo.com>
---
 drivers/acpi/acpi_extlog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c
index e648158368a7..e120a96e1eae 100644
--- a/drivers/acpi/acpi_extlog.c
+++ b/drivers/acpi/acpi_extlog.c
@@ -172,7 +172,7 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
 			fru_text = "";
 		sec_type = (guid_t *)gdata->section_type;
 		if (guid_equal(sec_type, &CPER_SEC_PLATFORM_MEM)) {
-			struct cper_sec_mem_err *mem = (void *)(gdata + 1);
+			struct cper_sec_mem_err *mem = acpi_hest_get_payload(gdata);
 
 			if (gdata->error_data_length >= sizeof(*mem))
 				trace_extlog_mem_event(mem, err_seq, fru_id, fru_text,
-- 
2.37.3
RE: [PATCH v1] ACPI: extlog: Fix finding the generic error data for v3 structure
Posted by Luck, Tony 2 years, 6 months ago
> Fix by using acpi_hest_get_payload( ) to find out the correct
> generic error data for v3 structure. The revision v300 generic
> error data is different from the old one, so for compatibility
> with old and new version, change to a new interface to locate
> the right memory error section that was defined in CPER.
>
> Signed-off-by: Xiaochun Lee <lixc17@lenovo.com>

Reviewed-by: Tony Luck <tony.luck@intel.com>

-Tony
Re: [PATCH v1] ACPI: extlog: Fix finding the generic error data for v3 structure
Posted by Rafael J. Wysocki 2 years, 5 months ago
On Wed, Aug 2, 2023 at 6:03 PM Luck, Tony <tony.luck@intel.com> wrote:
>
> > Fix by using acpi_hest_get_payload( ) to find out the correct
> > generic error data for v3 structure. The revision v300 generic
> > error data is different from the old one, so for compatibility
> > with old and new version, change to a new interface to locate
> > the right memory error section that was defined in CPER.
> >
> > Signed-off-by: Xiaochun Lee <lixc17@lenovo.com>
>
> Reviewed-by: Tony Luck <tony.luck@intel.com>

Applied as 6.6 material, thanks!