From patchwork Fri Apr 19 17:18:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Cox X-Patchwork-Id: 1925646 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VLhJb0Wz4z23hf for ; Sat, 20 Apr 2024 03:21:34 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1rxrvU-0007Hv-Cy; Fri, 19 Apr 2024 17:21:28 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rxrvL-0007DE-Rg for kernel-team@lists.ubuntu.com; Fri, 19 Apr 2024 17:21:19 +0000 Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id B5E163F366 for ; Fri, 19 Apr 2024 17:21:19 +0000 (UTC) Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-69b601a248dso29265616d6.2 for ; Fri, 19 Apr 2024 10:21:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713547276; x=1714152076; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/BXU1P08WeUj7R1giavZu/qWZefwOzRWvu6enn0Ni2E=; b=rGPMmgkyctECnSm+qpnk2j9TRKsAP63aYDupmRmsspk13Y3xzu8JnPiI8IEjAVLC+4 ZZaOB4MMNEv66fzHDtu4r00DkipgTC3EYPOP6IpMN+OkqtBk/cd5EQAbjDmSToaEewCZ oTX0VvsVGGjfJQekj1qEpYxkaYZlF4EANYxYFLZdxT72Tj4aRtmnUMuCc8BEaQLR7TlK zf4wnN/MMJVJHzcMuaGWhjVcI0osLGhlywxOE3rpu0zqr/xaxAkvz2bB2ffQRj08b/ET pFTSaaLhkAQ6vH1THV+hKNvec7QFEGW1fjdiKs2tD3E9tRQZm6fB3Dt4zlbCl55Gotih vYMA== X-Gm-Message-State: AOJu0Yw2+QdWWswoD3PCFxGUfdGoWuiBGSeial+fDXFYzKDap1XUzm/R lbUzmljU94E2uCaGlXQG3iJXzt9sO7A4vQdiXdErP4bNgg0chdhTh9NLoIVO3ZgDXPdrFrzxYyc eDKITTkoW4UMhiAaGusk/mCpoSbyHK8BVAwt1YEhN8aSavzsnDpoiJLZA3CVxltMDcHira2s3/t 2viY3JcTsygA== X-Received: by 2002:a05:6214:10cc:b0:69b:5c5e:be39 with SMTP id r12-20020a05621410cc00b0069b5c5ebe39mr2498118qvs.63.1713547276673; Fri, 19 Apr 2024 10:21:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGrYFhIWpnyQD2m8tFMSEYQvwTdGUDkGfAVyiJtKS3TuuC5EiRsMJ/aL1n94H068vT+cZDcDA== X-Received: by 2002:a05:6214:10cc:b0:69b:5c5e:be39 with SMTP id r12-20020a05621410cc00b0069b5c5ebe39mr2498102qvs.63.1713547276349; Fri, 19 Apr 2024 10:21:16 -0700 (PDT) Received: from cox.conference ([76.69.53.230]) by smtp.gmail.com with ESMTPSA id q8-20020a0c8cc8000000b0069fcd0520easm1746395qvb.17.2024.04.19.10.21.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 10:21:13 -0700 (PDT) From: Philip Cox To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/2] UBUNTU: SAUCE: ACPICA: Detect FACS even for hardware reduced platforms Date: Fri, 19 Apr 2024 13:18:52 -0400 Message-Id: <20240419171853.81663-2-philip.cox@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240419171853.81663-1-philip.cox@canonical.com> References: <20240419171853.81663-1-philip.cox@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: David Woodhouse BugLink: https://bugs.launchpad.net/bugs/2061006 ACPICA PR https://github.com/acpica/acpica/pull/933 The FACS is optional even on hardware reduced platforms, and may exist for the purpose of communicating the hardware_signature field to provke a clean reboot instead of a resume from hibernation. Signed-off-by: David Woodhouse (cherry-picked from: https://lore.kernel.org/r/20240312134148.727454-1-dwmw2@infradead.org) Signed-off-by: Philip Cox --- drivers/acpi/acpica/tbfadt.c | 30 +++++++++++++----------------- drivers/acpi/acpica/tbutils.c | 7 +------ 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c index 44267a92bce5..3c126c6d306b 100644 --- a/drivers/acpi/acpica/tbfadt.c +++ b/drivers/acpi/acpica/tbfadt.c @@ -315,23 +315,19 @@ void acpi_tb_parse_fadt(void) ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, NULL, FALSE, TRUE, &acpi_gbl_dsdt_index); - /* If Hardware Reduced flag is set, there is no FACS */ - - if (!acpi_gbl_reduced_hardware) { - if (acpi_gbl_FADT.facs) { - acpi_tb_install_standard_table((acpi_physical_address) - acpi_gbl_FADT.facs, - ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, - NULL, FALSE, TRUE, - &acpi_gbl_facs_index); - } - if (acpi_gbl_FADT.Xfacs) { - acpi_tb_install_standard_table((acpi_physical_address) - acpi_gbl_FADT.Xfacs, - ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, - NULL, FALSE, TRUE, - &acpi_gbl_xfacs_index); - } + if (acpi_gbl_FADT.facs) { + acpi_tb_install_standard_table((acpi_physical_address) + acpi_gbl_FADT.facs, + ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, + NULL, FALSE, TRUE, + &acpi_gbl_facs_index); + } + if (acpi_gbl_FADT.Xfacs) { + acpi_tb_install_standard_table((acpi_physical_address) + acpi_gbl_FADT.Xfacs, + ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, + NULL, FALSE, TRUE, + &acpi_gbl_xfacs_index); } } diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c index bb4a56e5673a..15fa68a5ea6e 100644 --- a/drivers/acpi/acpica/tbutils.c +++ b/drivers/acpi/acpica/tbutils.c @@ -36,12 +36,7 @@ acpi_status acpi_tb_initialize_facs(void) { struct acpi_table_facs *facs; - /* If Hardware Reduced flag is set, there is no FACS */ - - if (acpi_gbl_reduced_hardware) { - acpi_gbl_FACS = NULL; - return (AE_OK); - } else if (acpi_gbl_FADT.Xfacs && + if (acpi_gbl_FADT.Xfacs && (!acpi_gbl_FADT.facs || !acpi_gbl_use32_bit_facs_addresses)) { (void)acpi_get_table_by_index(acpi_gbl_xfacs_index, From patchwork Fri Apr 19 17:18:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Cox X-Patchwork-Id: 1925647 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VLhJf12dkz1xrS for ; Sat, 20 Apr 2024 03:21:38 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1rxrvX-0007KD-Jd; Fri, 19 Apr 2024 17:21:31 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rxrvN-0007EU-Mb for kernel-team@lists.ubuntu.com; Fri, 19 Apr 2024 17:21:21 +0000 Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 6973E3F331 for ; Fri, 19 Apr 2024 17:21:21 +0000 (UTC) Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-6a025a08cfaso27564716d6.1 for ; Fri, 19 Apr 2024 10:21:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713547279; x=1714152079; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3rnAX4jMVLtL5K2OuAzDk8YLuuN8pS2XmcOdIX3eCtE=; b=RweCxhU3ntLs27N5u52sCsqho7kAim2YFfLt2kdswlIUU81KdUwJKmp/+p8iFKbIol oIe+GWyeguqr2JXjMF6tJ7eUUguzGNloMddx6Gz25J64DWAH/IIYIt7yVTSagpawpND4 ci6eKCAtxLBQvs/fDaRm1D7l/HYoDaIcOZU0qy9PYx5A7DL5YXUw8s/Bel/d89/WlGIA yg9/vPFkAA84of3ehZOu84oLzTSbUmJ3wrw+FXoi/QgIAf9xQ921pvkYq6YiesLXwweO Pr5PcSnwhK919+5h7kbeL2/ro24Ov43vETnN5YZw7lz2HeGeGeQvPksZ3gNdCv2vvs4E BY2A== X-Gm-Message-State: AOJu0Ywr8p7tdeWhUzQHofqgwIjAkyBmje9Eayqz62ZJ0tCfGWzIBTIf IvS7+H044GY3Xhwd3dp43a/GLWOn1PrxFn6TNK8tRX1XgX7PHgIRhiJPwAR4B861Vor9JuoYUrI VOIF+IwuuDfQAO5qFlNn2/Sc99ekTy2DrmX6bWBVzftS923BDCrtYhw2L70kyql2TrrP+L2tkMA ja8Q7EwRZAig== X-Received: by 2002:ad4:51cb:0:b0:69b:a42:5c85 with SMTP id p11-20020ad451cb000000b0069b0a425c85mr2942124qvq.30.1713547278931; Fri, 19 Apr 2024 10:21:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG8ufrwskh+ximPu4OCnx/vBRkQlJCsK2DQBI2zc3xneGYeQ/TuWPpZKui/SJNkVg4CsiuoYw== X-Received: by 2002:ad4:51cb:0:b0:69b:a42:5c85 with SMTP id p11-20020ad451cb000000b0069b0a425c85mr2942113qvq.30.1713547278678; Fri, 19 Apr 2024 10:21:18 -0700 (PDT) Received: from cox.conference ([76.69.53.230]) by smtp.gmail.com with ESMTPSA id q8-20020a0c8cc8000000b0069fcd0520easm1746395qvb.17.2024.04.19.10.21.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 10:21:16 -0700 (PDT) From: Philip Cox To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/2] UBUNTU: SAUCE: arm64: acpi: Honour firmware_signature field of FACS, if it exists Date: Fri, 19 Apr 2024 13:18:53 -0400 Message-Id: <20240419171853.81663-3-philip.cox@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240419171853.81663-1-philip.cox@canonical.com> References: <20240419171853.81663-1-philip.cox@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: David Woodhouse BugLink: https://bugs.launchpad.net/bugs/2061006 If the firmware_signature changes then OSPM should not attempt to resume from hibernate, but should instead perform a clean reboot. Set the global swsusp_hardware_signature to allow the generic code to include the value in the swsusp header on disk, and perform the appropriate check on resume. Signed-off-by: David Woodhouse Acked-by: Sudeep Holla (cherry-picked from: https://lore.kernel.org/r/20240312134148.727454-2-dwmw2@infradead.org) Signed-off-by: Philip Cox --- arch/arm64/kernel/acpi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c index dba8fcec7f33..e0e7b93c16cc 100644 --- a/arch/arm64/kernel/acpi.c +++ b/arch/arm64/kernel/acpi.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -227,6 +228,15 @@ void __init acpi_boot_table_init(void) if (earlycon_acpi_spcr_enable) early_init_dt_scan_chosen_stdout(); } else { +#ifdef CONFIG_HIBERNATION + struct acpi_table_header *facs = NULL; + acpi_get_table(ACPI_SIG_FACS, 1, &facs); + if (facs) { + swsusp_hardware_signature = + ((struct acpi_table_facs *)facs)->hardware_signature; + acpi_put_table(facs); + } +#endif acpi_parse_spcr(earlycon_acpi_spcr_enable, true); if (IS_ENABLED(CONFIG_ACPI_BGRT)) acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);