From patchwork Tue Aug 27 02:58:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqing Zhao X-Patchwork-Id: 823572 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75F3C17C60; Tue, 27 Aug 2024 02:58:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724727522; cv=none; b=lE/dNvrXabTuAKXqBVVsqFuEvux1LxvoTbffP3G1yA92iMmB1QbfrU8g1rL+j7xyVym7u80kkVfhepfZnk/aGMrHXQpNqjLomnf8pMt8k7YbX9ZtvoUK84JP0hPb8tzVKaRJEItNIDlQN+0xmZJSD1nGLxKCQPvgAkF5Q3KCXgg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724727522; c=relaxed/simple; bh=WfJUUDVtx9x3suQ9UzZSPSwb8qdMas+AphdNlS7Uy1Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pdj25BMRp1is3NfLWAjMqrvUuRGV+D5uq6OnwEIBJlh0Iv63JmtzHhZKME5Uwo0gV6/tXrcrP8+kTlgmcvDUQiwVLUWGVAPC919Epbn0u7C9hRHMxlBBtsz81fxfxACWofrF+U3aUTVwKnWEKhN5U0bZblioy/zHnKyjagd0ejM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=SMpx4Shc; arc=none smtp.client-ip=198.175.65.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="SMpx4Shc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724727520; x=1756263520; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WfJUUDVtx9x3suQ9UzZSPSwb8qdMas+AphdNlS7Uy1Q=; b=SMpx4ShcDQ2YVIv1VCXTZ49niiIltN9OenV9+GImCRaFDhazz24KmPox SQclgtUFQPbTBnwR9VmDlHxqxfTuVMSvKq8mMdX7u7IAaHS5d4HITB4g9 uEhZ7EvzKhhQYvGncCo2VRSRufEomoCwGq5xTyxU2E7FQdQ3dZ6k7FOw7 gngf/YWtjzBuznOXIgkV6ux6+NSa96O5fSq930n+/MvOkySMCf1UYgSdt Wcn4qn2+cM1uT7WIt8vFA312F8VUPYSXX92V58oLuxRcLnFLh9HUlywqv ByhUO05DiJYCMNbPlnppqa6lf327eneUR5qOFhzjV9yJovA2+LuKCxBLm w==; X-CSE-ConnectionGUID: ortNaTNxT1qb5Q/EYHUIcg== X-CSE-MsgGUID: 9Kr6gp6kSJ6taUR5h22oaw== X-IronPort-AV: E=McAfee;i="6700,10204,11176"; a="40654901" X-IronPort-AV: E=Sophos;i="6.10,179,1719903600"; d="scan'208";a="40654901" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2024 19:58:40 -0700 X-CSE-ConnectionGUID: +a3cr4TURiOItC/VkfYl5g== X-CSE-MsgGUID: NK4zVyr2TdqSsB0mv4ROkw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,179,1719903600"; d="scan'208";a="93512984" Received: from unknown (HELO jiaqingz-acrn-container.sh.intel.com) ([10.239.43.235]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2024 19:58:36 -0700 From: Jiaqing Zhao To: Robert Moore , "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev Cc: linux-kernel@vger.kernel.org, Jiaqing Zhao Subject: [PATCH v3 1/2] ACPICA: Detect FACS in reduced hardware build Date: Tue, 27 Aug 2024 02:58:20 +0000 Message-ID: <20240827025821.2099068-2-jiaqing.zhao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240827025821.2099068-1-jiaqing.zhao@linux.intel.com> References: <20240827025821.2099068-1-jiaqing.zhao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 According to Section 5.2.10 of ACPI Specification, FACS is optional in reduced hardware model. Enable the detection for "Hardware-reduced ACPI support only" build (CONFIG_ACPI_REDUCED_HARDWARE_ONLY=y) also. Link: https://github.com/acpica/acpica/commit/ee53ed6b5452612bb44af542b68d605f8b2b1104 Signed-off-by: Jiaqing Zhao --- drivers/acpi/acpica/acglobal.h | 6 +----- drivers/acpi/acpica/tbutils.c | 2 -- drivers/acpi/acpica/utxfinit.c | 24 ++++++++++++------------ include/acpi/acconfig.h | 1 - 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h index f4c90fc99be2..309ce8efb4f6 100644 --- a/drivers/acpi/acpica/acglobal.h +++ b/drivers/acpi/acpica/acglobal.h @@ -29,11 +29,7 @@ ACPI_INIT_GLOBAL(u32, acpi_gbl_dsdt_index, ACPI_INVALID_TABLE_INDEX); ACPI_INIT_GLOBAL(u32, acpi_gbl_facs_index, ACPI_INVALID_TABLE_INDEX); ACPI_INIT_GLOBAL(u32, acpi_gbl_xfacs_index, ACPI_INVALID_TABLE_INDEX); ACPI_INIT_GLOBAL(u32, acpi_gbl_fadt_index, ACPI_INVALID_TABLE_INDEX); - -#if (!ACPI_REDUCED_HARDWARE) -ACPI_GLOBAL(struct acpi_table_facs *, acpi_gbl_FACS); - -#endif /* !ACPI_REDUCED_HARDWARE */ +ACPI_INIT_GLOBAL(struct acpi_table_facs *, acpi_gbl_FACS, NULL); /* These addresses are calculated from the FADT Event Block addresses */ diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c index 15fa68a5ea6e..dad7425fce3f 100644 --- a/drivers/acpi/acpica/tbutils.c +++ b/drivers/acpi/acpica/tbutils.c @@ -18,7 +18,6 @@ ACPI_MODULE_NAME("tbutils") static acpi_physical_address acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size); -#if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * * FUNCTION: acpi_tb_initialize_facs @@ -56,7 +55,6 @@ acpi_status acpi_tb_initialize_facs(void) return (AE_OK); } -#endif /* !ACPI_REDUCED_HARDWARE */ /******************************************************************************* * diff --git a/drivers/acpi/acpica/utxfinit.c b/drivers/acpi/acpica/utxfinit.c index 1915bec2b279..70ae0afa7939 100644 --- a/drivers/acpi/acpica/utxfinit.c +++ b/drivers/acpi/acpica/utxfinit.c @@ -120,6 +120,18 @@ acpi_status ACPI_INIT_FUNCTION acpi_enable_subsystem(u32 flags) */ acpi_gbl_early_initialization = FALSE; + /* + * Obtain a permanent mapping for the FACS. This is required for the + * Global Lock and the Firmware Waking Vector + */ + if (!(flags & ACPI_NO_FACS_INIT)) { + status = acpi_tb_initialize_facs(); + if (ACPI_FAILURE(status)) { + ACPI_WARNING((AE_INFO, "Could not map the FACS table")); + return_ACPI_STATUS(status); + } + } + #if (!ACPI_REDUCED_HARDWARE) /* Enable ACPI mode */ @@ -137,18 +149,6 @@ acpi_status ACPI_INIT_FUNCTION acpi_enable_subsystem(u32 flags) } } - /* - * Obtain a permanent mapping for the FACS. This is required for the - * Global Lock and the Firmware Waking Vector - */ - if (!(flags & ACPI_NO_FACS_INIT)) { - status = acpi_tb_initialize_facs(); - if (ACPI_FAILURE(status)) { - ACPI_WARNING((AE_INFO, "Could not map the FACS table")); - return_ACPI_STATUS(status); - } - } - /* * Initialize ACPI Event handling (Fixed and General Purpose) * diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index d768d9c568cf..2da5f4a6e814 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -67,7 +67,6 @@ * General Purpose Events (GPEs) * Global Lock * ACPI PM timer - * FACS table (Waking vectors and Global Lock) */ #ifndef ACPI_REDUCED_HARDWARE #define ACPI_REDUCED_HARDWARE FALSE From patchwork Tue Aug 27 02:58:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqing Zhao X-Patchwork-Id: 822698 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A82C028684; Tue, 27 Aug 2024 02:58:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724727533; cv=none; b=bgMdUbr81tqOON1Y1k6rFqVgb5wpsYE745f0VkrHYJR4jWOc8b3ef/l0u0o2/zbTrEgGHqApY97FYm9bekUFHmfnIWoMZVCbCJT2fyTQreuLzzcO65wfI2qboZIEWyweDz70J8b8JsZPQDkg+f5o3v9dDuzmh8xiW5POV4t1+G0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724727533; c=relaxed/simple; bh=crxt8dmFsPgKdyP6mbp9TYJDYR3hAaakUYEXKMWUPYs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=l4KY9xsBaxksG3e8UUXf7ZhSyozRnyzCvtMALzDqVgBZSkLfQe60tlgNJAbjq8K4bqQm75UedyJwbldoWgL2lA+BO1tWszk+RdQp57vK8cny+lK2nbXAsYq0y+85PnVQ7FGo5q6JwoccfYIKRu5pu/J9SzBlIOlAJPQpvnvi6HI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=AIi3QoE+; arc=none smtp.client-ip=198.175.65.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="AIi3QoE+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724727532; x=1756263532; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=crxt8dmFsPgKdyP6mbp9TYJDYR3hAaakUYEXKMWUPYs=; b=AIi3QoE+HnY6RVxSLRUSNWQSVA74V92JlH2PNAYjLNUFnq3R8Ad1j2Lz QezLf+8e3QFZiTe4pZPBeSOIW/NV3eVwLJiOAQFjL5oor+6xnus4I8N0Y FdLHLZLRKJQ1XAWKyryT5+rrNsDcd7Fk1CaObf4BP7mVndv1SsMJwYFBY tgcpRy6p9vnWsYExnp7Qwng/HGUeHP9ssb9PpN15Mt1FGI88Ox+ZA+qxi S+WdoLzufqf/9jEHTf3xf00yLB3Z2Z7ykCavug0leVmdtoivHE0RquIQu ZlFTMiHoKUsfB7d/pK82PSwKc6+opDavkPjAnxeQoHTcR7EvRvWUR/p7f Q==; X-CSE-ConnectionGUID: Z4kmO4UiT2Gmoy/PPykD/A== X-CSE-MsgGUID: XxudvORoTGSDMLowOTgwfg== X-IronPort-AV: E=McAfee;i="6700,10204,11176"; a="40654908" X-IronPort-AV: E=Sophos;i="6.10,179,1719903600"; d="scan'208";a="40654908" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2024 19:58:43 -0700 X-CSE-ConnectionGUID: kXG9+WoHTa6uqmBk1r9sgw== X-CSE-MsgGUID: DThzFemyRHKivmG6zTAoDQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,179,1719903600"; d="scan'208";a="93512996" Received: from unknown (HELO jiaqingz-acrn-container.sh.intel.com) ([10.239.43.235]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2024 19:58:38 -0700 From: Jiaqing Zhao To: Robert Moore , "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev Cc: linux-kernel@vger.kernel.org, Jiaqing Zhao Subject: [PATCH v3 2/2] ACPICA: Allow setting waking vector on reduced hardware platforms Date: Tue, 27 Aug 2024 02:58:21 +0000 Message-ID: <20240827025821.2099068-3-jiaqing.zhao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240827025821.2099068-1-jiaqing.zhao@linux.intel.com> References: <20240827025821.2099068-1-jiaqing.zhao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Allow setting waking vector in FACS table on reduced hardware platforms to support S3 wakeup. Link: https://github.com/acpica/acpica/commit/ee53ed6b5452612bb44af542b68d605f8b2b1104 Signed-off-by: Jiaqing Zhao --- drivers/acpi/acpica/hwxfsleep.c | 15 ++++++--------- include/acpi/acpixf.h | 8 ++++---- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c index 36ea48f64110..8dbf83aeb455 100644 --- a/drivers/acpi/acpica/hwxfsleep.c +++ b/drivers/acpi/acpica/hwxfsleep.c @@ -16,20 +16,11 @@ ACPI_MODULE_NAME("hwxfsleep") /* Local prototypes */ -#if (!ACPI_REDUCED_HARDWARE) static acpi_status acpi_hw_set_firmware_waking_vector(struct acpi_table_facs *facs, acpi_physical_address physical_address, acpi_physical_address physical_address64); -#endif - -/* - * These functions are removed for the ACPI_REDUCED_HARDWARE case: - * acpi_set_firmware_waking_vector - * acpi_enter_sleep_state_s4bios - */ -#if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * * FUNCTION: acpi_hw_set_firmware_waking_vector @@ -115,6 +106,12 @@ acpi_set_firmware_waking_vector(acpi_physical_address physical_address, ACPI_EXPORT_SYMBOL(acpi_set_firmware_waking_vector) +/* + * These functions are removed for the ACPI_REDUCED_HARDWARE case: + * acpi_enter_sleep_state_s4bios + */ + +#if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * * FUNCTION: acpi_enter_sleep_state_s4bios diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 80dc36f9d527..99bb45a46600 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -881,10 +881,10 @@ ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_leave_sleep_state_prep(u8 sleep_state)) ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_leave_sleep_state(u8 sleep_state)) -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_set_firmware_waking_vector - (acpi_physical_address physical_address, - acpi_physical_address physical_address64)) +ACPI_EXTERNAL_RETURN_STATUS(acpi_status + acpi_set_firmware_waking_vector + (acpi_physical_address physical_address, + acpi_physical_address physical_address64)) /* * ACPI Timer interfaces */