linux-stable/drivers/acpi/apei
Shuai Xue f1e65718ec ACPI: APEI: EINJ: warn on invalid argument when explicitly indicated by platform
OSPM executes an EXECUTE_OPERATION action to instruct the platform to begin
the injection operation, then executes a GET_COMMAND_STATUS action to
determine the status of the completed operation. The ACPI Specification
documented error codes[1] are:

	0 = Success (Linux #define EINJ_STATUS_SUCCESS)
	1 = Unknown failure (Linux #define EINJ_STATUS_FAIL)
	2 = Invalid Access (Linux #define EINJ_STATUS_INVAL)

The original code report -EBUSY for both "Unknown Failure" and "Invalid
Access" cases. Actually, firmware could do some platform dependent sanity
checks and returns different error codes, e.g. "Invalid Access" to indicate
to the user that the parameters they supplied cannot be used for injection.

To this end, fix to return -EINVAL in the __einj_error_inject() error
handling case instead of always -EBUSY, when explicitly indicated by the
platform in the status of the completed operation.

[1] ACPI Specification 6.5 18.6.1. Error Injection Table

Signed-off-by: Shuai Xue <xueshuai@linux.alibaba.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2023-03-27 20:46:08 +02:00
..
apei-base.c ACPI: APEI: Remove a useless include 2022-12-02 20:18:50 +01:00
apei-internal.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bert.c ACPI: APEI: Add BERT error log footer 2022-09-03 20:25:39 +02:00
einj.c ACPI: APEI: EINJ: warn on invalid argument when explicitly indicated by platform 2023-03-27 20:46:08 +02:00
erst-dbg.c ACPI: APEI: Fix missing ERST record id 2022-04-13 20:29:24 +02:00
erst.c ACPI: APEI: Remove unneeded result variables 2022-09-24 18:50:42 +02:00
ghes.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
hest.c ACPI: APEI: fix return value of __setup handlers 2022-03-08 19:43:39 +01:00
Kconfig ACPI / APEI: Switch NOTIFY_SEA to use the estatus queue 2019-02-07 23:10:45 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00