* [PATCH] rtc: x86: amd-pmc: fix build failure with CONFIG_RTC_SYSTOHC=n
@ 2021-10-26 14:12 Arnd Bergmann
2021-10-26 17:16 ` Limonciello, Mario
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2021-10-26 14:12 UTC (permalink / raw)
To: linux-rtc, Alexandre Belloni, Shyam Sundar S K, Hans de Goede,
Mark Gross, Mario Limonciello
Cc: Arnd Bergmann, Sanket Goswami, Sachi King, platform-driver-x86,
linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
The newly added logic to set the RTC during suspend from
platform specific code fails with a link error here:
drivers/platform/x86/amd-pmc.c:428:30: error: use of undeclared identifier 'CONFIG_RTC_SYSTOHC_DEVICE'
Add an #ifdef so this is only done if the functionality
is enabled.
Fixes: 59348401ebed ("platform/x86: amd-pmc: Add special handling for timer based S0i3 wakeup")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/platform/x86/amd-pmc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/platform/x86/amd-pmc.c b/drivers/platform/x86/amd-pmc.c
index 678bf6874c63..8bd5de4d9d3a 100644
--- a/drivers/platform/x86/amd-pmc.c
+++ b/drivers/platform/x86/amd-pmc.c
@@ -414,6 +414,7 @@ static int amd_pmc_get_os_hint(struct amd_pmc_dev *dev)
return -EINVAL;
}
+#ifdef CONFIG_RTC_SYSTOHC
static int amd_pmc_verify_czn_rtc(struct amd_pmc_dev *pdev, u32 *arg)
{
struct rtc_device *rtc_device;
@@ -461,6 +462,7 @@ static int amd_pmc_verify_czn_rtc(struct amd_pmc_dev *pdev, u32 *arg)
return rc;
}
+#endif
static int __maybe_unused amd_pmc_suspend(struct device *dev)
{
@@ -473,12 +475,14 @@ static int __maybe_unused amd_pmc_suspend(struct device *dev)
amd_pmc_send_cmd(pdev, 0, NULL, SMU_MSG_LOG_RESET, 0);
amd_pmc_send_cmd(pdev, 0, NULL, SMU_MSG_LOG_START, 0);
+#ifdef CONFIG_RTC_SYSTOHC
/* Activate CZN specific RTC functionality */
if (pdev->cpu_id == AMD_CPU_ID_CZN) {
rc = amd_pmc_verify_czn_rtc(pdev, &arg);
if (rc < 0)
return rc;
}
+#endif
/* Dump the IdleMask before we send hint to SMU */
amd_pmc_idlemask_read(pdev, dev, NULL);
--
2.29.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* RE: [PATCH] rtc: x86: amd-pmc: fix build failure with CONFIG_RTC_SYSTOHC=n
2021-10-26 14:12 [PATCH] rtc: x86: amd-pmc: fix build failure with CONFIG_RTC_SYSTOHC=n Arnd Bergmann
@ 2021-10-26 17:16 ` Limonciello, Mario
0 siblings, 0 replies; 2+ messages in thread
From: Limonciello, Mario @ 2021-10-26 17:16 UTC (permalink / raw)
To: Arnd Bergmann, linux-rtc@vger.kernel.org, Alexandre Belloni,
S-k, Shyam-sundar, Hans de Goede, Mark Gross
Cc: Arnd Bergmann, Goswami, Sanket, Sachi King,
platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org
[Public]
> -----Original Message-----
> From: Arnd Bergmann <arnd@kernel.org>
> Sent: Tuesday, October 26, 2021 09:12
> To: linux-rtc@vger.kernel.org; Alexandre Belloni
> <alexandre.belloni@bootlin.com>; S-k, Shyam-sundar <Shyam-sundar.S-
> k@amd.com>; Hans de Goede <hdegoede@redhat.com>; Mark Gross
> <markgross@kernel.org>; Limonciello, Mario <Mario.Limonciello@amd.com>
> Cc: Arnd Bergmann <arnd@arndb.de>; Goswami, Sanket
> <Sanket.Goswami@amd.com>; Sachi King <nakato@nakato.io>; platform-
> driver-x86@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] rtc: x86: amd-pmc: fix build failure with
> CONFIG_RTC_SYSTOHC=n
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> The newly added logic to set the RTC during suspend from
> platform specific code fails with a link error here:
>
> drivers/platform/x86/amd-pmc.c:428:30: error: use of undeclared identifier
> 'CONFIG_RTC_SYSTOHC_DEVICE'
>
> Add an #ifdef so this is only done if the functionality
> is enabled.
>
> Fixes: 59348401ebed ("platform/x86: amd-pmc: Add special handling for timer
> based S0i3 wakeup")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Hey Arnd,
Thanks for the patch. We had discussed this a bit already and there are 2 other ideas
out on the list already that also solve it.
> ---
> drivers/platform/x86/amd-pmc.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/platform/x86/amd-pmc.c b/drivers/platform/x86/amd-pmc.c
> index 678bf6874c63..8bd5de4d9d3a 100644
> --- a/drivers/platform/x86/amd-pmc.c
> +++ b/drivers/platform/x86/amd-pmc.c
> @@ -414,6 +414,7 @@ static int amd_pmc_get_os_hint(struct amd_pmc_dev
> *dev)
> return -EINVAL;
> }
>
> +#ifdef CONFIG_RTC_SYSTOHC
> static int amd_pmc_verify_czn_rtc(struct amd_pmc_dev *pdev, u32 *arg)
> {
> struct rtc_device *rtc_device;
> @@ -461,6 +462,7 @@ static int amd_pmc_verify_czn_rtc(struct amd_pmc_dev
> *pdev, u32 *arg)
>
> return rc;
> }
> +#endif
>
> static int __maybe_unused amd_pmc_suspend(struct device *dev)
> {
> @@ -473,12 +475,14 @@ static int __maybe_unused amd_pmc_suspend(struct
> device *dev)
> amd_pmc_send_cmd(pdev, 0, NULL, SMU_MSG_LOG_RESET, 0);
> amd_pmc_send_cmd(pdev, 0, NULL, SMU_MSG_LOG_START, 0);
>
> +#ifdef CONFIG_RTC_SYSTOHC
> /* Activate CZN specific RTC functionality */
> if (pdev->cpu_id == AMD_CPU_ID_CZN) {
> rc = amd_pmc_verify_czn_rtc(pdev, &arg);
> if (rc < 0)
> return rc;
> }
> +#endif
>
> /* Dump the IdleMask before we send hint to SMU */
> amd_pmc_idlemask_read(pdev, dev, NULL);
> --
> 2.29.2
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-26 17:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-26 14:12 [PATCH] rtc: x86: amd-pmc: fix build failure with CONFIG_RTC_SYSTOHC=n Arnd Bergmann
2021-10-26 17:16 ` Limonciello, Mario
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox