From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Zheng, Lv" Subject: RE: [PATCH 3/5] ACPI / sleep: EC-based wakeup from suspend-to-idle on Dell systems Date: Fri, 5 May 2017 00:36:03 +0000 Message-ID: <1AE640813FDE7649BE1B193DEA596E886CE9DB82@SHSMSX101.ccr.corp.intel.com> References: <1979543.KIEJ8uyRaT@aspire.rjw.lan> <1AE640813FDE7649BE1B193DEA596E886CE9D3AE@SHSMSX101.ccr.corp.intel.com> <2575390.Ukje8MD5v5@aspire.rjw.lan> <1679308.ELldjq8J12@aspire.rjw.lan> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT Return-path: In-Reply-To: <1679308.ELldjq8J12@aspire.rjw.lan> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: "Rafael J. Wysocki" Cc: "Mario.Limonciello@dell.com" , "linux-pm@vger.kernel.org" , "andriy.shevchenko@linux.intel.com" , "dvhart@infradead.org" , "linux-kernel@vger.kernel.org" , "linux-acpi@vger.kernel.org" , "srinivas.pandruvada@linux.intel.com" , "tglx@linutronix.de" , "mika.westerberg@linux.intel.com" List-Id: linux-acpi@vger.kernel.org Hi, > From: Rafael J. Wysocki [mailto:rjw@rjwysocki.net] > Subject: Re: [PATCH 3/5] ACPI / sleep: EC-based wakeup from suspend-to-idle on Dell systems > > On Thursday, May 04, 2017 04:23:30 PM Rafael J. Wysocki wrote: > > On Thursday, May 04, 2017 07:58:53 AM Zheng, Lv wrote: > > > Hi, > > > > > > > -----Original Message----- > > > > From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-owner@vger.kernel.org] On Behalf Of > Rafael J. > > > > Wysocki > > > > Sent: Friday, April 28, 2017 6:26 AM > > > > To: Mario.Limonciello@dell.com > > > > Cc: linux-pm@vger.kernel.org; andriy.shevchenko@linux.intel.com; dvhart@infradead.org; linux- > > > > kernel@vger.kernel.org; linux-acpi@vger.kernel.org; srinivas.pandruvada@linux.intel.com; > > > > tglx@linutronix.de; mika.westerberg@linux.intel.com > > > > Subject: Re: [PATCH 3/5] ACPI / sleep: EC-based wakeup from suspend-to-idle on Dell systems > > > > > > > > On Thursday, April 27, 2017 02:47:59 PM Mario.Limonciello@dell.com wrote: > > > > > > -----Original Message----- > > > > > > From: Rafael J. Wysocki [mailto:rjw@rjwysocki.net] > > > > > > Sent: Wednesday, April 26, 2017 4:24 PM > > > > > > To: Linux PM > > > > > > Cc: Andy Shevchenko ; Darren Hart > > > > > > ; LKML ; Linux ACPI > > > > > acpi@vger.kernel.org>; Srinivas Pandruvada > > > > > > ; Thomas Gleixner ; > > > > > > Mika Westerberg ; Limonciello, Mario > > > > > > > > > > > > Subject: [PATCH 3/5] ACPI / sleep: EC-based wakeup from suspend-to-idle on Dell > > > > > > systems > > > > > > > > > > > > From: Rafael J. Wysocki > > > > > > > > > > > > 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 hardly usable on > > > > > > those systems. However, on the 9365 ACPI S3 (suspend-to-RAM) is not > > > > > > expected to be used at all (these systems ship with Windows 10 using > > > > > > Modern Standby which 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 would not be desirable. > > > > > > > > > > > > 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. Fortunately, there is a way to > > > > > > tell the EC to stop generating the non-wakeup events, which is by > > > > > > using the _DSM object under the so called micro-PEP (uPEP) device > > > > > > provided to support Modern Standby in Windows 10. > > > > > > > > > > > > The expected way to use it is to invoke function 0 from it on system > > > > > > initialization, functions 3 and 5 during suspend transitions and > > > > > > functions 4 and 6 during resume transitions (to reverse the actions > > > > > > carried out by the former). In particular, function 5 from the uPEP > > > > > > device _DSM causes the EC to become less verbose (so to speak) on the > > > > > > affected systems and then its GPE can be enabled as a wakeup source > > > > > > (then, on resume, function 6 switches it back to the "working state" > > > > > > mode). > > > > > > > > > > > > In support of the affected Dell systems, implement the uPEP device > > > > > > handling as described and allow the EC to generate system wakeup > > > > > > events if that device is present and behaves as expected. Enable > > > > > > that for Dell only, as there are other systems out there in which > > > > > > the uPEP device is exposed in the ACPI tables and its _DSM appears > > > > > > to be functional, but it actually isn't, whereas Dell is committed > > > > > > to supporting it. > > > > > > > > > > > > > > > > I am of course biased in that my priority is for this to work for Dell. > > > > > Dell is definitely committed to supporting this on any system with > > > > > the low power idle bit in the FADT set. > > > > > > > > > > So I'm fine with the current proposed solution, but have you > > > > > dug into what actually breaks on this other system? Does it actually > > > > > work with Modern Standby + the uPEP device on Windows 10? > > > > > > > > > > To my understanding I would think any OEM that is enabling this > > > > > uPEP device it should be getting called by the Windows kernel > > > > > identically when entering resiliency phases. > > > > > > > > > > This makes me wonder if it should be inverted and a blacklist > > > > > of platforms that the uPEP device doesn't work. > > > > > > > > For now I'd prefer to only do it on platforms where the benefit is clear. > > > > > > > > The next step may be to extend it to the other ones, but let's avoid making > > > > what is problem mitigation really depend on things that may or may not > > > > work elsewhere to start with. > > > > > > Then is it possible to invoke acpi_mark_gpe_for_wake() (and maybe also acpi_unmark_gpe_for_wake()) > right after invoking uPEP functions? > > > So that such platform specific stuffs won't go into ec.c. > > > > I'm not sure ATM, but it should be doable in theory. > > So the problem with that is that the EC GPE number is not known to the sleep.c > code, so it would need to be exported by the EC driver somehow or similar, > which would be uglier than the current patch IMO. Ah, I see. Anyway, this is not urgent. We can just focus on user issue now. Thanks and best regards Lv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753046AbdEEAgT convert rfc822-to-8bit (ORCPT ); Thu, 4 May 2017 20:36:19 -0400 Received: from mga01.intel.com ([192.55.52.88]:8267 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751668AbdEEAgJ (ORCPT ); Thu, 4 May 2017 20:36:09 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,290,1491289200"; d="scan'208";a="1126617560" From: "Zheng, Lv" To: "Rafael J. Wysocki" CC: "Mario.Limonciello@dell.com" , "linux-pm@vger.kernel.org" , "andriy.shevchenko@linux.intel.com" , "dvhart@infradead.org" , "linux-kernel@vger.kernel.org" , "linux-acpi@vger.kernel.org" , "srinivas.pandruvada@linux.intel.com" , "tglx@linutronix.de" , "mika.westerberg@linux.intel.com" Subject: RE: [PATCH 3/5] ACPI / sleep: EC-based wakeup from suspend-to-idle on Dell systems Thread-Topic: [PATCH 3/5] ACPI / sleep: EC-based wakeup from suspend-to-idle on Dell systems Thread-Index: AQHSvtTww1SE6fD4kUe5ZxdJmZqsEKHYxsCAgACAFQCACpMkUP//5kIAgAAAx4CAATAwcA== Date: Fri, 5 May 2017 00:36:03 +0000 Message-ID: <1AE640813FDE7649BE1B193DEA596E886CE9DB82@SHSMSX101.ccr.corp.intel.com> References: <1979543.KIEJ8uyRaT@aspire.rjw.lan> <1AE640813FDE7649BE1B193DEA596E886CE9D3AE@SHSMSX101.ccr.corp.intel.com> <2575390.Ukje8MD5v5@aspire.rjw.lan> <1679308.ELldjq8J12@aspire.rjw.lan> In-Reply-To: <1679308.ELldjq8J12@aspire.rjw.lan> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTM5Yjc1YWEtMGIwNy00MDFiLTkxOGQtZDI4ZDhjNThiOGQyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkNmdEp1ZEY1amtoTHVFYVwvR0ZETzBkbnl3cUFBN2xRWXdlejE0MjJqVlljPSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > From: Rafael J. Wysocki [mailto:rjw@rjwysocki.net] > Subject: Re: [PATCH 3/5] ACPI / sleep: EC-based wakeup from suspend-to-idle on Dell systems > > On Thursday, May 04, 2017 04:23:30 PM Rafael J. Wysocki wrote: > > On Thursday, May 04, 2017 07:58:53 AM Zheng, Lv wrote: > > > Hi, > > > > > > > -----Original Message----- > > > > From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-owner@vger.kernel.org] On Behalf Of > Rafael J. > > > > Wysocki > > > > Sent: Friday, April 28, 2017 6:26 AM > > > > To: Mario.Limonciello@dell.com > > > > Cc: linux-pm@vger.kernel.org; andriy.shevchenko@linux.intel.com; dvhart@infradead.org; linux- > > > > kernel@vger.kernel.org; linux-acpi@vger.kernel.org; srinivas.pandruvada@linux.intel.com; > > > > tglx@linutronix.de; mika.westerberg@linux.intel.com > > > > Subject: Re: [PATCH 3/5] ACPI / sleep: EC-based wakeup from suspend-to-idle on Dell systems > > > > > > > > On Thursday, April 27, 2017 02:47:59 PM Mario.Limonciello@dell.com wrote: > > > > > > -----Original Message----- > > > > > > From: Rafael J. Wysocki [mailto:rjw@rjwysocki.net] > > > > > > Sent: Wednesday, April 26, 2017 4:24 PM > > > > > > To: Linux PM > > > > > > Cc: Andy Shevchenko ; Darren Hart > > > > > > ; LKML ; Linux ACPI > > > > > acpi@vger.kernel.org>; Srinivas Pandruvada > > > > > > ; Thomas Gleixner ; > > > > > > Mika Westerberg ; Limonciello, Mario > > > > > > > > > > > > Subject: [PATCH 3/5] ACPI / sleep: EC-based wakeup from suspend-to-idle on Dell > > > > > > systems > > > > > > > > > > > > From: Rafael J. Wysocki > > > > > > > > > > > > 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 hardly usable on > > > > > > those systems. However, on the 9365 ACPI S3 (suspend-to-RAM) is not > > > > > > expected to be used at all (these systems ship with Windows 10 using > > > > > > Modern Standby which 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 would not be desirable. > > > > > > > > > > > > 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. Fortunately, there is a way to > > > > > > tell the EC to stop generating the non-wakeup events, which is by > > > > > > using the _DSM object under the so called micro-PEP (uPEP) device > > > > > > provided to support Modern Standby in Windows 10. > > > > > > > > > > > > The expected way to use it is to invoke function 0 from it on system > > > > > > initialization, functions 3 and 5 during suspend transitions and > > > > > > functions 4 and 6 during resume transitions (to reverse the actions > > > > > > carried out by the former). In particular, function 5 from the uPEP > > > > > > device _DSM causes the EC to become less verbose (so to speak) on the > > > > > > affected systems and then its GPE can be enabled as a wakeup source > > > > > > (then, on resume, function 6 switches it back to the "working state" > > > > > > mode). > > > > > > > > > > > > In support of the affected Dell systems, implement the uPEP device > > > > > > handling as described and allow the EC to generate system wakeup > > > > > > events if that device is present and behaves as expected. Enable > > > > > > that for Dell only, as there are other systems out there in which > > > > > > the uPEP device is exposed in the ACPI tables and its _DSM appears > > > > > > to be functional, but it actually isn't, whereas Dell is committed > > > > > > to supporting it. > > > > > > > > > > > > > > > > I am of course biased in that my priority is for this to work for Dell. > > > > > Dell is definitely committed to supporting this on any system with > > > > > the low power idle bit in the FADT set. > > > > > > > > > > So I'm fine with the current proposed solution, but have you > > > > > dug into what actually breaks on this other system? Does it actually > > > > > work with Modern Standby + the uPEP device on Windows 10? > > > > > > > > > > To my understanding I would think any OEM that is enabling this > > > > > uPEP device it should be getting called by the Windows kernel > > > > > identically when entering resiliency phases. > > > > > > > > > > This makes me wonder if it should be inverted and a blacklist > > > > > of platforms that the uPEP device doesn't work. > > > > > > > > For now I'd prefer to only do it on platforms where the benefit is clear. > > > > > > > > The next step may be to extend it to the other ones, but let's avoid making > > > > what is problem mitigation really depend on things that may or may not > > > > work elsewhere to start with. > > > > > > Then is it possible to invoke acpi_mark_gpe_for_wake() (and maybe also acpi_unmark_gpe_for_wake()) > right after invoking uPEP functions? > > > So that such platform specific stuffs won't go into ec.c. > > > > I'm not sure ATM, but it should be doable in theory. > > So the problem with that is that the EC GPE number is not known to the sleep.c > code, so it would need to be exported by the EC driver somehow or similar, > which would be uglier than the current patch IMO. Ah, I see. Anyway, this is not urgent. We can just focus on user issue now. Thanks and best regards Lv