From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753849AbbLIWhb (ORCPT ); Wed, 9 Dec 2015 17:37:31 -0500 Received: from v094114.home.net.pl ([79.96.170.134]:60415 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753677AbbLIWh3 (ORCPT ); Wed, 9 Dec 2015 17:37:29 -0500 From: "Rafael J. Wysocki" To: Ken Xue Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, lenb@kernel.org, SPG_Linux_Kernel@amd.com, mika.westerberg@linux.intel.com, Andy Shevchenko , Ivan.Zheng@amd.com, Alex.Chuang@amd.com, tj@kernel.org, stern@rowland.harvard.edu Subject: Re: [PATCH V2] ACPI: Support D3 COLD device in old BIOS for ZPODD Date: Thu, 10 Dec 2015 00:07:27 +0100 Message-ID: <2607233.VlpZS8z9ty@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/4.1.0-rc5+; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1449649050.2175.59.camel@kxue-X58A-UD3R> References: <1449649050.2175.59.camel@kxue-X58A-UD3R> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, December 09, 2015 04:17:30 PM Ken Xue wrote: > D3cold is only regarded as valid if the "_PR3" object is > present for the given device after the commit 20dacb71ad28 > ("ACPI/PM: Rework device power management to follow ACPI 6"). > > But some old BIOS only defined "_PS3" for the D3COLD device, > such as ZPODD device. And old kernel also believes the device with > "_PS3" is a D3COLD device. > > So, add some logics for supporting D3 COLD device with old BIOS > which is compatible with earlier ACPI spec and kernel behavior. > > Reference: > http://marc.info/?l=linux-acpi&m=144946938709759&w=2 > > Signed-off-by: Ken Xue > Reported-and-tested-by: Gang Long > --- > include/acpi/acpi_bus.h | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h > index ad0a5ff..9894b75 100644 > --- a/include/acpi/acpi_bus.h > +++ b/include/acpi/acpi_bus.h > @@ -631,7 +631,9 @@ static inline bool acpi_device_can_wakeup(struct acpi_device *adev) > > static inline bool acpi_device_can_poweroff(struct acpi_device *adev) > { > - return adev->power.states[ACPI_STATE_D3_COLD].flags.valid; > + return adev->power.states[ACPI_STATE_D3_COLD].flags.valid || > + ((acpi_gbl_FADT.header.revision < 6) && > + adev->power.states[ACPI_STATE_D3_HOT].flags.explicit_set); > } > > #else /* CONFIG_ACPI */ This is fine by me, but _PS3 is allowed to remove power from the device even by ACPI 6. Queued up for 4.5, thanks! Rafael