linux/include/acpi
Liu Xinpeng a090931524 ACPI: APEI: Fix missing ERST record id
Read a record is cleared by others, but the deleted record cache entry is
still created by erst_get_record_id_next. When next enumerate the records,
get the cached deleted record, then erst_read() return -ENOENT and try to
get next record, loop back to first ID will return 0 in function
__erst_record_id_cache_add_one and then set record_id as
APEI_ERST_INVALID_RECORD_ID, finished this time read operation.
It will result in read the records just in the cache hereafter.

This patch cleared the deleted record cache, fix the issue that
"./erst-inject -p" shows record counts not equal to "./erst-inject -n".

A reproducer of the problem(retry many times):

[root@localhost erst-inject]# ./erst-inject -c 0xaaaaa00011
[root@localhost erst-inject]# ./erst-inject -p
rc: 273
rcd sig: CPER
rcd id: 0xaaaaa00012
rc: 273
rcd sig: CPER
rcd id: 0xaaaaa00013
rc: 273
rcd sig: CPER
rcd id: 0xaaaaa00014
[root@localhost erst-inject]# ./erst-inject -i 0xaaaaa000006
[root@localhost erst-inject]# ./erst-inject -i 0xaaaaa000007
[root@localhost erst-inject]# ./erst-inject -i 0xaaaaa000008
[root@localhost erst-inject]# ./erst-inject -p
rc: 273
rcd sig: CPER
rcd id: 0xaaaaa00012
rc: 273
rcd sig: CPER
rcd id: 0xaaaaa00013
rc: 273
rcd sig: CPER
rcd id: 0xaaaaa00014
[root@localhost erst-inject]# ./erst-inject -n
total error record count: 6

Signed-off-by: Liu Xinpeng <liuxp11@chinatelecom.cn>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2022-04-13 20:29:24 +02:00
..
platform ACPICA: Use uintptr_t and offsetof() in Linux kernel builds 2022-01-25 18:41:23 +01:00
acbuffer.h ACPICA: Add _PLD panel positions 2021-06-07 14:04:43 +02:00
acconfig.h ACPICA: Add support for PlatformRtMechanism OperationRegion handler 2021-06-07 14:04:43 +02:00
acexcep.h ACPICA: Updated all copyrights to 2021 2021-01-22 15:51:53 +01:00
acnames.h ACPICA: Add method name "_DIS" For use with aslmethod.c 2021-08-16 16:47:02 +02:00
acoutput.h ACPICA: Macros should not use a trailing semicolon 2021-08-16 16:47:02 +02:00
acpi.h ACPICA: Updated all copyrights to 2021 2021-01-22 15:51:53 +01:00
acpi_bus.h ACPI: bus: Eliminate acpi_bus_get_device() 2022-04-05 19:49:26 +02:00
acpi_drivers.h Merge branches 'acpi-pci' and 'acpi-processor' 2021-04-26 17:03:05 +02:00
acpi_io.h Revert "ACPI: Add memory semantics to acpi_os_map_memory()" 2021-09-23 20:39:36 +02:00
acpi_lpat.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
acpi_numa.h ACPI: processor: Replace kernel.h with the necessary inclusions 2021-11-24 17:44:04 +01:00
acpiosxf.h ACPICA: Updated all copyrights to 2021 2021-01-22 15:51:53 +01:00
acpixf.h ACPICA: Update version to 20211217 2021-12-27 17:01:28 +01:00
acrestyp.h ACPICA: ACPI 6.4: add CSI2Bus resource template 2021-04-07 19:09:01 +02:00
actbl.h ACPICA: Updated all copyrights to 2021 2021-01-22 15:51:53 +01:00
actbl1.h ACPICA: Headers: Add new DBG2 Serial Port Subtypes 2021-08-16 16:47:02 +02:00
actbl2.h ACPICA: iASL/NHLT table: "Specific Data" field support 2021-12-27 17:01:28 +01:00
actbl3.h ACPICA: ACPI 6.4 SRAT: add Generic Port Affinity type 2021-10-05 15:53:37 +02:00
actypes.h ACPICA: Use uintptr_t and offsetof() in Linux kernel builds 2022-01-25 18:41:23 +01:00
acuuid.h ACPICA: ACPI 6.4: add USB4 capabilities UUID 2021-04-07 19:09:00 +02:00
apei.h ACPI: APEI: Fix missing ERST record id 2022-04-13 20:29:24 +02:00
battery.h ACPI: battery: include linux/power_supply.h 2020-09-25 18:31:19 +02:00
button.h ACPI: button: move HIDs to acpi/button.h 2020-02-13 23:36:23 +01:00
cppc_acpi.h ACPI: CPPC: Add CPPC enable register function 2021-12-30 18:51:39 +01:00
ghes.h ACPI / APEI: Add a notifier chain for unknown (vendor) CPER records 2020-09-16 10:30:42 +01:00
hed.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 428 2019-06-05 17:37:16 +02:00
nfit.h acpi, nfit: Add function to look up nvdimm device and provide SMBIOS handle 2018-03-14 12:43:50 +01:00
pcc.h mailbox: pcc: Use PCC mailbox channel pointer instead of standard 2021-10-29 22:46:38 -05:00
pdc_intel.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
processor.h ACPI: processor: Replace kernel.h with the necessary inclusions 2021-11-24 17:44:04 +01:00
reboot.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
video.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00