From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 756345B5D6; Tue, 2 Apr 2024 10:29:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712053783; cv=none; b=b5RtPfDTyYrh8l/vj7pKNe2H1NWqXS2n6WaR8x8tHM0NaU06NqF4G3bgeRfvp38PXPsW33pWSSUN3ZpyQq4DxICqt7aUAVv3UfO1SQ+glEVfu5Q4Qy05UnU6CIl9iTIVCAVcdw8lh4oj0zxlyWh907kjA+NQwRtRE6H2igX7WQU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712053783; c=relaxed/simple; bh=0PLxVVExlBoCSyhGw16os7pDNVu9PcLykdvcokxzKlk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KhFdQb2kiZpg28fEIBeAJX7tHl4glEibNGguKyqi3OU6uwJ4k+iidZMWWJ3gP8Alt9M7lMMpVrEN/MQJRFFMJQsn9l0Sj8ap8nYSqE9BDwc2jLqvneAxGmTExrm8xr8dWEYNKK8ieVTjxEn6iPofRNgdezCPEowRBA4hHH8FS/w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C811DFEC; Tue, 2 Apr 2024 03:30:11 -0700 (PDT) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3BBAE3F766; Tue, 2 Apr 2024 03:29:38 -0700 (PDT) Date: Tue, 2 Apr 2024 11:29:35 +0100 From: Sudeep Holla To: David Woodhouse Cc: linux-arm-kernel@lists.infradead.org, Sudeep Holla , Catalin Marinas , Will Deacon , Robert Moore , "Rafael J. Wysocki" , Len Brown , mediou@amazon.de, alisaidi@amazon.com, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev, Saket Dumbre Subject: Re: [PATCH 2/2] arm64: acpi: Honour firmware_signature field of FACS, if it exists Message-ID: References: <20240312134148.727454-1-dwmw2@infradead.org> <20240312134148.727454-2-dwmw2@infradead.org> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, Apr 02, 2024 at 10:29:57AM +0100, David Woodhouse wrote: > On Tue, 2024-03-12 at 13:41 +0000, David Woodhouse wrote: > > From: David Woodhouse > > > > 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 > > Ping? > > > --- > >  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 I think it is OK as a temporary solution for now. But there was some investigation last year as part of some work in Linaro to enable "drivers/acpi/sleep.c" into the build cleaning up some x86-ness in there. acpi_sleep_hibernate_setup() already does this but enabling sleep.c need some careful investigation so that it doesn't break any existing arm64/x86 platforms and made need some wordings clarification in the ACPI spec. Today system suspend work via psci std path bypassing the ACPI paths which may not be ideal as none of the ACPI methods are honoured. Some arm64 platforms may implement them and expect to be executed in the future, maybe ? So, until that happens, I see this as an possible alternative and temporary solution. Acked-by: Sudeep Holla -- Regards, Sudeep