public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: David Weinehall <david.weinehall@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t v3] tests/pm_rpm: Fix CRASH on machines that lack LLC
Date: Wed,  2 Mar 2016 18:02:30 +0200	[thread overview]
Message-ID: <1456934550-25305-1-git-send-email-david.weinehall@linux.intel.com> (raw)
In-Reply-To: <1456924317-23525-1-git-send-email-david.weinehall@linux.intel.com>

On machines that lack an LLC the pm-caching subtest will
terminate with sigbus and thus CRASH during the
I915_CACHING_CACHED iteration.  This patch adds a check for
this and uses I915_CACHING_NONE instead.

v2: Various improvements based on feedback from Chris Wilson

v3: Fix incorrect Signed-off-by: line

Signed-off-by: David Weinehall <david.weinehall@linux.intel.com>
---
 tests/pm_rpm.c | 33 +++++++++++----------------------
 1 file changed, 11 insertions(+), 22 deletions(-)

diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c
index 2aa6c1018aa2..add8e2eb457f 100644
--- a/tests/pm_rpm.c
+++ b/tests/pm_rpm.c
@@ -1800,7 +1800,7 @@ static void pm_test_caching(void)
 	uint32_t handle;
 	uint8_t *gem_buf;
 
-	uint32_t i, got_caching;
+	uint32_t i;
 	uint32_t gtt_obj_max_size = (16 * 1024);
 	uint32_t cache_levels[3] = {
 		I915_CACHING_NONE,
@@ -1808,42 +1808,31 @@ static void pm_test_caching(void)
 		I915_CACHING_DISPLAY,           /* eDRAM caching */
 	};
 
+	disable_all_screens(&ms_data);
 
 	handle = gem_create(drm_fd, gtt_obj_max_size);
 	gem_buf = gem_mmap__gtt(drm_fd, handle, gtt_obj_max_size, PROT_WRITE);
 
 	for (i = 0; i < ARRAY_SIZE(cache_levels); i++) {
-		memset(gem_buf, 16 << i, gtt_obj_max_size);
+		igt_assert(wait_for_suspended());
 
-		disable_all_screens_and_wait(&ms_data);
+		memset(gem_buf, 16 << i, gtt_obj_max_size);
 
 		igt_debug("Setting cache level %u\n", cache_levels[i]);
 
-		gem_set_caching(drm_fd, handle, cache_levels[i]);
-
-		got_caching = gem_get_caching(drm_fd, handle);
-
-		igt_debug("Got back %u\n", got_caching);
-
-		/*
-		 * Allow fall-back to CACHING_NONE in case the platform does
-		 * not support it.
-		 */
-		if (cache_levels[i] == I915_CACHING_DISPLAY)
-			igt_assert(got_caching == I915_CACHING_NONE ||
-				   got_caching == I915_CACHING_DISPLAY);
-		else
-			igt_assert(got_caching == cache_levels[i]);
-
-		enable_one_screen_and_wait(&ms_data);
+		/* If we lack an LLC cache we use I915_CACHING_NONE instead */
+		if (cache_levels[i] == I915_CACHING_CACHED &&
+		    !gem_has_llc(drm_fd)) {
+			igt_debug("!gem_has_llc(); using I915_CACHING_NONE\n");
+			gem_set_caching(drm_fd, handle, I915_CACHING_NONE);
+		} else
+			gem_set_caching(drm_fd, handle, cache_levels[i]);
 	}
 
 	igt_assert(munmap(gem_buf, gtt_obj_max_size) == 0);
 	gem_close(drm_fd, handle);
 }
 
-
-
 static void fences_subtest(bool dpms)
 {
 	int i;
-- 
2.7.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-03-02 16:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-02 13:11 [PATCH i-g-t] tests/pm_rpm: Fix CRASH on machines that lack LLC David Weinehall
2016-03-02 13:27 ` Chris Wilson
2016-03-02 13:55   ` David Weinehall
2016-03-02 14:04     ` Chris Wilson
2016-03-02 14:32       ` Imre Deak
2016-03-02 14:37         ` Chris Wilson
2016-03-02 14:41           ` Imre Deak
2016-03-02 14:49             ` Chris Wilson
2016-03-02 15:01               ` Imre Deak
2016-03-02 15:28                 ` Chris Wilson
2016-03-02 16:23                   ` Imre Deak
2016-03-02 14:38       ` David Weinehall
2016-03-02 15:50 ` [PATCH i-g-t v2] " David Weinehall
2016-03-02 16:06   ` Chris Wilson
2016-03-02 16:02 ` David Weinehall [this message]
2016-03-02 17:01 ` [PATCH i-g-t v4] " David Weinehall
2016-03-02 17:20   ` Chris Wilson
2016-03-02 17:32     ` Imre Deak

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=1456934550-25305-1-git-send-email-david.weinehall@linux.intel.com \
    --to=david.weinehall@linux.intel.com \
    --cc=intel-gfx@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