ACPI: APEI: ERST: Don't retry read when "Record Store Empty"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"ERST: [Firmware Warn]: too many record IDs!" is logged on some platforms
when there is no record.  That happens because erst_reader() retries read
when erst_get_record_id_next() returns valid ID and erst_read_record()
fails with -ENOENT.  On those platforms, ACPI_ERST_GET_RECORD_ID returns
ID 0x0 even if record store is empty.  Reading record ID 0x0 on
empty store fails with status code 0x4 (Record Store Empty).  However, both
"Record Store Empty" and "Record Not Found" are translated to -ENOENT,
the reader cannot distinguish between them and tries to read the next id,
which is again 0x0, and repeat that until it fills up the record cache with
invalid entries.

While such firmware might be buggy, we could make the reading loop more
robust by returning different error codes for "Record Not Found" and
"Record Store Empty".

Signed-off-by: Jun'ichi Nomura <junichi.nomura@xxxxxxx>

diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c
index bf65e3461531..ce186f8d7a15 100644
--- a/drivers/acpi/apei/erst.c
+++ b/drivers/acpi/apei/erst.c
@@ -95,6 +95,7 @@ static inline int erst_errno(int command_status)
 	case ERST_STATUS_NOT_ENOUGH_SPACE:
 		return -ENOSPC;
 	case ERST_STATUS_RECORD_STORE_EMPTY:
+		return -ENODATA;
 	case ERST_STATUS_RECORD_NOT_FOUND:
 		return -ENOENT;
 	default:




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux