Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7583159ybl; Thu, 16 Jan 2020 02:04:00 -0800 (PST) X-Google-Smtp-Source: APXvYqz+wpgQADCArYdHmGSUo37sp8wdsCZ0PD92mAP5ZOSeI9rN7OwB+M0m5wMEWugZtEcTBtE0 X-Received: by 2002:a05:6830:1d59:: with SMTP id p25mr1350031oth.308.1579169040381; Thu, 16 Jan 2020 02:04:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579169040; cv=none; d=google.com; s=arc-20160816; b=0bdcMrf9W7MqBRLnf3MTqslalnQy3gDPdSW4zvX9Jj1YqvXNxcWj2WrbLx305W2+sJ XBxNqcRgyNs4gG8Kcq0GJ7mM0wf0jVpXnhAUsSyZY2tvvfzPWpXiF+JkQbEOjvzEQFiA uqoV4CBX8dkorb+sP0OWhkl4wz4Nj0ZgMtTpSDUPQSWTST3GQ3860EoWfWezicXS6gpN y0dwGFXd69sDKBTDF04391RqDkNEoD3/0V7Tq/sWe38q5sMS/xNxNNnXhE1HWV7nTYm7 sysoQXF1Y4Io4v3eR3hY3+K+gnNt7GH4sREGAHKmeCX39jd/+3l9XZA9Ex0U+s/Nhn6r F3Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=ehZVRRgGA6K7LYKERYT9m9Kqby1XUIRO5leJf884LQg=; b=WETvUpy8leXsJ7wGdiqbqXaPXJiX1pwGL/+oq93OMlytvnx85x8n84B98eKSV1Qgwr 4TRRGD8EVywOIWwjDfwwFA/5+pcFgau2/QZyEGd+s83iAc1qrdNLMXUMg4EpvsJ/xv8I KYytDc62/9ASdAtqdCEF1ZAgONVCQoyp1hpHbOQFslaX5Cz0IGrX59e6MkwrJbvTenPy nDT+rV2Mxy2SxBCC6M9BcQ8YftG30RCH+uFM+Xz4+ueP4UHKS5X4yD5Wtwg3wAMmsbK+ f1L2bTU5AMRG3FGpleqbqI6dJAydVyIGnc9Ybz+VsfrjhkKuwoQYhhk5BrhkO13vTnBu bYtg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5si11705247oie.17.2020.01.16.02.03.48; Thu, 16 Jan 2020 02:04:00 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730597AbgAPJkW (ORCPT + 99 others); Thu, 16 Jan 2020 04:40:22 -0500 Received: from mail-oi1-f195.google.com ([209.85.167.195]:43259 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726653AbgAPJkW (ORCPT ); Thu, 16 Jan 2020 04:40:22 -0500 Received: by mail-oi1-f195.google.com with SMTP id p125so18317182oif.10; Thu, 16 Jan 2020 01:40:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ehZVRRgGA6K7LYKERYT9m9Kqby1XUIRO5leJf884LQg=; b=tbNAoalcCFQwchIcvadfmk38UTHM9PFnmL7tSpYsOE3/h2lG03b0xJwvX7mOr8KBIc lT/6p/Z4lv02ijdfMbmAy8NZA6jNue6nDAHb7bgULvVJT4HIAUWGvHiMxQE9cDru6Pm1 L9usN7+QSl+6G6Em5TpjK+ZVZeqPzOAapVbNoOAt7CeVJ0RNl5X1e2ZCT8LlUAd/B/Dg XwGmssoLMrppPiyFR4eOH4q+sweyJhf6GhgObkY6OFfae/GYI2thu7OgEnuJadO+SxTF qngHnAuop9Rjdrt2FUd0jTd8G9i91SvKzsljYsRszHjTOc0FvDhJig8vx53Nm55CxU4v mNIA== X-Gm-Message-State: APjAAAWmeHXe7hnEpWHG2IhbMfJqm4PLD5Xq+g7lJGLyhd6P70E4vBLL MV2zBaD6jKBpUPQ76sg9B4gXROh26jA4U/ooVzg= X-Received: by 2002:aca:cd92:: with SMTP id d140mr3388803oig.68.1579167621279; Thu, 16 Jan 2020 01:40:21 -0800 (PST) MIME-Version: 1.0 References: <20200115232629.GA9231@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com> In-Reply-To: <20200115232629.GA9231@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com> From: "Rafael J. Wysocki" Date: Thu, 16 Jan 2020 10:40:08 +0100 Message-ID: Subject: Re: [RESEND PATCH] ACPICA: Enable sleep button on ACPI legacy wake To: Anchal Agarwal , Erik Kaneda , Robert Moore Cc: Rafael Wysocki , ACPI Devel Maling List , Linux Kernel Mailing List , Len Brown , "open list:ACPI COMPONENT ARCHITECTURE (ACPICA)" , "Singh, Balbir" , fllinden@amazon.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 16, 2020 at 12:26 AM Anchal Agarwal wrote: > > 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); > } Erik, Bob, please pick this up if you don't have specific objections against it. I'll wait for it to show up in an upstream release.