Commit 2eff2d14 authored by Shuai Xue's avatar Shuai Xue Committed by Wen Jin
Browse files

ACPI: APEI: EINJ: warn on invalid argument when explicitly indicated by platform

mainline inclusion
from mainline-v6.4-rc1
commit f1e65718
category: feature
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I8ZRE0
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f1e65718ec1855263c349997dc294e186e55d67a



--------------------------------

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

Intel-SIG: commit f1e65718 ACPI: APEI: EINJ: warn on invalid argument when explicitly indicated by platform.
Backport to reflect two different ACPI returned error codes on executing an EXECUTE_OPERATION action.

Signed-off-by: default avatarShuai Xue <xueshuai@linux.alibaba.com>
Reviewed-by: default avatarTony Luck <tony.luck@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarWen Jin <wen.jin@intel.com>
parent 9b090e20
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment