linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPI / PM: fix build regression
@ 2017-11-07 10:48 Arnd Bergmann
  2017-11-07 11:17 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2017-11-07 10:48 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown
  Cc: Paul Menzel, Arnd Bergmann, stable, Jean Delvare, linux-acpi,
	linux-kernel

The XPS13 workaround caused a build regression in configurations without
CONFIG_ACPI_SLEEP.

drivers/acpi/sleep.c:95:5: error: redefinition of 'acpi_target_system_state'
 u32 acpi_target_system_state(void)
     ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/acpi.h:44:0,
                 from drivers/acpi/sleep.c:20:
include/acpi/acpi_bus.h:661:19: note: previous definition of 'acpi_target_system_state' was here
 static inline u32 acpi_target_system_state(void) { return ACPI_STATE_S0; }
                   ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/acpi/sleep.c:495:13: error: 'acpi_pm_end' defined but not used [-Werror=unused-function]

This adds back the #ifdef checks required to make it build cleanly again.
The patch that caused the regression is marked for backports to v4.13, the
same should apply to this one.

Fixes: 8d7a4756fef9 ("ACPI / PM: Blacklist Low Power S0 Idle _DSM for Dell XPS13 9360")
Cc: stable@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
I have not tried to verify that the new version makes sense, only that
it builds cleanly. Please have a look and apply either this patch, or
whatever else makes more sense here.
---
 drivers/acpi/sleep.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 01ac769e51c9..374f995dbd0a 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -90,6 +90,7 @@ static bool acpi_sleep_state_supported(u8 sleep_state)
 			&& acpi_gbl_FADT.sleep_status.address));
 }
 
+#ifdef CONFIG_ACPI_SLEEP
 static u32 acpi_target_sleep_state = ACPI_STATE_S0;
 
 u32 acpi_target_system_state(void)
@@ -99,6 +100,7 @@ u32 acpi_target_system_state(void)
 EXPORT_SYMBOL_GPL(acpi_target_system_state);
 
 static bool pwr_btn_event_pending;
+#endif
 
 /*
  * The ACPI specification wants us to save NVS memory regions during hibernation
@@ -376,6 +378,7 @@ static void __init acpi_sleep_dmi_check(void)
 	dmi_check_system(acpisleep_dmi_table);
 }
 
+#ifdef CONFIG_ACPI_SLEEP
 /**
  * acpi_pm_freeze - Disable the GPEs and suspend EC transactions.
  */
@@ -503,6 +506,7 @@ static void acpi_pm_end(void)
 	acpi_target_sleep_state = ACPI_STATE_S0;
 	acpi_sleep_tts_switch(acpi_target_sleep_state);
 }
+#endif
 
 #ifdef CONFIG_SUSPEND
 static u32 acpi_suspend_states[] = {
-- 
2.9.0

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

* Re: [PATCH] ACPI / PM: fix build regression
  2017-11-07 10:48 [PATCH] ACPI / PM: fix build regression Arnd Bergmann
@ 2017-11-07 11:17 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2017-11-07 11:17 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Rafael J. Wysocki, Len Brown, Paul Menzel, Stable, Jean Delvare,
	ACPI Devel Maling List, Linux Kernel Mailing List

On Tue, Nov 7, 2017 at 11:48 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> The XPS13 workaround caused a build regression in configurations without
> CONFIG_ACPI_SLEEP.
>
> drivers/acpi/sleep.c:95:5: error: redefinition of 'acpi_target_system_state'
>  u32 acpi_target_system_state(void)
>      ^~~~~~~~~~~~~~~~~~~~~~~~
> In file included from include/linux/acpi.h:44:0,
>                  from drivers/acpi/sleep.c:20:
> include/acpi/acpi_bus.h:661:19: note: previous definition of 'acpi_target_system_state' was here
>  static inline u32 acpi_target_system_state(void) { return ACPI_STATE_S0; }
>                    ^~~~~~~~~~~~~~~~~~~~~~~~
> drivers/acpi/sleep.c:495:13: error: 'acpi_pm_end' defined but not used [-Werror=unused-function]
>
> This adds back the #ifdef checks required to make it build cleanly again.
> The patch that caused the regression is marked for backports to v4.13, the
> same should apply to this one.
>
> Fixes: 8d7a4756fef9 ("ACPI / PM: Blacklist Low Power S0 Idle _DSM for Dell XPS13 9360")
> Cc: stable@vger.kernel.org
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

This should have been fixed in my tree already.

Unfortunately, linux-next picked up an earlier version with this issue.

Thanks,
Rafael

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

end of thread, other threads:[~2017-11-07 11:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-07 10:48 [PATCH] ACPI / PM: fix build regression Arnd Bergmann
2017-11-07 11:17 ` Rafael J. Wysocki

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).