All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: "Zheng, Lv" <lv.zheng@intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	"Linux PM" <linux-pm@vger.kernel.org>,
	"Linux ACPI" <linux-acpi@vger.kernel.org>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Darren Hart" <dvhart@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Srinivas Pandruvada" <srinivas.pandruvada@linux.intel.com>,
	"Mika Westerberg" <mika.westerberg@linux.intel.com>,
	"Mario Limonciello" <mario.limonciello@dell.com>,
	"Tom Lanyon" <tom@oneshoeco.com>,
	"Jér?me de Bretagne" <jerome.debretagne@gmail.com>
Subject: Re: [PATCH v2 3/3] ACPI / sleep: EC-based wakeup from suspend-to-idle on recent Dell systems
Date: Tue, 20 Jun 2017 01:46:07 +0200	[thread overview]
Message-ID: <CAJZ5v0ix2z4MKf3rYiHEQiqr9u00LMPAZ-6hA=LBocUg7SLfJQ@mail.gmail.com> (raw)
In-Reply-To: <1AE640813FDE7649BE1B193DEA596E886CED1B22@SHSMSX101.ccr.corp.intel.com>

On Tue, Jun 20, 2017 at 1:37 AM, Zheng, Lv <lv.zheng@intel.com> wrote:
> Hi, Rafael
>
>> From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-owner@vger.kernel.org] On Behalf Of Rafael J.
>> Wysocki
>> Subject: [PATCH v2 3/3] ACPI / sleep: EC-based wakeup from suspend-to-idle on recent Dell systems
>>
>> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>>
>> Some recent Dell laptops, including the XPS13 model numbers 9360 and
>> 9365, cannot be woken up from suspend-to-idle by pressing the power
>> button which is unexpected and makes that feature less usable on
>> those systems.  Moreover, on the 9365 ACPI S3 (suspend-to-RAM) is
>> not expected to be used at all (the OS these systems ship with never
>> exercises the ACPI S3 path) and suspend-to-idle is the only viable
>> system suspend mechanism in there.
>>
>> The reason why the power button wakeup from suspend-to-idle doesn't
>> work on those systems is because their power button events are
>> signaled by the EC (Embedded Controller), whose GPE (General Purpose
>> Event) line is disabled during suspend-to-idle transitions in Linux.
>> That is done on purpose, because in general the EC tends to generate
>> tons of events for various reasons (battery and thermal updates and
>> similar, for example) and all of them would kick the CPUs out of deep
>> idle states while in suspend-to-idle, which effectively would defeat
>> its purpose.
>>
>> Of course, on the Dell systems in question the EC GPE must be enabled
>> during suspend-to-idle transitions for the button press events to
>> be signaled while suspended at all.  For this reason, add a DMI
>> switch to the ACPI system suspend infrastructure to treat the EC
>> GPE as a wakeup one on the affected Dell systems.  In case the
>> users would prefer not to do that after all, add a new kernel
>> command line switch, acpi_sleep=no_ec_wakeup, to disable that new
>> behavior.
>>

[cut]

>>
>> Index: linux-pm/drivers/acpi/sleep.c
>> ===================================================================
>> --- linux-pm.orig/drivers/acpi/sleep.c
>> +++ linux-pm/drivers/acpi/sleep.c
>> @@ -160,6 +160,23 @@ static int __init init_nvs_nosave(const
>>       return 0;
>>  }
>>
>> +/* If set, it is allowed to use the EC GPE to wake up the system. */
>> +static bool ec_gpe_wakeup_allowed __initdata = true;
>> +
>> +void __init acpi_disable_ec_gpe_wakeup(void)
>> +{
>> +     ec_gpe_wakeup_allowed = false;
>> +}
>> +
>> +/* If set, the EC GPE will be configured to wake up the system. */
>> +static bool ec_gpe_wakeup;
>> +
>> +static int __init init_ec_gpe_wakeup(const struct dmi_system_id *d)
>> +{
>> +     ec_gpe_wakeup = ec_gpe_wakeup_allowed;
>> +     return 0;
>> +}
>> +
>>  static struct dmi_system_id acpisleep_dmi_table[] __initdata = {
>>       {
>>       .callback = init_old_suspend_ordering,
>> @@ -343,6 +360,26 @@ static struct dmi_system_id acpisleep_dm
>>               DMI_MATCH(DMI_PRODUCT_NAME, "80E3"),
>>               },
>>       },
>> +     /*
>> +      * Enable the EC to wake up the system from suspend-to-idle to allow
>> +      * power button events to it wake up.
>> +      */
>> +     {
>> +      .callback = init_ec_gpe_wakeup,
>> +      .ident = "Dell XPS 13 9360",
>> +      .matches = {
>> +             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
>> +             DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9360"),
>> +             },
>> +     },
>> +     {
>> +      .callback = init_ec_gpe_wakeup,
>> +      .ident = "Dell XPS 13 9365",
>> +      .matches = {
>> +             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
>> +             DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9365"),
>> +             },
>> +     },
>>       {},
>>  };
>>
>
> I have a concern here.
>
> ACPI spec has already defined a mechanism to statically
> Mark GPEs as wake-capable and enable it, it is done via
> _PRW. We may call it a "static wakeup GPE" mechanism.
>
> Now the problem might be on some platforms, _PRW cannot be
> prepared unconditionally. And the platform designers wants
> a "dynamic wakeup GPE" mechanism to dynamically
> mark/enable GPEs as wakeup GPE after having done some
> platform specific behaviors (ex., after/before
> saving/restoring some firmware configurations).
>
> From this point of view, can we prepare several APIs in
> sleep.c to allow dynamically mark/enable wakeup GPEs and
> export EC information via a new API from ec.c, ex.,
> acpi_ec_get_attributes(), or just publish struct acpi_ec
> and first_ec in acpi_ec.h to the other drivers.
> So that all such kinds of platforms drivers can use both
> interfaces to dynamically achieve this, which can help
> to avoid introducing quirk tables here.

I'm not sure how this is related to the patch.

Thanks,
Rafael

  reply	other threads:[~2017-06-19 23:46 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-26 21:21 [PATCH 0/5] PM / sleep: Support power button wakeup from S2I on recent Dell laptops Rafael J. Wysocki
2017-04-26 21:22 ` [PATCH 1/5] PM / wakeup: Integrate mechanism to abort transitions in progress Rafael J. Wysocki
2017-04-26 21:23 ` [PATCH 2/5] ACPI / sleep: Ignore spurious SCI wakeups from suspend-to-idle Rafael J. Wysocki
2017-04-26 21:24 ` [PATCH 3/5] ACPI / sleep: EC-based wakeup from suspend-to-idle on Dell systems Rafael J. Wysocki
2017-04-27 14:47   ` Mario.Limonciello
2017-04-27 14:47     ` Mario.Limonciello
2017-04-27 22:26     ` Rafael J. Wysocki
2017-05-04  7:58       ` Zheng, Lv
2017-05-04  7:58         ` Zheng, Lv
2017-05-04 14:23         ` Rafael J. Wysocki
2017-05-04 14:23           ` Rafael J. Wysocki
2017-05-04 14:26           ` Rafael J. Wysocki
2017-05-04 14:26             ` Rafael J. Wysocki
2017-05-05  0:36             ` Zheng, Lv
2017-05-05  0:36               ` Zheng, Lv
2017-04-26 21:24 ` [PATCH 4/5] platform: x86: intel-vbtn: Wake up the system from suspend-to-idle Rafael J. Wysocki
2017-04-26 21:27 ` [PATCH 5/5] platform: x86: intel-hid: " Rafael J. Wysocki
2017-05-04 14:33 ` [PATCH 0/5] PM / sleep: Support power button wakeup from S2I on recent Dell laptops Rafael J. Wysocki
2017-05-31 23:23 ` [PATCH 0/3] ACPI " Rafael J. Wysocki
2017-05-31 23:24   ` [PATCH 1/3] platform: x86: intel-vbtn: Wake up the system from suspend-to-idle Rafael J. Wysocki
2017-05-31 23:26   ` [PATCH 2/3] platform: x86: intel-hid: " Rafael J. Wysocki
2017-05-31 23:27   ` [PATCH 3/3] ACPI / sleep: EC-based wakeup from suspend-to-idle on recent Dell systems Rafael J. Wysocki
2017-06-05 15:18     ` Mario.Limonciello
2017-06-05 15:18       ` Mario.Limonciello
2017-06-05 20:51       ` Rafael J. Wysocki
2017-06-01 10:43   ` [PATCH 0/3] ACPI / sleep: Support power button wakeup from S2I on recent Dell laptops Andy Shevchenko
2017-06-01 11:50     ` Tom Lanyon
2017-06-01 14:59       ` Rafael J. Wysocki
2017-06-02  1:06         ` Tom Lanyon
2017-06-02 23:16           ` Rafael J. Wysocki
2017-06-01 15:00     ` Rafael J. Wysocki
2017-06-19 21:48   ` [PATCH v2 " Rafael J. Wysocki
2017-06-19 21:49     ` [PATCH v2 1/3] platform: x86: intel-vbtn: Wake up the system from suspend-to-idle Rafael J. Wysocki
2017-06-19 21:51     ` [PATCH v2 2/3] platform: x86: intel-hid: " Rafael J. Wysocki
2017-06-19 21:53     ` [PATCH v2 3/3] ACPI / sleep: EC-based wakeup from suspend-to-idle on recent Dell systems Rafael J. Wysocki
2017-06-19 23:37       ` Zheng, Lv
2017-06-19 23:46         ` Rafael J. Wysocki [this message]
2017-06-21  1:13           ` Zheng, Lv
2017-06-20  0:07       ` Linus Torvalds
2017-06-20  1:13         ` Rafael J. Wysocki
2017-06-20  2:00           ` Linus Torvalds
2017-06-20 21:16             ` Rafael J. Wysocki
2017-06-21  1:13           ` Zheng, Lv
2017-06-22 23:56       ` [PATCH] ACPI / sleep: EC-based wakeup from suspend-to-idle on recent systems Rafael J. Wysocki
2017-06-23  2:40         ` Linus Torvalds
2017-06-27  5:50           ` Tom Lanyon
2017-06-27  6:47             ` Andy Shevchenko
2017-06-27 10:54               ` Tom Lanyon
2017-06-27 11:10             ` Mario.Limonciello
2017-06-27 11:10               ` Mario.Limonciello
2017-06-27 15:03             ` Rafael J. Wysocki
2017-06-27 16:14               ` Srinivas Pandruvada
2017-07-06 11:41                 ` Tom Lanyon
2017-07-07  0:38                   ` Srinivas Pandruvada
2017-06-23  6:30         ` Zheng, Lv
2017-06-23 12:13           ` Rafael J. Wysocki
2017-06-23 12:27             ` Rafael J. Wysocki
2017-06-23 13:15         ` [PATCH v2] " Rafael J. Wysocki
2017-06-23 15:37           ` Mario.Limonciello
2017-06-23 15:37             ` Mario.Limonciello
2017-06-23 16:06             ` Srinivas Pandruvada
2017-06-23 18:01               ` Mario.Limonciello
2017-06-23 18:01                 ` Mario.Limonciello
2017-06-24  0:43             ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJZ5v0ix2z4MKf3rYiHEQiqr9u00LMPAZ-6hA=LBocUg7SLfJQ@mail.gmail.com' \
    --to=rafael@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=dvhart@infradead.org \
    --cc=jerome.debretagne@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lv.zheng@intel.com \
    --cc=mario.limonciello@dell.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=tom@oneshoeco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.