public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Li, Aubrey" <aubrey.li@linux.intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
	Len.Brown@intel.com,
	"alan@linux.intel.com" <alan@linux.intel.com>,
	"Raj, Ashok" <ashok.raj@intel.com>
Subject: Re: [PATCH] ACPI/Sleep: pm_power_off need more sanity check to be installed
Date: Sat, 01 Mar 2014 06:24:23 +0800	[thread overview]
Message-ID: <53110C97.3040207@linux.intel.com> (raw)
In-Reply-To: <53101FAB.3080609@linux.intel.com>

On 2014/2/28 13:33, Li, Aubrey wrote:
> On 2014/2/27 7:50, Rafael J. Wysocki wrote:
>> On Wednesday, February 26, 2014 10:46:37 AM Li, Aubrey wrote:
>>> Sleep control and status registers need santity check before ACPI
>>> install acpi_power_off to pm_power_off hook. The checking code in
>>> acpi_enter_sleep_state() is too late, we should not allow a not-working
>>> pm_power_off function hooked.
>>>
>>> Signed-off-by: Aubrey Li <aubrey.li@intel.com>
>>> ---
>>>  drivers/acpi/sleep.c |    7 +++++--
>>>  1 file changed, 5 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
>>> index b718806..0284d22 100644
>>> --- a/drivers/acpi/sleep.c
>>> +++ b/drivers/acpi/sleep.c
>>> @@ -809,8 +809,11 @@ int __init acpi_sleep_init(void)
>>>  	status = acpi_get_sleep_type_data(ACPI_STATE_S5, &type_a, &type_b);
>>>  	if (ACPI_SUCCESS(status)) {
>>>  		sleep_states[ACPI_STATE_S5] = 1;
>>
>> Do we still want to set this if the check below fails?  If so, then why?
> 
> We know \_S5_ is valid. The fault is sleep registers, not S5 ACPI object

Hi Rafael, do you still have any concern?

Thanks,
-Aubrey
> 
>>
>>> -		pm_power_off_prepare = acpi_power_off_prepare;
>>> -		pm_power_off = acpi_power_off;
>>> +		if (acpi_gbl_FADT.sleep_control.address &&
>>> +			acpi_gbl_FADT.sleep_status.address) {
>>> +			pm_power_off_prepare = acpi_power_off_prepare;
>>> +			pm_power_off = acpi_power_off;
>>> +		}
>>>  	}
>>>
>>>  	supported[0] = 0;
>>>
>>
> 


  reply	other threads:[~2014-02-28 22:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-26  2:46 [PATCH] ACPI/Sleep: pm_power_off need more sanity check to be installed Li, Aubrey
2014-02-26 23:50 ` Rafael J. Wysocki
2014-02-28  5:33   ` Li, Aubrey
2014-02-28 22:24     ` Li, Aubrey [this message]
2014-03-02  0:39       ` Rafael J. Wysocki
2014-03-02  0:53         ` Li, Aubrey
2014-03-02 23:38           ` 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=53110C97.3040207@linux.intel.com \
    --to=aubrey.li@linux.intel.com \
    --cc=Len.Brown@intel.com \
    --cc=alan@linux.intel.com \
    --cc=ashok.raj@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox