lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 11 Jan 2018 15:51:23 +0000
From:   <Mario.Limonciello@...l.com>
To:     <rafael@...nel.org>
CC:     <rjw@...ysocki.net>, <linux-acpi@...r.kernel.org>,
        <andriy.shevchenko@...ux.intel.com>, <dvhart@...radead.org>,
        <linux-kernel@...r.kernel.org>, <linux-pm@...r.kernel.org>,
        <platform-driver-x86@...r.kernel.org>, <valy@....ro>
Subject: RE: [PATCH 1/2] ACPI / PM: Use Low Power S0 Idle on more systems

> -----Original Message-----
> From: rjwysocki@...il.com [mailto:rjwysocki@...il.com] On Behalf Of Rafael J.
> Wysocki
> Sent: Wednesday, January 10, 2018 4:23 PM
> To: Limonciello, Mario <Mario_Limonciello@...l.com>
> Cc: Rafael J. Wysocki <rjw@...ysocki.net>; ACPI Devel Maling List <linux-
> acpi@...r.kernel.org>; Andy Shevchenko <andriy.shevchenko@...ux.intel.com>;
> Darren Hart <dvhart@...radead.org>; Linux Kernel Mailing List <linux-
> kernel@...r.kernel.org>; Linux PM <linux-pm@...r.kernel.org>; Platform Driver
> <platform-driver-x86@...r.kernel.org>; valy@....ro
> Subject: Re: [PATCH 1/2] ACPI / PM: Use Low Power S0 Idle on more systems
> 
> On Wed, Jan 10, 2018 at 6:38 PM,  <Mario.Limonciello@...l.com> wrote:
> >
> >
> >> -----Original Message-----
> >> From: platform-driver-x86-owner@...r.kernel.org [mailto:platform-driver-x86-
> >> owner@...r.kernel.org] On Behalf Of Rafael J. Wysocki
> >> Sent: Wednesday, January 10, 2018 6:26 AM
> >> To: Linux ACPI <linux-acpi@...r.kernel.org>
> >> Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>; Darren Hart
> >> <dvhart@...radead.org>; LKML <linux-kernel@...r.kernel.org>; Linux PM
> <linux-
> >> pm@...r.kernel.org>; Platform Driver <platform-driver-x86@...r.kernel.org>;
> >> Valentin Manea <valy@....ro>
> >> Subject: [PATCH 1/2] ACPI / PM: Use Low Power S0 Idle on more systems
> >>
> >> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> >>
> >> Some systems don't support the ACPI_LPS0_ENTRY and ACPI_LPS0_EXIT
> >> functions in their Low Power S0 Idle _DSM, but still expect EC
> >> events to be processed in the suspend-to-idle state for power button
> >> wakeup (among other things) to work.  Surface Pro3 turns out to be
> >> one of them.
> >>
> >> Fortunately, it still provides Low Power S0 Idle _DSM with the screen
> >> on/off functions supported, so modify the ACPI suspend-to-idle to use
> >> the Low Power S0 Idle code path for all systems supporting the
> >> ACPI_LPS0_ENTRY and ACPI_LPS0_EXIT or the ACPI_LPS0_SCREEN_OFF and
> >> ACPI_LPS0_SCREEN_ON functions in their Low Power S0 Idle _DSM.
> >>
> >> Potentially, that will cause more systems to use suspend-to-idle by
> >> default, so some future corrections may be necessary if it leads
> >> to issues, but let it remain more straightforward for now.
> >>
> >> Link: https://bugzilla.kernel.org/show_bug.cgi?id=198389
> >> Reported-by: Valentin Manea <valy@....ro>
> >> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> >> ---
> >>  drivers/acpi/sleep.c |    6 ++++--
> >>  1 file changed, 4 insertions(+), 2 deletions(-)
> >>
> >> Index: linux-pm/drivers/acpi/sleep.c
> >> ===================================================================
> >> --- linux-pm.orig/drivers/acpi/sleep.c
> >> +++ linux-pm/drivers/acpi/sleep.c
> >> @@ -707,7 +707,8 @@ static const struct acpi_device_id lps0_
> >>  #define ACPI_LPS0_ENTRY              5
> >>  #define ACPI_LPS0_EXIT               6
> >>
> >> -#define ACPI_S2IDLE_FUNC_MASK        ((1 << ACPI_LPS0_ENTRY) | (1 <<
> >> ACPI_LPS0_EXIT))
> >> +#define ACPI_LPS0_SCREEN_MASK        ((1 << ACPI_LPS0_SCREEN_OFF) | (1 <<
> >> ACPI_LPS0_SCREEN_ON))
> >> +#define ACPI_LPS0_S2I_MASK   ((1 << ACPI_LPS0_ENTRY) | (1 <<
> ACPI_LPS0_EXIT))
> >>
> >>  static acpi_handle lps0_device_handle;
> >>  static guid_t lps0_dsm_guid;
> >> @@ -910,7 +911,8 @@ static int lps0_device_attach(struct acp
> >>       if (out_obj && out_obj->type == ACPI_TYPE_BUFFER) {
> >>               char bitmask = *(char *)out_obj->buffer.pointer;
> >>
> >> -             if ((bitmask & ACPI_S2IDLE_FUNC_MASK) ==
> >> ACPI_S2IDLE_FUNC_MASK) {
> >> +             if ((bitmask & ACPI_LPS0_S2I_MASK) == ACPI_LPS0_S2I_MASK ||
> >> +                 (bitmask & ACPI_LPS0_SCREEN_MASK) ==
> >> ACPI_LPS0_SCREEN_MASK) {
> >>                       lps0_dsm_func_mask = bitmask;
> >>                       lps0_device_handle = adev->handle;
> >>                       /*
> >
> > In making this change I believe you'll need to cache the values that you found
> from the
> > function mask to test them later too.
> 
> But that's what lps0_dsm_func_mask is for if I understand you correctly.
> 
> > Here:
> > https://github.com/torvalds/linux/blob/master/drivers/acpi/sleep.c#L943
> >
> > This is because later on both ACPI_LPS0_SCREEN_OFF and ACPI_LPS0_ENTRY are
> called
> > whether or not they both exist.
> 
> No, that's not the case.
> 
> acpi_sleep_run_lps0_dsm() checks if the given function is there in the
> mask returned by function 0 and it doesn't evaluate the _DSM
> otherwise.
> 
> Thanks,
> Rafael

Thanks yes, I see this more closely now you're right.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ