From: Daniel Vetter Subject: Re: [PATCH] tests/gem_reset_stats: stop only one ring when submitting hang Date: Tue, 21 Jan 2014 18:00:47 +0100 Message-ID: <20140121170047.GB9772@phenom.ffwll.local> References: <1390318808-20748-1-git-send-email-mika.kuoppala@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ea0-f173.google.com (mail-ea0-f173.google.com [209.85.215.173]) by gabe.freedesktop.org (Postfix) with ESMTP id 58DA710579A for ; Tue, 21 Jan 2014 09:00:52 -0800 (PST) Received: by mail-ea0-f173.google.com with SMTP id d10so1087668eaj.18 for ; Tue, 21 Jan 2014 09:00:51 -0800 (PST) Content-Disposition: inline In-Reply-To: <1390318808-20748-1-git-send-email-mika.kuoppala@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Mika Kuoppala Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Tue, Jan 21, 2014 at 05:40:08PM +0200, Mika Kuoppala wrote: > If we stop all the rings, we can end up blaming the innocent > rings on hangcheck. > > Reference: https://bugs.freedesktop.org/show_bug.cgi?id=73652 > Signed-off-by: Mika Kuoppala Merged, thanks for the patch. -Daniel > --- > tests/gem_reset_stats.c | 23 ++++++++++++++++++++--- > 1 file changed, 20 insertions(+), 3 deletions(-) > > diff --git a/tests/gem_reset_stats.c b/tests/gem_reset_stats.c > index 034a298..331d954 100644 > --- a/tests/gem_reset_stats.c > +++ b/tests/gem_reset_stats.c > @@ -237,20 +237,37 @@ static int exec_valid(int fd, int ctx) > return exec_valid_ring(fd, ctx, current_ring->exec); > } > > -static void stop_rings(void) > +static void stop_rings(const int mask) > { > int fd; > + char buf[80]; > > + igt_assert((mask & ~((1 << NUM_RINGS) - 1)) == 0); > + igt_assert(snprintf(buf, sizeof(buf), "0x%02x", mask) == 4); > fd = igt_debugfs_open(&dfs, "i915_ring_stop", O_WRONLY); > igt_assert(fd >= 0); > > - igt_assert(write(fd, "0xff", 4) == 4); > + igt_assert(write(fd, buf, 4) == 4); > close(fd); > } > > #define BUFSIZE (4 * 1024) > #define ITEMS (BUFSIZE >> 2) > > +static int ring_to_mask(int ring) > +{ > + for (unsigned i = 0; i < NUM_RINGS; i++) { > + const struct target_ring *r = &rings[i]; > + > + if (r->exec == ring) > + return (1 << i); > + } > + > + igt_assert(0); > + > + return -1; > +} > + > static int inject_hang_ring(int fd, int ctx, int ring) > { > struct drm_i915_gem_execbuffer2 execbuf; > @@ -340,7 +357,7 @@ static int inject_hang_ring(int fd, int ctx, int ring) > > free(buf); > > - stop_rings(); > + stop_rings(ring_to_mask(ring)); > > return exec.handle; > } > -- > 1.7.9.5 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch