public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPI/NVS: Not save NVS region for new machines to accelerate S3
@ 2014-07-18  5:55 Lan Tianyu
  2014-07-18  8:00 ` Chen, Gong
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Lan Tianyu @ 2014-07-18  5:55 UTC (permalink / raw)
  To: rjw, lenb; +Cc: Lan Tianyu, linux-acpi, linux-kernel

NVS region is saved and restored unconditionally for machines without
nvs_nosave quirk during S3. Tested some new machines and the operation
is not necessary. Saving NVS region also affects S2RAM speed. The time of
NVS saving and restoring depends on the size of NVS region and it consumes
7~10ms normally.

This patch is to make machines produced from 2012 to now not saving NVS region
to accelerate S3.

Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
---
 drivers/acpi/sleep.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index b3e3cc7..896d8be 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -322,7 +322,12 @@ static struct dmi_system_id acpisleep_dmi_table[] __initdata = {
 
 static void acpi_sleep_dmi_check(void)
 {
+	int year;
+
 	dmi_check_system(acpisleep_dmi_table);
+
+	if (dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL) && year >= 2012)
+		acpi_nvs_nosave_s3();
 }
 
 /**
-- 
1.8.4.rc0.1.g8f6a3e5.dirty


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] ACPI/NVS: Not save NVS region for new machines to accelerate S3
  2014-07-18  5:55 [PATCH] ACPI/NVS: Not save NVS region for new machines to accelerate S3 Lan Tianyu
@ 2014-07-18  8:00 ` Chen, Gong
  2014-07-21  2:14   ` Lan Tianyu
  2014-07-22 23:40 ` Rafael J. Wysocki
  2014-07-23  6:42 ` [PATCH V2] ACPI/NVS: Not save NVS region for new machine " Lan Tianyu
  2 siblings, 1 reply; 10+ messages in thread
From: Chen, Gong @ 2014-07-18  8:00 UTC (permalink / raw)
  To: Lan Tianyu; +Cc: rjw, lenb, linux-acpi, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 900 bytes --]

On Fri, Jul 18, 2014 at 01:55:22PM +0800, Lan Tianyu wrote:
> Date:	Fri, 18 Jul 2014 13:55:22 +0800
> From: Lan Tianyu <tianyu.lan@intel.com>
> To: rjw@rjwysocki.net, lenb@kernel.org
> Cc: Lan Tianyu <tianyu.lan@intel.com>, linux-acpi@vger.kernel.org,
>  linux-kernel@vger.kernel.org
> Subject: [PATCH] ACPI/NVS: Not save NVS region for new machines to
>  accelerate S3
> X-Mailer: git-send-email 1.7.9.5
> 
> NVS region is saved and restored unconditionally for machines without
> nvs_nosave quirk during S3. Tested some new machines and the operation
> is not necessary. Saving NVS region also affects S2RAM speed. The time of
> NVS saving and restoring depends on the size of NVS region and it consumes
> 7~10ms normally.
> 
> This patch is to make machines produced from 2012 to now not saving NVS region
> to accelerate S3.
> 
The year 2012 is a mandatory value in the spec?

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] ACPI/NVS: Not save NVS region for new machines to accelerate S3
  2014-07-18  8:00 ` Chen, Gong
@ 2014-07-21  2:14   ` Lan Tianyu
  2014-07-21  5:01     ` Chen, Gong
  0 siblings, 1 reply; 10+ messages in thread
From: Lan Tianyu @ 2014-07-21  2:14 UTC (permalink / raw)
  To: rjw, lenb, linux-acpi, linux-kernel, gong.chen

On 2014年07月18日 16:00, Chen, Gong wrote:
> On Fri, Jul 18, 2014 at 01:55:22PM +0800, Lan Tianyu wrote:
>> Date:	Fri, 18 Jul 2014 13:55:22 +0800
>> From: Lan Tianyu <tianyu.lan@intel.com>
>> To: rjw@rjwysocki.net, lenb@kernel.org
>> Cc: Lan Tianyu <tianyu.lan@intel.com>, linux-acpi@vger.kernel.org,
>>  linux-kernel@vger.kernel.org
>> Subject: [PATCH] ACPI/NVS: Not save NVS region for new machines to
>>  accelerate S3
>> X-Mailer: git-send-email 1.7.9.5
>>
>> NVS region is saved and restored unconditionally for machines without
>> nvs_nosave quirk during S3. Tested some new machines and the operation
>> is not necessary. Saving NVS region also affects S2RAM speed. The time of
>> NVS saving and restoring depends on the size of NVS region and it consumes
>> 7~10ms normally.
>>
>> This patch is to make machines produced from 2012 to now not saving NVS region
>> to accelerate S3.
>>
> The year 2012 is a mandatory value in the spec?
> 

No, spec indicates that this is only required for S4 and commit 2a6b697
added this behavior because this can fix S3 bug on some machines. But
this isn't necessary for all machines and waster time for S3. So this
patch is to add time base quirk to change default behavior for new machines.

-- 
Best regards
Tianyu Lan

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] ACPI/NVS: Not save NVS region for new machines to accelerate S3
  2014-07-21  2:14   ` Lan Tianyu
@ 2014-07-21  5:01     ` Chen, Gong
  2014-07-21  5:54       ` Lan Tianyu
  0 siblings, 1 reply; 10+ messages in thread
From: Chen, Gong @ 2014-07-21  5:01 UTC (permalink / raw)
  To: Lan Tianyu; +Cc: rjw, lenb, linux-acpi, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1943 bytes --]

On Mon, Jul 21, 2014 at 10:14:31AM +0800, Lan Tianyu wrote:
> Date: Mon, 21 Jul 2014 10:14:31 +0800
> From: Lan Tianyu <tianyu.lan@intel.com>
> To: rjw@rjwysocki.net, lenb@kernel.org, linux-acpi@vger.kernel.org,
>  linux-kernel@vger.kernel.org, gong.chen@linux.intel.com
> Subject: Re: [PATCH] ACPI/NVS: Not save NVS region for new machines to
>  accelerate S3
> User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:14.0) Gecko/20120714
>  Thunderbird/14.0
> 
> On 2014年07月18日 16:00, Chen, Gong wrote:
> > On Fri, Jul 18, 2014 at 01:55:22PM +0800, Lan Tianyu wrote:
> >> Date:	Fri, 18 Jul 2014 13:55:22 +0800
> >> From: Lan Tianyu <tianyu.lan@intel.com>
> >> To: rjw@rjwysocki.net, lenb@kernel.org
> >> Cc: Lan Tianyu <tianyu.lan@intel.com>, linux-acpi@vger.kernel.org,
> >>  linux-kernel@vger.kernel.org
> >> Subject: [PATCH] ACPI/NVS: Not save NVS region for new machines to
> >>  accelerate S3
> >> X-Mailer: git-send-email 1.7.9.5
> >>
> >> NVS region is saved and restored unconditionally for machines without
> >> nvs_nosave quirk during S3. Tested some new machines and the operation
> >> is not necessary. Saving NVS region also affects S2RAM speed. The time of
> >> NVS saving and restoring depends on the size of NVS region and it consumes
> >> 7~10ms normally.
> >>
> >> This patch is to make machines produced from 2012 to now not saving NVS region
> >> to accelerate S3.
> >>
> > The year 2012 is a mandatory value in the spec?
> > 
> 
> No, spec indicates that this is only required for S4 and commit 2a6b697
> added this behavior because this can fix S3 bug on some machines. But
> this isn't necessary for all machines and waster time for S3. So this
> patch is to add time base quirk to change default behavior for new machines.
> 
If so, I don't think a hard-coded valud in the kernel is a good idea.
Why not providing a quirk via a command line parameter or module parameter.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] ACPI/NVS: Not save NVS region for new machines to accelerate S3
  2014-07-21  5:01     ` Chen, Gong
@ 2014-07-21  5:54       ` Lan Tianyu
  2014-07-21  6:25         ` Chen, Gong
  0 siblings, 1 reply; 10+ messages in thread
From: Lan Tianyu @ 2014-07-21  5:54 UTC (permalink / raw)
  To: rjw, lenb, linux-acpi, linux-kernel, gong.chen

On 2014年07月21日 13:01, Chen, Gong wrote:
> On Mon, Jul 21, 2014 at 10:14:31AM +0800, Lan Tianyu wrote:
>> Date: Mon, 21 Jul 2014 10:14:31 +0800
>> From: Lan Tianyu <tianyu.lan@intel.com>
>> To: rjw@rjwysocki.net, lenb@kernel.org, linux-acpi@vger.kernel.org,
>>  linux-kernel@vger.kernel.org, gong.chen@linux.intel.com
>> Subject: Re: [PATCH] ACPI/NVS: Not save NVS region for new machines to
>>  accelerate S3
>> User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:14.0) Gecko/20120714
>>  Thunderbird/14.0
>>
>> On 2014年07月18日 16:00, Chen, Gong wrote:
>>> On Fri, Jul 18, 2014 at 01:55:22PM +0800, Lan Tianyu wrote:
>>>> Date:	Fri, 18 Jul 2014 13:55:22 +0800
>>>> From: Lan Tianyu <tianyu.lan@intel.com>
>>>> To: rjw@rjwysocki.net, lenb@kernel.org
>>>> Cc: Lan Tianyu <tianyu.lan@intel.com>, linux-acpi@vger.kernel.org,
>>>>  linux-kernel@vger.kernel.org
>>>> Subject: [PATCH] ACPI/NVS: Not save NVS region for new machines to
>>>>  accelerate S3
>>>> X-Mailer: git-send-email 1.7.9.5
>>>>
>>>> NVS region is saved and restored unconditionally for machines without
>>>> nvs_nosave quirk during S3. Tested some new machines and the operation
>>>> is not necessary. Saving NVS region also affects S2RAM speed. The time of
>>>> NVS saving and restoring depends on the size of NVS region and it consumes
>>>> 7~10ms normally.
>>>>
>>>> This patch is to make machines produced from 2012 to now not saving NVS region
>>>> to accelerate S3.
>>>>
>>> The year 2012 is a mandatory value in the spec?
>>>
>>
>> No, spec indicates that this is only required for S4 and commit 2a6b697
>> added this behavior because this can fix S3 bug on some machines. But
>> this isn't necessary for all machines and waster time for S3. So this
>> patch is to add time base quirk to change default behavior for new machines.
>>
> If so, I don't think a hard-coded valud in the kernel is a good idea.
> Why not providing a quirk via a command line parameter or module parameter.
> 

There is already a kernel command "acpi_sleep=nonvs_s3" to do that. But
this needs to be set by user. Otherwise, saving/restoring NVS region
also breaks system suspend on some machines and we have added 14
nonvs quirks in the acpisleep_dmi_table.

>From the spec side, it's not necessary and the default behavior should
follow spec. For some special machines which need saving/restoring NVS
region to workaround system suspend, it should be dealt with quirk and
do it when necessary. To avoid regressions on the old machines, the
change only applies to new machines. Other side, not saving/restoring
NVS is also helpful to accelerate S3.

-- 
Best regards
Tianyu Lan

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] ACPI/NVS: Not save NVS region for new machines to accelerate S3
  2014-07-21  5:54       ` Lan Tianyu
@ 2014-07-21  6:25         ` Chen, Gong
  2014-07-21  7:37           ` Lan Tianyu
  0 siblings, 1 reply; 10+ messages in thread
From: Chen, Gong @ 2014-07-21  6:25 UTC (permalink / raw)
  To: Lan Tianyu; +Cc: rjw, lenb, linux-acpi, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 3005 bytes --]

On Mon, Jul 21, 2014 at 01:54:56PM +0800, Lan Tianyu wrote:
> Date: Mon, 21 Jul 2014 13:54:56 +0800
> From: Lan Tianyu <tianyu.lan@intel.com>
> To: rjw@rjwysocki.net, lenb@kernel.org, linux-acpi@vger.kernel.org,
>  linux-kernel@vger.kernel.org, gong.chen@linux.intel.com
> Subject: Re: [PATCH] ACPI/NVS: Not save NVS region for new machines to
>  accelerate S3
> User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:14.0) Gecko/20120714
>  Thunderbird/14.0
> 
> On 2014年07月21日 13:01, Chen, Gong wrote:
> > On Mon, Jul 21, 2014 at 10:14:31AM +0800, Lan Tianyu wrote:
> >> Date: Mon, 21 Jul 2014 10:14:31 +0800
> >> From: Lan Tianyu <tianyu.lan@intel.com>
> >> To: rjw@rjwysocki.net, lenb@kernel.org, linux-acpi@vger.kernel.org,
> >>  linux-kernel@vger.kernel.org, gong.chen@linux.intel.com
> >> Subject: Re: [PATCH] ACPI/NVS: Not save NVS region for new machines to
> >>  accelerate S3
> >> User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:14.0) Gecko/20120714
> >>  Thunderbird/14.0
> >>
> >> On 2014年07月18日 16:00, Chen, Gong wrote:
> >>> On Fri, Jul 18, 2014 at 01:55:22PM +0800, Lan Tianyu wrote:
> >>>> Date:	Fri, 18 Jul 2014 13:55:22 +0800
> >>>> From: Lan Tianyu <tianyu.lan@intel.com>
> >>>> To: rjw@rjwysocki.net, lenb@kernel.org
> >>>> Cc: Lan Tianyu <tianyu.lan@intel.com>, linux-acpi@vger.kernel.org,
> >>>>  linux-kernel@vger.kernel.org
> >>>> Subject: [PATCH] ACPI/NVS: Not save NVS region for new machines to
> >>>>  accelerate S3
> >>>> X-Mailer: git-send-email 1.7.9.5
> >>>>
> >>>> NVS region is saved and restored unconditionally for machines without
> >>>> nvs_nosave quirk during S3. Tested some new machines and the operation
> >>>> is not necessary. Saving NVS region also affects S2RAM speed. The time of
> >>>> NVS saving and restoring depends on the size of NVS region and it consumes
> >>>> 7~10ms normally.
> >>>>
> >>>> This patch is to make machines produced from 2012 to now not saving NVS region
> >>>> to accelerate S3.
> >>>>
> >>> The year 2012 is a mandatory value in the spec?
> >>>
> >>
> >> No, spec indicates that this is only required for S4 and commit 2a6b697
> >> added this behavior because this can fix S3 bug on some machines. But
> >> this isn't necessary for all machines and waster time for S3. So this
> >> patch is to add time base quirk to change default behavior for new machines.
> >>
> > If so, I don't think a hard-coded valud in the kernel is a good idea.
> > Why not providing a quirk via a command line parameter or module parameter.
> > 
> 
> There is already a kernel command "acpi_sleep=nonvs_s3" to do that. But
> this needs to be set by user. Otherwise, saving/restoring NVS region
> also breaks system suspend on some machines and we have added 14
> nonvs quirks in the acpisleep_dmi_table.
> 
14 quriks! What a terrible BIOS, isn't it? It's time to cleanup so
many hacks. I'm not ACPI expert, but such yet another hack is not
acceptable from my point of view.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] ACPI/NVS: Not save NVS region for new machines to accelerate S3
  2014-07-21  6:25         ` Chen, Gong
@ 2014-07-21  7:37           ` Lan Tianyu
  0 siblings, 0 replies; 10+ messages in thread
From: Lan Tianyu @ 2014-07-21  7:37 UTC (permalink / raw)
  To: rjw, lenb, linux-acpi, linux-kernel, gong.chen

On 2014年07月21日 14:25, Chen, Gong wrote:
> On Mon, Jul 21, 2014 at 01:54:56PM +0800, Lan Tianyu wrote:
>> Date: Mon, 21 Jul 2014 13:54:56 +0800
>> From: Lan Tianyu <tianyu.lan@intel.com>
>> To: rjw@rjwysocki.net, lenb@kernel.org, linux-acpi@vger.kernel.org,
>>  linux-kernel@vger.kernel.org, gong.chen@linux.intel.com
>> Subject: Re: [PATCH] ACPI/NVS: Not save NVS region for new machines to
>>  accelerate S3
>> User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:14.0) Gecko/20120714
>>  Thunderbird/14.0
>>
>> On 2014年07月21日 13:01, Chen, Gong wrote:
>>> On Mon, Jul 21, 2014 at 10:14:31AM +0800, Lan Tianyu wrote:
>>>> Date: Mon, 21 Jul 2014 10:14:31 +0800
>>>> From: Lan Tianyu <tianyu.lan@intel.com>
>>>> To: rjw@rjwysocki.net, lenb@kernel.org, linux-acpi@vger.kernel.org,
>>>>  linux-kernel@vger.kernel.org, gong.chen@linux.intel.com
>>>> Subject: Re: [PATCH] ACPI/NVS: Not save NVS region for new machines to
>>>>  accelerate S3
>>>> User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:14.0) Gecko/20120714
>>>>  Thunderbird/14.0
>>>>
>>>> On 2014年07月18日 16:00, Chen, Gong wrote:
>>>>> On Fri, Jul 18, 2014 at 01:55:22PM +0800, Lan Tianyu wrote:
>>>>>> Date:	Fri, 18 Jul 2014 13:55:22 +0800
>>>>>> From: Lan Tianyu <tianyu.lan@intel.com>
>>>>>> To: rjw@rjwysocki.net, lenb@kernel.org
>>>>>> Cc: Lan Tianyu <tianyu.lan@intel.com>, linux-acpi@vger.kernel.org,
>>>>>>  linux-kernel@vger.kernel.org
>>>>>> Subject: [PATCH] ACPI/NVS: Not save NVS region for new machines to
>>>>>>  accelerate S3
>>>>>> X-Mailer: git-send-email 1.7.9.5
>>>>>>
>>>>>> NVS region is saved and restored unconditionally for machines without
>>>>>> nvs_nosave quirk during S3. Tested some new machines and the operation
>>>>>> is not necessary. Saving NVS region also affects S2RAM speed. The time of
>>>>>> NVS saving and restoring depends on the size of NVS region and it consumes
>>>>>> 7~10ms normally.
>>>>>>
>>>>>> This patch is to make machines produced from 2012 to now not saving NVS region
>>>>>> to accelerate S3.
>>>>>>
>>>>> The year 2012 is a mandatory value in the spec?
>>>>>
>>>>
>>>> No, spec indicates that this is only required for S4 and commit 2a6b697
>>>> added this behavior because this can fix S3 bug on some machines. But
>>>> this isn't necessary for all machines and waster time for S3. So this
>>>> patch is to add time base quirk to change default behavior for new machines.
>>>>
>>> If so, I don't think a hard-coded valud in the kernel is a good idea.
>>> Why not providing a quirk via a command line parameter or module parameter.
>>>
>>
>> There is already a kernel command "acpi_sleep=nonvs_s3" to do that. But
>> this needs to be set by user. Otherwise, saving/restoring NVS region
>> also breaks system suspend on some machines and we have added 14
>> nonvs quirks in the acpisleep_dmi_table.
>>
> 14 quriks! What a terrible BIOS, isn't it? It's time to cleanup so
> many hacks.

If change the default behavior for old machines, that may cause some
regressions and need to add new quirks to save/restore nvs region again.

> I'm not ACPI expert, but such yet another hack is not
> acceptable from my point of view.
> 


-- 
Best regards
Tianyu Lan

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] ACPI/NVS: Not save NVS region for new machines to accelerate S3
  2014-07-18  5:55 [PATCH] ACPI/NVS: Not save NVS region for new machines to accelerate S3 Lan Tianyu
  2014-07-18  8:00 ` Chen, Gong
@ 2014-07-22 23:40 ` Rafael J. Wysocki
  2014-07-23  5:35   ` Lan Tianyu
  2014-07-23  6:42 ` [PATCH V2] ACPI/NVS: Not save NVS region for new machine " Lan Tianyu
  2 siblings, 1 reply; 10+ messages in thread
From: Rafael J. Wysocki @ 2014-07-22 23:40 UTC (permalink / raw)
  To: Lan Tianyu; +Cc: lenb, linux-acpi, linux-kernel

On Friday, July 18, 2014 01:55:22 PM Lan Tianyu wrote:
> NVS region is saved and restored unconditionally for machines without
> nvs_nosave quirk during S3. Tested some new machines and the operation
> is not necessary. Saving NVS region also affects S2RAM speed. The time of
> NVS saving and restoring depends on the size of NVS region and it consumes
> 7~10ms normally.
> 
> This patch is to make machines produced from 2012 to now not saving NVS region
> to accelerate S3.
> 
> Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
> ---
>  drivers/acpi/sleep.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
> index b3e3cc7..896d8be 100644
> --- a/drivers/acpi/sleep.c
> +++ b/drivers/acpi/sleep.c
> @@ -322,7 +322,12 @@ static struct dmi_system_id acpisleep_dmi_table[] __initdata = {
>  
>  static void acpi_sleep_dmi_check(void)
>  {
> +	int year;
> +
>  	dmi_check_system(acpisleep_dmi_table);
> +
> +	if (dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL) && year >= 2012)
> +		acpi_nvs_nosave_s3();

I'd prefer the ordering here to be different so that individual quirks
could be used to change the date-based wholesale behavior.

>  }
>  
>  /**
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] ACPI/NVS: Not save NVS region for new machines to accelerate S3
  2014-07-22 23:40 ` Rafael J. Wysocki
@ 2014-07-23  5:35   ` Lan Tianyu
  0 siblings, 0 replies; 10+ messages in thread
From: Lan Tianyu @ 2014-07-23  5:35 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: lenb, linux-acpi, linux-kernel

On 2014年07月23日 07:40, Rafael J. Wysocki wrote:
> On Friday, July 18, 2014 01:55:22 PM Lan Tianyu wrote:
>> NVS region is saved and restored unconditionally for machines without
>> nvs_nosave quirk during S3. Tested some new machines and the operation
>> is not necessary. Saving NVS region also affects S2RAM speed. The time of
>> NVS saving and restoring depends on the size of NVS region and it consumes
>> 7~10ms normally.
>>
>> This patch is to make machines produced from 2012 to now not saving NVS region
>> to accelerate S3.
>>
>> Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
>> ---
>>  drivers/acpi/sleep.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
>> index b3e3cc7..896d8be 100644
>> --- a/drivers/acpi/sleep.c
>> +++ b/drivers/acpi/sleep.c
>> @@ -322,7 +322,12 @@ static struct dmi_system_id acpisleep_dmi_table[] __initdata = {
>>  
>>  static void acpi_sleep_dmi_check(void)
>>  {
>> +	int year;
>> +
>>  	dmi_check_system(acpisleep_dmi_table);
>> +
>> +	if (dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL) && year >= 2012)
>> +		acpi_nvs_nosave_s3();
> 
> I'd prefer the ordering here to be different so that individual quirks
> could be used to change the date-based wholesale behavior.

Ok. I will update soon.

> 
>>  }
>>  
>>  /**
>>
> 


-- 
Best regards
Tianyu Lan

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH V2] ACPI/NVS: Not save NVS region for new machine to accelerate S3
  2014-07-18  5:55 [PATCH] ACPI/NVS: Not save NVS region for new machines to accelerate S3 Lan Tianyu
  2014-07-18  8:00 ` Chen, Gong
  2014-07-22 23:40 ` Rafael J. Wysocki
@ 2014-07-23  6:42 ` Lan Tianyu
  2 siblings, 0 replies; 10+ messages in thread
From: Lan Tianyu @ 2014-07-23  6:42 UTC (permalink / raw)
  To: rjw, lenb; +Cc: Lan Tianyu, linux-acpi, linux-kernel

NVS region is saved and restored unconditionally for machines without
nvs_nosave quirk during S3. Tested some new machines and the operation
is not necessary. Saving NVS region also affects S2RAM speed. The time of
NVS saving and restoring depends on the size of NVS region and it consumes
7~10ms normally.

This patch is to make machines produced from 2012 to now not saving NVS region
to accelerate S3.

Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
---
Change since V1:
	Change the order between checking acpisleep quirk table and setting
the flag of nosaving nvs for S3.

 drivers/acpi/sleep.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index b3e3cc7..54da4a3 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -322,6 +322,11 @@ static struct dmi_system_id acpisleep_dmi_table[] __initdata = {
 
 static void acpi_sleep_dmi_check(void)
 {
+	int year;
+
+	if (dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL) && year >= 2012)
+		acpi_nvs_nosave_s3();
+
 	dmi_check_system(acpisleep_dmi_table);
 }
 
-- 
1.8.4.rc0.1.g8f6a3e5.dirty


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-07-23  6:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-18  5:55 [PATCH] ACPI/NVS: Not save NVS region for new machines to accelerate S3 Lan Tianyu
2014-07-18  8:00 ` Chen, Gong
2014-07-21  2:14   ` Lan Tianyu
2014-07-21  5:01     ` Chen, Gong
2014-07-21  5:54       ` Lan Tianyu
2014-07-21  6:25         ` Chen, Gong
2014-07-21  7:37           ` Lan Tianyu
2014-07-22 23:40 ` Rafael J. Wysocki
2014-07-23  5:35   ` Lan Tianyu
2014-07-23  6:42 ` [PATCH V2] ACPI/NVS: Not save NVS region for new machine " Lan Tianyu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox