mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ACPI: APEI: EINJ: warn on invalid argument when explicitly indicated by platform
@ 2023-03-17  7:33 Shuai Xue
  2023-03-17 21:24 ` Luck, Tony
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Shuai Xue @ 2023-03-17  7:33 UTC (permalink / raw)
  To: tony.luck
  Cc: xueshuai, baolin.wang, benjamin.cheatham, bp, dan.j.williams,
	james.morse, jaylu102, lenb, linux-acpi, linux-kernel, rafael,
	zhuo.song

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

Signed-off-by: Shuai Xue <xueshuai@linux.alibaba.com>
---
 drivers/acpi/apei/einj.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c
index b4373e575660..fa0b4320312e 100644
--- a/drivers/acpi/apei/einj.c
+++ b/drivers/acpi/apei/einj.c
@@ -489,9 +489,15 @@ static int __einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2,
 	if (rc)
 		return rc;
 	val = apei_exec_ctx_get_output(&ctx);
-	if (val != EINJ_STATUS_SUCCESS)
+	if (val == EINJ_STATUS_FAIL)
 		return -EBUSY;
+	else if (val == EINJ_STATUS_INVAL)
+		return -EINVAL;
 
+	/*
+	 * The error is injected into the platform successfully, then it needs
+	 * to trigger the error.
+	 */
 	rc = apei_exec_run(&ctx, ACPI_EINJ_GET_TRIGGER_TABLE);
 	if (rc)
 		return rc;
-- 
2.20.1.12.g72788fdb


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-03-27 18:47 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-17  7:33 [PATCH] ACPI: APEI: EINJ: warn on invalid argument when explicitly indicated by platform Shuai Xue
2023-03-17 21:24 ` Luck, Tony
2023-03-20  2:25   ` Shuai Xue
2023-03-20 16:32     ` Luck, Tony
2023-03-21  2:00       ` Shuai Xue
2023-03-21 16:09         ` Luck, Tony
2023-03-22  2:37           ` Shuai Xue
2023-03-22 16:07 ` Luck, Tony
2023-03-22 16:52   ` Rafael J. Wysocki
2023-03-23  1:19     ` Shuai Xue
2023-03-23  1:18   ` Shuai Xue
2023-03-23  1:53 ` [PATCH v2] " Shuai Xue
2023-03-27 18:47   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®