public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: don.hiatt@intel.com
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] lib/aux: Ensure swap space prior to suspend to disk
Date: Thu, 21 Nov 2019 16:43:53 -0800	[thread overview]
Message-ID: <20191122004353.133274-1-don.hiatt@intel.com> (raw)

From: Don Hiatt <don.hiatt@intel.com>

Suspending to disk requires swap space, make sure it exists
before attempting to suspend to disk.

Cc: Sujaritha Sundaresan <sujaritha.sundaresan@intel.com>
Signed-off-by: Don Hiatt <don.hiatt@intel.com>
---
 lib/igt_aux.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index 578f857933f0..31c01624a651 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -864,6 +864,10 @@ void igt_system_suspend_autoresume(enum igt_suspend_state state,
 	igt_require(test == SUSPEND_TEST_NONE ||
 		    faccessat(power_dir, "pm_test", R_OK | W_OK, 0) == 0);
 
+	if (state == SUSPEND_STATE_DISK)
+		igt_require_f(intel_get_total_swap_mb() > 0,
+			      "Suspend to disk requires swap space.\n");
+
 	orig_test = get_suspend_test(power_dir);
 	set_suspend_test(power_dir, test);
 
-- 
2.17.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

             reply	other threads:[~2019-11-22  0:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-22  0:43 don.hiatt [this message]
2019-11-22  0:36 ` [igt-dev] [PATCH i-g-t] lib/aux: Ensure swap space prior to suspend to disk Chris Wilson
2019-11-22  0:40   ` Hiatt, Don
2019-11-22  0:52     ` Hiatt, Don
2019-11-22  0:55       ` Chris Wilson
  -- strict thread matches above, loose matches on Subject: below --
2019-11-22  1:08 don.hiatt
2019-11-22  1:10 don.hiatt
2019-11-26  0:49 ` Sujaritha
2019-11-26  9:52   ` Petri Latvala
2019-11-26 17:05     ` Hiatt, Don
2019-11-28 13:30   ` Petri Latvala

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=20191122004353.133274-1-don.hiatt@intel.com \
    --to=don.hiatt@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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