All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] ACPI: Support D3 COLD device in old BIOS for ZPODD
@ 2015-12-09  8:17 ` Ken Xue
  0 siblings, 0 replies; 3+ messages in thread
From: Ken Xue @ 2015-12-09  8:17 UTC (permalink / raw)
  To: linux-acpi, linux-kernel, rjw
  Cc: lenb, SPG_Linux_Kernel, mika.westerberg, Andy Shevchenko,
	Ivan.Zheng, Alex.Chuang, tj, stern

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 <Ken.Xue@amd.com>
Reported-and-tested-by: Gang Long <Gang.Long@amd.com>
---
 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 */
-- 
1.9.1




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

* [PATCH V2] ACPI: Support D3 COLD device in old BIOS for ZPODD
@ 2015-12-09  8:17 ` Ken Xue
  0 siblings, 0 replies; 3+ messages in thread
From: Ken Xue @ 2015-12-09  8:17 UTC (permalink / raw)
  To: linux-acpi, linux-kernel, rjw
  Cc: lenb, SPG_Linux_Kernel, mika.westerberg, Andy Shevchenko,
	Ivan.Zheng, Alex.Chuang, tj, stern

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 <Ken.Xue@amd.com>
Reported-and-tested-by: Gang Long <Gang.Long@amd.com>
---
 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 */
-- 
1.9.1




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

* Re: [PATCH V2] ACPI: Support D3 COLD device in old BIOS for ZPODD
  2015-12-09  8:17 ` Ken Xue
  (?)
@ 2015-12-09 23:07 ` Rafael J. Wysocki
  -1 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2015-12-09 23:07 UTC (permalink / raw)
  To: Ken Xue
  Cc: linux-acpi, linux-kernel, lenb, SPG_Linux_Kernel,
	mika.westerberg, Andy Shevchenko, Ivan.Zheng, Alex.Chuang, tj,
	stern

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 <Ken.Xue@amd.com>
> Reported-and-tested-by: Gang Long <Gang.Long@amd.com>
> ---
>  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


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

end of thread, other threads:[~2015-12-09 22:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-09  8:17 [PATCH V2] ACPI: Support D3 COLD device in old BIOS for ZPODD Ken Xue
2015-12-09  8:17 ` Ken Xue
2015-12-09 23:07 ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.