From patchwork Thu Feb 28 20:49:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuppuswamy Sathyanarayanan X-Patchwork-Id: 10833725 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BA96313B5 for ; Thu, 28 Feb 2019 20:52:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC10E2F9FE for ; Thu, 28 Feb 2019 20:52:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0B102FB5C; Thu, 28 Feb 2019 20:52:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30C672F9FE for ; Thu, 28 Feb 2019 20:52:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388377AbfB1Uwj (ORCPT ); Thu, 28 Feb 2019 15:52:39 -0500 Received: from mga17.intel.com ([192.55.52.151]:16411 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388186AbfB1UwV (ORCPT ); Thu, 28 Feb 2019 15:52:21 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Feb 2019 12:52:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,424,1544515200"; d="scan'208";a="130192192" Received: from skuppusw-desk.jf.intel.com ([10.54.74.33]) by orsmga003.jf.intel.com with ESMTP; 28 Feb 2019 12:52:19 -0800 From: sathyanarayanan.kuppuswamy@linux.intel.com To: bhelgaas@google.com, rjw@rjwysocki.net, lenb@kernel.org, robert.moore@intel.com, erik.schmauss@intel.com, ruscur@russell.cc Cc: linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, ashok.raj@intel.com, keith.busch@intel.com, Kuppuswamy Sathyanarayanan Subject: [PATCH v1 2/3] ACPI: Add Error Disconnect Recover (EDR) ACPI notifier support Date: Thu, 28 Feb 2019 12:49:48 -0800 Message-Id: <5229ccc3bbb1792ba625b7c54f5ad6f101826454.1551382061.git.sathyanarayanan.kuppuswamy@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuppuswamy Sathyanarayanan 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 --- 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 /*