summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorgengdongjiu <gengdongjiu@huawei.com>2017-08-17 20:07:18 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-08-24 03:29:46 +0200
commitc4335fdd38227788178953c101b77180504d7ea0 (patch)
treeaee9af84eabebc7d57f91df74589f553b7b76757 /include
parentbdb9458a3382ba745a66be5526d3899103c76eda (diff)
downloadlinux-c4335fdd38227788178953c101b77180504d7ea0.tar.gz
linux-c4335fdd38227788178953c101b77180504d7ea0.tar.bz2
linux-c4335fdd38227788178953c101b77180504d7ea0.zip
ACPI: APEI: fix the wrong iteration of generic error status block
The revision 0x300 generic error data entry is different from the old version, but currently iterating through the GHES estatus blocks does not take into account this difference. This will lead to failure to get the right data entry if GHES has revision 0x300 error data entry. Update the GHES estatus iteration macro to properly increment using acpi_hest_get_next(), and correct the iteration termination condition because the status block data length only includes error data length. Convert the CPER estatus checking and printing iteration logic to use same macro. Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com> Tested-by: Tyler Baicar <tbaicar@codeaurora.org> Reviewed-by: Borislav Petkov <bp@suse.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/acpi/ghes.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h
index 9f26e01186ae..9061c5c743b3 100644
--- a/include/acpi/ghes.h
+++ b/include/acpi/ghes.h
@@ -113,6 +113,11 @@ static inline void *acpi_hest_get_next(struct acpi_hest_generic_data *gdata)
return (void *)(gdata) + acpi_hest_get_record_size(gdata);
}
+#define apei_estatus_for_each_section(estatus, section) \
+ for (section = (struct acpi_hest_generic_data *)(estatus + 1); \
+ (void *)section - (void *)(estatus + 1) < estatus->data_length; \
+ section = acpi_hest_get_next(section))
+
int ghes_notify_sea(void);
#endif /* GHES_H */