linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPI: PM: Export the function acpi_sleep_state_supported()
@ 2019-06-14 18:19 Dexuan Cui
  2019-06-14 20:48 ` Michael Kelley
  0 siblings, 1 reply; 11+ messages in thread
From: Dexuan Cui @ 2019-06-14 18:19 UTC (permalink / raw)
  To: linux-acpi, rjw, lenb, robert.moore, erik.schmauss, Michael Kelley
  Cc: linux-hyperv, linux-kernel, KY Srinivasan, Stephen Hemminger,
	Haiyang Zhang, Sasha Levin, olaf, apw, jasowang, vkuznets,
	marcelo.cerri, Dexuan Cui

In a Linux VM running on Hyper-V, when ACPI S4 is enabled, the balloon
driver (drivers/hv/hv_balloon.c) needs to ask the host not to do memory
hot-add/remove.

So let's export acpi_sleep_state_supported() for the hv_balloon driver.
This might also be useful to the other drivers in the future.

Signed-off-by: Dexuan Cui <decui@microsoft.com>
---
 drivers/acpi/sleep.c    | 3 ++-
 include/acpi/acpi_bus.h | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index a34deccd7317..69755411e008 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -79,7 +79,7 @@ static int acpi_sleep_prepare(u32 acpi_state)
 	return 0;
 }
 
-static bool acpi_sleep_state_supported(u8 sleep_state)
+bool acpi_sleep_state_supported(u8 sleep_state)
 {
 	acpi_status status;
 	u8 type_a, type_b;
@@ -89,6 +89,7 @@ static bool acpi_sleep_state_supported(u8 sleep_state)
 		|| (acpi_gbl_FADT.sleep_control.address
 			&& acpi_gbl_FADT.sleep_status.address));
 }
+EXPORT_SYMBOL_GPL(acpi_sleep_state_supported);
 
 #ifdef CONFIG_ACPI_SLEEP
 static u32 acpi_target_sleep_state = ACPI_STATE_S0;
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 31b6c87d6240..5b102e7bbf25 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -651,6 +651,8 @@ static inline int acpi_pm_set_bridge_wakeup(struct device *dev, bool enable)
 }
 #endif
 
+bool acpi_sleep_state_supported(u8 sleep_state);
+
 #ifdef CONFIG_ACPI_SLEEP
 u32 acpi_target_system_state(void);
 #else
-- 
2.19.1


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

end of thread, other threads:[~2019-06-21  7:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-14 18:19 [PATCH] ACPI: PM: Export the function acpi_sleep_state_supported() Dexuan Cui
2019-06-14 20:48 ` Michael Kelley
2019-06-14 22:19   ` Dexuan Cui
2019-06-14 22:33     ` Russell King - ARM Linux admin
2019-06-14 23:34       ` Dexuan Cui
2019-06-17 13:08     ` Pavel Machek
2019-06-17 13:09     ` Pavel Machek
2019-06-17 16:14     ` Lorenzo Pieralisi
2019-06-19 19:54       ` Dexuan Cui
2019-06-20 11:30         ` Pavel Machek
2019-06-21  7:15           ` Dexuan Cui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).