[PATCH v1 2/3] ACPI: Add Error Disconnect Recover (EDR) ACPI notifier support
From: sathyanarayanan . kuppuswamy
Date: Thu Feb 28 2019 - 15:52:43 EST
From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@xxxxxxxxxxxxxxx>
As per ACPI spec r6.3, sec 6.3.5, Error Disconnect Recover
notification can be used to notify OSPM of asynchronous removal
of devices for error containment purposes. OSPM can use this
notification to invalidate software states of disconnected child
devices in the bus and also optionally can attempt recover the child
devices.
Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@xxxxxxxxxxxxxxx>
---
drivers/acpi/acpica/utdecode.c | 3 ++-
drivers/acpi/bus.c | 5 ++++-
include/acpi/actypes.h | 3 ++-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/acpica/utdecode.c b/drivers/acpi/acpica/utdecode.c
index dad02b821e19..40d36c6661f1 100644
--- a/drivers/acpi/acpica/utdecode.c
+++ b/drivers/acpi/acpica/utdecode.c
@@ -431,7 +431,8 @@ static const char *acpi_gbl_generic_notify[ACPI_GENERIC_NOTIFY_MAX + 1] = {
/* Reserved in ACPI 6.0 */
/* 0D */ "System Resource Affinity Update",
/* 0E */ "Heterogeneous Memory Attributes Update"
- /* ACPI 6.2 */
+ /* 0F */ "Error Disconnect Recover",
+ /* ACPI 6.3 */
};
static const char *acpi_gbl_device_notify[5] = {
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 147f6c7ea59c..aacf82162604 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -397,7 +397,10 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
case ACPI_NOTIFY_POWER_FAULT:
acpi_handle_err(handle, "Device has suffered a power fault\n");
break;
-
+ case ACPI_NOTIFY_ERROR_DISCONNECT:
+ acpi_handle_debug(handle,
+ "ACPI_NOTIFY_ERROR_DISCONNECT event\n");
+ break;
default:
acpi_handle_debug(handle, "Unknown event type 0x%x\n", type);
break;
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 2590627dbfcc..40ad91b06f02 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -617,8 +617,9 @@ typedef u64 acpi_integer;
#define ACPI_NOTIFY_SHUTDOWN_REQUEST (u8) 0x0C
#define ACPI_NOTIFY_AFFINITY_UPDATE (u8) 0x0D
#define ACPI_NOTIFY_MEMORY_UPDATE (u8) 0x0E
+#define ACPI_NOTIFY_ERROR_DISCONNECT (u8) 0x0F
-#define ACPI_GENERIC_NOTIFY_MAX 0x0E
+#define ACPI_GENERIC_NOTIFY_MAX 0x0F
#define ACPI_SPECIFIC_NOTIFY_MAX 0x84
/*
--
2.20.1