* [PATCH] platform/x86:intel/pmc: fix build regression with pmtimer turned off
@ 2024-09-09 11:16 Arnd Bergmann
2024-09-09 11:36 ` Hans de Goede
0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2024-09-09 11:16 UTC (permalink / raw)
To: Rajneesh Bhardwaj, David E Box
Cc: Arnd Bergmann, Hans de Goede, Ilpo Järvinen, Xi Pardee,
Rajvi Jingar, David E. Box, Kane Chen, Marek Maslanka, Tony Luck,
Daniel Lezcano, platform-driver-x86, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
The acpi_pmtmr_{un,}register_suspend_resume_callback() declarations
got added into an #ifdef section without an alternative inline
stub, which now causes a build failure:
drivers/platform/x86/intel/pmc/core.c: In function 'pmc_core_probe':
drivers/platform/x86/intel/pmc/core.c:1507:17: error: implicit declaration of function 'acpi_pmtmr_register_suspend_resume_callback' [-Wimplicit-function-declaration]
1507 | acpi_pmtmr_register_suspend_resume_callback(pmc_core_acpi_pm_timer_suspend_resume,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/platform/x86/intel/pmc/core.c: In function 'pmc_core_remove':
drivers/platform/x86/intel/pmc/core.c:1523:17: error: implicit declaration of function 'acpi_pmtmr_unregister_suspend_resume_callback' [-Wimplicit-function-declaration]
1523 | acpi_pmtmr_unregister_suspend_resume_callback();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Remove the unnecessary #ifdef and use IS_ENABLED() checks in the
respective callers.
Fixes: e774696b1f95 ("platform/x86:intel/pmc: Enable the ACPI PM Timer to be turned off when suspended")
Fixes: fe323dcb12fd ("clocksource: acpi_pm: Add external callback for suspend/resume")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/platform/x86/intel/pmc/core.c | 6 ++++--
include/linux/acpi_pmtmr.h | 13 +------------
2 files changed, 5 insertions(+), 14 deletions(-)
diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c
index 695804ca8de4..bbe90b1f56e2 100644
--- a/drivers/platform/x86/intel/pmc/core.c
+++ b/drivers/platform/x86/intel/pmc/core.c
@@ -1503,7 +1503,8 @@ static int pmc_core_probe(struct platform_device *pdev)
pmc_core_adjust_slp_s0_step(primary_pmc, 1));
map = primary_pmc->map;
- if (map->acpi_pm_tmr_ctl_offset)
+ if (IS_ENABLED(CONFIG_CONFIG_X86_PM_TIMER) &&
+ map->acpi_pm_tmr_ctl_offset)
acpi_pmtmr_register_suspend_resume_callback(pmc_core_acpi_pm_timer_suspend_resume,
pmcdev);
@@ -1519,7 +1520,8 @@ static void pmc_core_remove(struct platform_device *pdev)
const struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN];
const struct pmc_reg_map *map = pmc->map;
- if (map->acpi_pm_tmr_ctl_offset)
+ if (IS_ENABLED(CONFIG_CONFIG_X86_PM_TIMER) &&
+ map->acpi_pm_tmr_ctl_offset)
acpi_pmtmr_unregister_suspend_resume_callback();
pmc_core_dbgfs_unregister(pmcdev);
diff --git a/include/linux/acpi_pmtmr.h b/include/linux/acpi_pmtmr.h
index 0ded9220d379..0846f90ce179 100644
--- a/include/linux/acpi_pmtmr.h
+++ b/include/linux/acpi_pmtmr.h
@@ -13,14 +13,12 @@
/* Overrun value */
#define ACPI_PM_OVRRUN (1<<24)
-#ifdef CONFIG_X86_PM_TIMER
-
extern u32 acpi_pm_read_verified(void);
extern u32 pmtmr_ioport;
static inline u32 acpi_pm_read_early(void)
{
- if (!pmtmr_ioport)
+ if (!IS_ENABLED(CONFIG_X86_PM_TIMER) || !pmtmr_ioport)
return 0;
/* mask the output to 24 bits */
return acpi_pm_read_verified() & ACPI_PM_MASK;
@@ -39,14 +37,5 @@ void acpi_pmtmr_register_suspend_resume_callback(void (*cb)(void *data, bool sus
*/
void acpi_pmtmr_unregister_suspend_resume_callback(void);
-#else
-
-static inline u32 acpi_pm_read_early(void)
-{
- return 0;
-}
-
-#endif
-
#endif
--
2.39.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] platform/x86:intel/pmc: fix build regression with pmtimer turned off
2024-09-09 11:16 [PATCH] platform/x86:intel/pmc: fix build regression with pmtimer turned off Arnd Bergmann
@ 2024-09-09 11:36 ` Hans de Goede
2024-09-09 13:36 ` Daniel Lezcano
0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2024-09-09 11:36 UTC (permalink / raw)
To: Arnd Bergmann, Rajneesh Bhardwaj, David E Box
Cc: Arnd Bergmann, Ilpo Järvinen, Xi Pardee, Rajvi Jingar,
David E. Box, Kane Chen, Marek Maslanka, Tony Luck,
Daniel Lezcano, platform-driver-x86, linux-kernel
Hi,
On 9/9/24 1:16 PM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The acpi_pmtmr_{un,}register_suspend_resume_callback() declarations
> got added into an #ifdef section without an alternative inline
> stub, which now causes a build failure:
>
> drivers/platform/x86/intel/pmc/core.c: In function 'pmc_core_probe':
> drivers/platform/x86/intel/pmc/core.c:1507:17: error: implicit declaration of function 'acpi_pmtmr_register_suspend_resume_callback' [-Wimplicit-function-declaration]
> 1507 | acpi_pmtmr_register_suspend_resume_callback(pmc_core_acpi_pm_timer_suspend_resume,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/platform/x86/intel/pmc/core.c: In function 'pmc_core_remove':
> drivers/platform/x86/intel/pmc/core.c:1523:17: error: implicit declaration of function 'acpi_pmtmr_unregister_suspend_resume_callback' [-Wimplicit-function-declaration]
> 1523 | acpi_pmtmr_unregister_suspend_resume_callback();
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Remove the unnecessary #ifdef and use IS_ENABLED() checks in the
> respective callers.
>
> Fixes: e774696b1f95 ("platform/x86:intel/pmc: Enable the ACPI PM Timer to be turned off when suspended")
> Fixes: fe323dcb12fd ("clocksource: acpi_pm: Add external callback for suspend/resume")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/platform/x86/intel/pmc/core.c | 6 ++++--
> include/linux/acpi_pmtmr.h | 13 +------------
> 2 files changed, 5 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c
> index 695804ca8de4..bbe90b1f56e2 100644
> --- a/drivers/platform/x86/intel/pmc/core.c
> +++ b/drivers/platform/x86/intel/pmc/core.c
> @@ -1503,7 +1503,8 @@ static int pmc_core_probe(struct platform_device *pdev)
> pmc_core_adjust_slp_s0_step(primary_pmc, 1));
>
> map = primary_pmc->map;
> - if (map->acpi_pm_tmr_ctl_offset)
> + if (IS_ENABLED(CONFIG_CONFIG_X86_PM_TIMER) &&
> + map->acpi_pm_tmr_ctl_offset)
> acpi_pmtmr_register_suspend_resume_callback(pmc_core_acpi_pm_timer_suspend_resume,
> pmcdev);
>
> @@ -1519,7 +1520,8 @@ static void pmc_core_remove(struct platform_device *pdev)
> const struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN];
> const struct pmc_reg_map *map = pmc->map;
>
> - if (map->acpi_pm_tmr_ctl_offset)
> + if (IS_ENABLED(CONFIG_CONFIG_X86_PM_TIMER) &&
> + map->acpi_pm_tmr_ctl_offset)
> acpi_pmtmr_unregister_suspend_resume_callback();
>
> pmc_core_dbgfs_unregister(pmcdev);
> diff --git a/include/linux/acpi_pmtmr.h b/include/linux/acpi_pmtmr.h
> index 0ded9220d379..0846f90ce179 100644
> --- a/include/linux/acpi_pmtmr.h
> +++ b/include/linux/acpi_pmtmr.h
> @@ -13,14 +13,12 @@
> /* Overrun value */
> #define ACPI_PM_OVRRUN (1<<24)
>
> -#ifdef CONFIG_X86_PM_TIMER
> -
> extern u32 acpi_pm_read_verified(void);
> extern u32 pmtmr_ioport;
>
> static inline u32 acpi_pm_read_early(void)
> {
> - if (!pmtmr_ioport)
> + if (!IS_ENABLED(CONFIG_X86_PM_TIMER) || !pmtmr_ioport)
> return 0;
> /* mask the output to 24 bits */
> return acpi_pm_read_verified() & ACPI_PM_MASK;
> @@ -39,14 +37,5 @@ void acpi_pmtmr_register_suspend_resume_callback(void (*cb)(void *data, bool sus
> */
> void acpi_pmtmr_unregister_suspend_resume_callback(void);
>
> -#else
> -
> -static inline u32 acpi_pm_read_early(void)
> -{
> - return 0;
> -}
> -
> -#endif
> -
> #endif
>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Daniel, can you pick this one up?
Regards,
Hans
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] platform/x86:intel/pmc: fix build regression with pmtimer turned off
2024-09-09 11:36 ` Hans de Goede
@ 2024-09-09 13:36 ` Daniel Lezcano
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Lezcano @ 2024-09-09 13:36 UTC (permalink / raw)
To: Hans de Goede, Arnd Bergmann, Rajneesh Bhardwaj, David E Box
Cc: Arnd Bergmann, Ilpo Järvinen, Xi Pardee, Rajvi Jingar,
David E. Box, Kane Chen, Marek Maslanka, Tony Luck,
platform-driver-x86, linux-kernel
Hi Hans,
On 09/09/2024 13:36, Hans de Goede wrote:
[ ... ]
> Thanks, patch looks good to me:
>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
>
> Daniel, can you pick this one up?
Yes, sure
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-09-09 13:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-09 11:16 [PATCH] platform/x86:intel/pmc: fix build regression with pmtimer turned off Arnd Bergmann
2024-09-09 11:36 ` Hans de Goede
2024-09-09 13:36 ` Daniel Lezcano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox