From: Michael Kelley <mikelley@microsoft.com>
To: Dexuan Cui <decui@microsoft.com>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"rjw@rjwysocki.net" <rjw@rjwysocki.net>,
"lenb@kernel.org" <lenb@kernel.org>,
"robert.moore@intel.com" <robert.moore@intel.com>,
"erik.schmauss@intel.com" <erik.schmauss@intel.com>
Cc: "linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
KY Srinivasan <kys@microsoft.com>,
Stephen Hemminger <sthemmin@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Sasha Levin <Alexander.Levin@microsoft.com>,
"olaf@aepfle.de" <olaf@aepfle.de>,
"apw@canonical.com" <apw@canonical.com>,
"jasowang@redhat.com" <jasowang@redhat.com>,
vkuznets <vkuznets@redhat.com>,
"marcelo.cerri@canonical.com" <marcelo.cerri@canonical.com>
Subject: RE: [PATCH] ACPI: PM: Export the function acpi_sleep_state_supported()
Date: Fri, 14 Jun 2019 20:48:06 +0000 [thread overview]
Message-ID: <BL0PR2101MB134895BADA1D8E0FA631D532D7EE0@BL0PR2101MB1348.namprd21.prod.outlook.com> (raw)
In-Reply-To: <1560536224-35338-1-git-send-email-decui@microsoft.com>
From: Dexuan Cui <decui@microsoft.com> Sent: Friday, June 14, 2019 11:19 AM
>
> 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
It seems that sleep.c isn't built when on the ARM64 architecture. Using
acpi_sleep_state_supported() directly in hv_balloon.c will be problematic
since hv_balloon.c needs to be architecture independent when the
Hyper-V ARM64 support is added. If that doesn't change, a per-architecture
wrapper will be needed to give hv_balloon.c the correct information. This
may affect whether acpi_sleep_state_supported() needs to be exported vs.
just removing the "static". I'm not sure what the best approach is.
Michael
next prev parent reply other threads:[~2019-06-14 20:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-14 18:19 [PATCH] ACPI: PM: Export the function acpi_sleep_state_supported() Dexuan Cui
2019-06-14 20:48 ` Michael Kelley [this message]
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
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=BL0PR2101MB134895BADA1D8E0FA631D532D7EE0@BL0PR2101MB1348.namprd21.prod.outlook.com \
--to=mikelley@microsoft.com \
--cc=Alexander.Levin@microsoft.com \
--cc=apw@canonical.com \
--cc=decui@microsoft.com \
--cc=erik.schmauss@intel.com \
--cc=haiyangz@microsoft.com \
--cc=jasowang@redhat.com \
--cc=kys@microsoft.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.cerri@canonical.com \
--cc=olaf@aepfle.de \
--cc=rjw@rjwysocki.net \
--cc=robert.moore@intel.com \
--cc=sthemmin@microsoft.com \
--cc=vkuznets@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).