Re: [PATCH] Default to s2idle in all machines supporting LP S0.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday, April 26, 2018 4:18:22 AM CEST Tristian Celestin wrote:
> The Dell Venue Pro 7140 supports the Low Power S0 Idle state, but does not
> support any of the _DSM functions that the current heuristic checks
> for. Since suspend-to-mem can not be safely performed on this machine,
> and since the bitfield check doesn't cover this case, it is safer
> to enable s2idle by default by checking for the presence of the _DSM
> alone and removing the bitfield check.
> ---
>  drivers/acpi/sleep.c | 22 ++++++++--------------
>  1 file changed, 8 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
> index 46cde091..57c4391 100644
> --- a/drivers/acpi/sleep.c
> +++ b/drivers/acpi/sleep.c
> @@ -707,9 +707,6 @@ static int acpi_suspend_begin_old(suspend_state_t pm_state)
>  #define ACPI_LPS0_ENTRY		5
>  #define ACPI_LPS0_EXIT		6
>  
> -#define ACPI_LPS0_SCREEN_MASK	((1 << ACPI_LPS0_SCREEN_OFF) | (1 << ACPI_LPS0_SCREEN_ON))
> -#define ACPI_LPS0_PLATFORM_MASK	((1 << ACPI_LPS0_ENTRY) | (1 << ACPI_LPS0_EXIT))
> -
>  static acpi_handle lps0_device_handle;
>  static guid_t lps0_dsm_guid;
>  static char lps0_dsm_func_mask;
> @@ -911,17 +908,14 @@ static int lps0_device_attach(struct acpi_device *adev,
>  	if (out_obj && out_obj->type == ACPI_TYPE_BUFFER) {
>  		char bitmask = *(char *)out_obj->buffer.pointer;
>  
> -		if ((bitmask & ACPI_LPS0_PLATFORM_MASK) == ACPI_LPS0_PLATFORM_MASK ||
> -		    (bitmask & ACPI_LPS0_SCREEN_MASK) == ACPI_LPS0_SCREEN_MASK) {
> -			lps0_dsm_func_mask = bitmask;
> -			lps0_device_handle = adev->handle;
> -			/*
> -			 * Use suspend-to-idle by default if the default
> -			 * suspend mode was not set from the command line.
> -			 */
> -			if (mem_sleep_default > PM_SUSPEND_MEM)
> -				mem_sleep_current = PM_SUSPEND_TO_IDLE;
> -		}
> +		lps0_dsm_func_mask = bitmask;
> +		lps0_device_handle = adev->handle;
> +		/*
> +		 * Use suspend-to-idle by default if the default
> +		 * suspend mode was not set from the command line.
> +		 */
> +		if (mem_sleep_default > PM_SUSPEND_MEM)
> +			mem_sleep_current = PM_SUSPEND_TO_IDLE;
>  
>  		acpi_handle_debug(adev->handle, "_DSM function mask: 0x%x\n",
>  				  bitmask);
> 

The patch is fine by me as it follows the clear trend that seems to
emerge, but you haven't provided a Signed-off-by tag, so I can't
apply it.

Thanks,
Rafael


--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux