Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7142737ybl; Wed, 15 Jan 2020 16:27:23 -0800 (PST) X-Google-Smtp-Source: APXvYqw9BazGXUijxkLH4tgZbAAcfSfSHK/ONLHv2ahpIMOC82erdwgv5+U2OAABLMGFNl8Glkcf X-Received: by 2002:a9d:69ce:: with SMTP id v14mr4858135oto.248.1579134443546; Wed, 15 Jan 2020 16:27:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579134443; cv=none; d=google.com; s=arc-20160816; b=sN3MtAfoGWwwMf24dZi8vXRLnEWh/dEU5IR2UcWiTXJd5GK1LH0JPJJl0WEtIf4ZBR ArRvufu3ZdxeQC2pNQR0goDUKTDe1FDsl3aSxEYbDhf5QqXPY2C9B/NMeSW7122wmcCJ JXzcYIFOhHPVdF/QiLcFsyZo9VjY2GZP1j7d5lWQEjAwx5h5/HdHD6JfOKyZgAlq+lH1 Wm3H2JE5gMZLC6uhf/MS8jWFfzyK6ua/3Ib5qjSnj5cTFpq0bCVufoO+IHTSE+wefHOu s8m+rqkhKUQv1ZhWyTsSHH1ph7sCfHp+lOjKvhKcf5yFZhZeG3nY5s9B77xaVxKVqte4 2mHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:ironport-sdr :dkim-signature; bh=EmH9ZrC0td+WgzEilmoS02AeN+pe+PPCZem5cu228xc=; b=iz5QYTNoaX1YZPTRrlI0smcihYKt6K10tg/IN4l+DRrl2Lr0/itx7Cj23l/nj/N+NZ Vmx+Ws5UHNqURsJLqVABB6xwGhSu8RKtH8zI0eFV1LOQ+cCVQ7lLPWSKspm9IVCor90X 9HgzHYzQ0QGdBxNJO14NvgnFdtCVnNGu4VabZGb189v9Y3OxU6onkoPz6CVc2CFYGh6S kgXPgYBUvGP2LlDOzs7c1fSNguP5l5Xn4bDk7HflKpWUciCwDwCIkhqwsY2cRu9xvH0k FdQgkqtxLHC5ahifMBIh+2nZFdYra/8MvYkMWr6zVFEJJEwM8Q3yjKsFl+Rx4roTvWBq 6tWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=PL7SuMpk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a14si13208456otk.2.2020.01.15.16.27.11; Wed, 15 Jan 2020 16:27:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=PL7SuMpk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730523AbgAOX0m (ORCPT + 99 others); Wed, 15 Jan 2020 18:26:42 -0500 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]:30816 "EHLO smtp-fw-33001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726513AbgAOX0m (ORCPT ); Wed, 15 Jan 2020 18:26:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1579130802; x=1610666802; h=date:from:to:subject:message-id:mime-version; bh=EmH9ZrC0td+WgzEilmoS02AeN+pe+PPCZem5cu228xc=; b=PL7SuMpkBO9Ue83oDuRCQBUS4kM4I6DFr1Fl33pM2/dFC6ApjYG/ql4q 1NDBu/X8egMtg+2sXFHojq8AaKZ3zECgf9yibkYigiuEXgWdNPBh7G6u0 LP7UZQuOpa6kPPfSOItpEuWunVwdPylHPmBRhJgMcRmKIxkHZv4FNbA5w 0=; IronPort-SDR: 6UBEafvcAbyy2TW/DwD5jdhfg/fTiPJx5sBU6Ks71NfBsl62rY+75PYUl1lABj4lSJzQMv8E5e fqgHTyHuyoRw== X-IronPort-AV: E=Sophos;i="5.70,323,1574121600"; d="scan'208";a="20354096" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-2b-4e24fd92.us-west-2.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP; 15 Jan 2020 23:26:30 +0000 Received: from EX13MTAUWB001.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2b-4e24fd92.us-west-2.amazon.com (Postfix) with ESMTPS id BC62FA1C66; Wed, 15 Jan 2020 23:26:29 +0000 (UTC) Received: from EX13D07UWB002.ant.amazon.com (10.43.161.131) by EX13MTAUWB001.ant.amazon.com (10.43.161.207) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 15 Jan 2020 23:26:29 +0000 Received: from EX13MTAUWB001.ant.amazon.com (10.43.161.207) by EX13D07UWB002.ant.amazon.com (10.43.161.131) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 15 Jan 2020 23:26:28 +0000 Received: from dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com (172.22.96.68) by mail-relay.amazon.com (10.43.161.249) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 15 Jan 2020 23:26:28 +0000 Received: by dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com (Postfix, from userid 4335130) id 087CF40E7E; Wed, 15 Jan 2020 23:26:29 +0000 (UTC) Date: Wed, 15 Jan 2020 23:26:29 +0000 From: Anchal Agarwal To: , , , , , , , , , Subject: [RESEND PATCH] ACPICA: Enable sleep button on ACPI legacy wake Message-ID: <20200115232629.GA9231@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently we do not see sleep_enable bit set after guest resumes from hibernation. Hibernation is triggered in guest on receiving a sleep trigger from the hypervisor(S4 state). We see that power button is enabled on wake up from S4 state however sleep button isn't. This causes subsequent invocation of sleep state to fail in the guest. Any environment going through acpi_hw_legacy_wake() won't have sleep button enabled. Signed-off-by: Anchal Agarwal Reviewed-by: Balbir Singh Reviewed-by: Frank van der Linden --- drivers/acpi/acpica/hwsleep.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c index b62db8ec446f..a176c7802760 100644 --- a/drivers/acpi/acpica/hwsleep.c +++ b/drivers/acpi/acpica/hwsleep.c @@ -300,6 +300,17 @@ acpi_status acpi_hw_legacy_wake(u8 sleep_state) [ACPI_EVENT_POWER_BUTTON]. status_register_id, ACPI_CLEAR_STATUS); + /* Enable sleep button */ + (void) + acpi_write_bit_register(acpi_gbl_fixed_event_info + [ACPI_EVENT_SLEEP_BUTTON]. + enable_register_id, ACPI_ENABLE_EVENT); + + (void) + acpi_write_bit_register(acpi_gbl_fixed_event_info + [ACPI_EVENT_SLEEP_BUTTON]. + status_register_id, ACPI_CLEAR_STATUS); + acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, ACPI_SST_WORKING); return_ACPI_STATUS(status); }