From: Domenico Andreoli <domenico.andreoli@linux.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>, Pavel Machek <pavel@ucw.cz>
Cc: Linux PM <linux-pm@vger.kernel.org>,
Domenico Andreoli <domenico.andreoli@linux.com>
Subject: [PATCH 2/2] uswsusp: build only when configured
Date: Mon, 13 Apr 2020 21:08:45 +0200 [thread overview]
Message-ID: <20200413193718.956985775@gmail.com> (raw)
In-Reply-To: 20200413190843.044112674@gmail.com
[-- Attachment #1: split-user-space-hibernation-option --]
[-- Type: text/plain, Size: 2275 bytes --]
From: Domenico Andreoli <domenico.andreoli@linux.com>
uswsusp is no longer the preferred way to suspend/hibernate and the
userspace tools have not received any update in years.
Make it possible to enable the uswsusp support only if needed, prepare
for future phase out.
Signed-off-by: Domenico Andreoli <domenico.andreoli@linux.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Linux PM <linux-pm@vger.kernel.org>
---
kernel/power/Kconfig | 5 +++++
kernel/power/Makefile | 3 ++-
kernel/power/power.h | 5 +++++
3 files changed, 12 insertions(+), 1 deletion(-)
Index: b/kernel/power/Kconfig
===================================================================
--- a/kernel/power/Kconfig
+++ b/kernel/power/Kconfig
@@ -80,6 +80,11 @@ config HIBERNATION
For more information take a look at <file:Documentation/power/swsusp.rst>.
+config HIBERNATION_USER
+ bool "Userspace software suspend interface (DEPRECATED)"
+ depends on HIBERNATION
+ default n
+
config PM_STD_PARTITION
string "Default resume partition"
depends on HIBERNATION
Index: b/kernel/power/Makefile
===================================================================
--- a/kernel/power/Makefile
+++ b/kernel/power/Makefile
@@ -10,7 +10,8 @@ obj-$(CONFIG_VT_CONSOLE_SLEEP) += consol
obj-$(CONFIG_FREEZER) += process.o
obj-$(CONFIG_SUSPEND) += suspend.o
obj-$(CONFIG_PM_TEST_SUSPEND) += suspend_test.o
-obj-$(CONFIG_HIBERNATION) += hibernate.o snapshot.o swap.o user.o
+obj-$(CONFIG_HIBERNATION) += hibernate.o snapshot.o swap.o
+obj-$(CONFIG_HIBERNATION_USER) += user.o
obj-$(CONFIG_PM_AUTOSLEEP) += autosleep.o
obj-$(CONFIG_PM_WAKELOCKS) += wakelock.o
Index: b/kernel/power/power.h
===================================================================
--- a/kernel/power/power.h
+++ b/kernel/power/power.h
@@ -158,8 +158,13 @@ extern sector_t alloc_swapdev_block(int
extern void free_all_swap_pages(int swap);
extern int swsusp_swap_in_use(void);
+#ifdef CONFIG_HIBERNATION_USER
bool swsusp_try_enter(void);
void swsusp_leave(void);
+#else
+static inline bool swsusp_try_enter(void) { return 1; }
+static inline void swsusp_leave(void) {}
+#endif
/*
* Flags that can be passed from the hibernatig hernel to the "boot" kernel in
next prev parent reply other threads:[~2020-04-13 19:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-13 19:08 [PATCH 0/2] Preparing to phase out uswsusp Domenico Andreoli
2020-04-13 19:08 ` [PATCH 1/2] uswsusp: use enter/leave helpers and make a global variable static Domenico Andreoli
2020-04-26 16:11 ` Rafael J. Wysocki
2020-04-13 19:08 ` Domenico Andreoli [this message]
2020-04-25 11:47 ` [uswsusp] 08e6583083: stress-ng.futex.ops_per_sec -11.4% regression kernel test robot
2020-04-26 16:16 ` [PATCH 2/2] uswsusp: build only when configured Rafael J. Wysocki
2020-04-27 9:48 ` Domenico Andreoli
2020-04-29 11:20 ` Rafael J. Wysocki
2020-05-01 7:10 ` Domenico Andreoli
2020-05-01 14:54 ` Rafael J. Wysocki
2020-05-03 13:31 ` Domenico Andreoli
2020-05-03 17:25 ` Domenico Andreoli
2020-04-26 15:46 ` [PATCH 0/2] Preparing to phase out uswsusp Rafael J. Wysocki
2020-04-27 9:53 ` Domenico Andreoli
2020-04-29 11:06 ` Rafael J. Wysocki
2020-05-03 11:19 ` Domenico Andreoli
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=20200413193718.956985775@gmail.com \
--to=domenico.andreoli@linux.com \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rjw@rjwysocki.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.