All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 1/3] ACPI: APEI: Adjust for acpi_run_osc logic changes
@ 2022-03-01 12:49 Mario Limonciello
  2022-03-01 12:49 ` [PATCH v4 2/3] ACPI: bus: Allow negotiating OSC capabilities Mario Limonciello
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Mario Limonciello @ 2022-03-01 12:49 UTC (permalink / raw)
  To: Rafael J . Wysocki, linux-acpi
  Cc: Mika Westerberg, Xiaomeng.Hou, Aaron.Liu, Ray.Huang, hdegoede,
	Mario Limonciello

As this function calls the OSC with the OSC_QUERY_ENABLE set in
OSC_QUERY_DWORD, ensure that it continues to operate the same if
the function has returned AE_SUPPORT.

Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
v3->v4:
* No changes
 drivers/acpi/apei/apei-base.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c
index c7fdb12c3310..f7d1aa687fd9 100644
--- a/drivers/acpi/apei/apei-base.c
+++ b/drivers/acpi/apei/apei-base.c
@@ -780,6 +780,7 @@ int apei_osc_setup(void)
 {
 	static u8 whea_uuid_str[] = "ed855e0c-6c90-47bf-a62a-26de0fc5ad5c";
 	acpi_handle handle;
+	acpi_status status;
 	u32 capbuf[3];
 	struct acpi_osc_context context = {
 		.uuid_str	= whea_uuid_str,
@@ -792,12 +793,12 @@ int apei_osc_setup(void)
 	capbuf[OSC_SUPPORT_DWORD] = 1;
 	capbuf[OSC_CONTROL_DWORD] = 0;
 
-	if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle))
-	    || ACPI_FAILURE(acpi_run_osc(handle, &context)))
+	if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle)))
 		return -EIO;
-	else {
-		kfree(context.ret.pointer);
-		return 0;
-	}
+	status = acpi_run_osc(handle, &context);
+	if (status != AE_SUPPORT && status != AE_OK)
+		return -EIO;
+	kfree(context.ret.pointer);
+	return 0;
 }
 EXPORT_SYMBOL_GPL(apei_osc_setup);
-- 
2.34.1


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

end of thread, other threads:[~2022-03-08 21:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-01 12:49 [PATCH v4 1/3] ACPI: APEI: Adjust for acpi_run_osc logic changes Mario Limonciello
2022-03-01 12:49 ` [PATCH v4 2/3] ACPI: bus: Allow negotiating OSC capabilities Mario Limonciello
2022-03-01 13:07   ` Mika Westerberg
2022-03-08 21:51   ` Qian Cai
2022-03-01 12:49 ` [PATCH v4 3/3] ACPI: bus: For platform OSC negotiate capabilities Mario Limonciello
2022-03-01 13:12   ` Mika Westerberg
2022-03-02 20:09 ` [PATCH v4 1/3] ACPI: APEI: Adjust for acpi_run_osc logic changes Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.