All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] dma-buf: Introduce selftesting framework
@ 2019-08-19  9:59 Chris Wilson
  2019-08-19  9:59 ` [PATCH 2/3] dma-buf: Add selftests for dma-fence Chris Wilson
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Chris Wilson @ 2019-08-19  9:59 UTC (permalink / raw)
  To: dri-devel; +Cc: Tomi Sarvela, Daniel Vetter, intel-gfx

In light of recent review slip ups, the absence of a suite of tests for
dma-buf became apparent. Given the current plethora of testing
frameworks, opt for one already in use by Intel's CI and so allow easy
hook up into igt.

We introduce a new module that when loaded will execute the list of
selftests and their subtest. The names of the selftests are put into the
modinfo as parameters so that igt can identify each, and run them
independently, principally for ease of error reporting.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
---
 drivers/dma-buf/Kconfig     |   5 ++
 drivers/dma-buf/Makefile    |   3 +
 drivers/dma-buf/selftest.c  | 167 ++++++++++++++++++++++++++++++++++++
 drivers/dma-buf/selftest.h  |  30 +++++++
 drivers/dma-buf/selftests.h |  12 +++
 5 files changed, 217 insertions(+)
 create mode 100644 drivers/dma-buf/selftest.c
 create mode 100644 drivers/dma-buf/selftest.h
 create mode 100644 drivers/dma-buf/selftests.h

diff --git a/drivers/dma-buf/Kconfig b/drivers/dma-buf/Kconfig
index b6a9c2f1bc41..a23b6752d11a 100644
--- a/drivers/dma-buf/Kconfig
+++ b/drivers/dma-buf/Kconfig
@@ -39,4 +39,9 @@ config UDMABUF
 	  A driver to let userspace turn memfd regions into dma-bufs.
 	  Qemu can use this to create host dmabufs for guest framebuffers.
 
+config DMABUF_SELFTESTS
+	tristate "Selftests for the dma-buf interfaces"
+	default n
+	depends on DMA_SHARED_BUFFER
+
 endmenu
diff --git a/drivers/dma-buf/Makefile b/drivers/dma-buf/Makefile
index dcfb01e7c6f4..b5ae122a9349 100644
--- a/drivers/dma-buf/Makefile
+++ b/drivers/dma-buf/Makefile
@@ -4,3 +4,6 @@ obj-y := dma-buf.o dma-fence.o dma-fence-array.o dma-fence-chain.o \
 obj-$(CONFIG_SYNC_FILE)		+= sync_file.o
 obj-$(CONFIG_SW_SYNC)		+= sw_sync.o sync_debug.o
 obj-$(CONFIG_UDMABUF)		+= udmabuf.o
+
+dmabuf_selftests-y := selftest.o
+obj-$(CONFIG_DMABUF_SELFTESTS)	+= dmabuf_selftests.o
diff --git a/drivers/dma-buf/selftest.c b/drivers/dma-buf/selftest.c
new file mode 100644
index 000000000000..c60b6944b4bd
--- /dev/null
+++ b/drivers/dma-buf/selftest.c
@@ -0,0 +1,167 @@
+/* SPDX-License-Identifier: MIT */
+
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#include <linux/compiler.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/sched/signal.h>
+#include <linux/slab.h>
+
+#include "selftest.h"
+
+enum {
+#define selftest(n, func) __idx_##n,
+#include "selftests.h"
+#undef selftest
+};
+
+#define selftest(n, f) [__idx_##n] = { .name = #n, .func = f },
+static struct selftest {
+	bool enabled;
+	const char *name;
+	int (*func)(void);
+} selftests[] = {
+#include "selftests.h"
+};
+#undef selftest
+
+/* Embed the line number into the parameter name so that we can order tests */
+#define param(n) __PASTE(igt__, __PASTE(__PASTE(__LINE__, __), n))
+#define selftest_0(n, func, id) \
+module_param_named(id, selftests[__idx_##n].enabled, bool, 0400);
+#define selftest(n, func) selftest_0(n, func, param(n))
+#include "selftests.h"
+#undef selftest
+
+int __sanitycheck__(void)
+{
+	pr_debug("Hello World!\n");
+	return 0;
+}
+
+static char *__st_filter;
+
+static bool apply_subtest_filter(const char *caller, const char *name)
+{
+	char *filter, *sep, *tok;
+	bool result = true;
+
+	filter = kstrdup(__st_filter, GFP_KERNEL);
+	for (sep = filter; (tok = strsep(&sep, ","));) {
+		bool allow = true;
+		char *sl;
+
+		if (*tok == '!') {
+			allow = false;
+			tok++;
+		}
+
+		if (*tok == '\0')
+			continue;
+
+		sl = strchr(tok, '/');
+		if (sl) {
+			*sl++ = '\0';
+			if (strcmp(tok, caller)) {
+				if (allow)
+					result = false;
+				continue;
+			}
+			tok = sl;
+		}
+
+		if (strcmp(tok, name)) {
+			if (allow)
+				result = false;
+			continue;
+		}
+
+		result = allow;
+		break;
+	}
+	kfree(filter);
+
+	return result;
+}
+
+int
+__subtests(const char *caller, const struct subtest *st, int count, void *data)
+{
+	int err;
+
+	for (; count--; st++) {
+		cond_resched();
+		if (signal_pending(current))
+			return -EINTR;
+
+		if (!apply_subtest_filter(caller, st->name))
+			continue;
+
+		pr_info("dma-buf: Running %s/%s\n", caller, st->name);
+
+		err = st->func(data);
+		if (err && err != -EINTR) {
+			pr_err("dma-buf/%s: %s failed with error %d\n",
+			       caller, st->name, err);
+			return err;
+		}
+	}
+
+	return 0;
+}
+
+static void set_default_test_all(struct selftest *st, unsigned long count)
+{
+	unsigned long i;
+
+	for (i = 0; i < count; i++)
+		if (st[i].enabled)
+			return;
+
+	for (i = 0; i < count; i++)
+		st[i].enabled = true;
+}
+
+static int run_selftests(struct selftest *st, unsigned long count)
+{
+	int err = 0;
+
+	set_default_test_all(st, count);
+
+	/* Tests are listed in natural order in selftests.h */
+	for (; count--; st++) {
+		if (!st->enabled)
+			continue;
+
+		pr_info("dma-buf: Running %s\n", st->name);
+		err = st->func();
+		if (err)
+			break;
+	}
+
+	if (WARN(err > 0 || err == -ENOTTY,
+		 "%s returned %d, conflicting with selftest's magic values!\n",
+		 st->name, err))
+		err = -1;
+
+	return err;
+}
+
+static int __init st_init(void)
+{
+	return run_selftests(selftests, ARRAY_SIZE(selftests));
+}
+
+static void __exit st_exit(void)
+{
+}
+
+module_param_named(st_filter, __st_filter, charp, 0400);
+module_init(st_init);
+module_exit(st_exit);
+
+MODULE_DESCRIPTION("Self-test harness for dma-buf");
+MODULE_LICENSE("GPL and additional rights");
diff --git a/drivers/dma-buf/selftest.h b/drivers/dma-buf/selftest.h
new file mode 100644
index 000000000000..45793aff6142
--- /dev/null
+++ b/drivers/dma-buf/selftest.h
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: MIT
+
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __SELFTEST_H__
+#define __SELFTEST_H__
+
+#include <linux/compiler.h>
+
+#define selftest(name, func) int func(void);
+#include "selftests.h"
+#undef selftest
+
+struct subtest {
+	int (*func)(void *data);
+	const char *name;
+};
+
+int __subtests(const char *caller,
+	       const struct subtest *st,
+	       int count,
+	       void *data);
+#define subtests(T, data) \
+	__subtests(__func__, T, ARRAY_SIZE(T), data)
+
+#define SUBTEST(x) { x, #x }
+
+#endif /* __SELFTEST_H__ */
diff --git a/drivers/dma-buf/selftests.h b/drivers/dma-buf/selftests.h
new file mode 100644
index 000000000000..44b44390d23a
--- /dev/null
+++ b/drivers/dma-buf/selftests.h
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: MIT */
+/* List each unit test as selftest(name, function)
+ *
+ * The name is used as both an enum and expanded as subtest__name to create
+ * a module parameter. It must be unique and legal for a C identifier.
+ *
+ * The function should be of type int function(void). It may be conditionally
+ * compiled using #if IS_ENABLED(DRM_I915_SELFTEST).
+ *
+ * Tests are executed in order by igt/dmabuf_selftest
+ */
+selftest(sanitycheck, __sanitycheck__) /* keep first (igt selfcheck) */
-- 
2.23.0.rc1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 2/3] dma-buf: Add selftests for dma-fence
  2019-08-19  9:59 [PATCH 1/3] dma-buf: Introduce selftesting framework Chris Wilson
@ 2019-08-19  9:59 ` Chris Wilson
  2019-08-19  9:59 ` [PATCH 3/3] dma-fence: Set the timestamp after the notifying the cb_list Chris Wilson
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2019-08-19  9:59 UTC (permalink / raw)
  To: dri-devel; +Cc: Daniel Vetter, intel-gfx

Exercise the dma-fence API exported to drivers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/dma-buf/Makefile       |   5 +-
 drivers/dma-buf/selftests.h    |   1 +
 drivers/dma-buf/st-dma-fence.c | 571 +++++++++++++++++++++++++++++++++
 3 files changed, 576 insertions(+), 1 deletion(-)
 create mode 100644 drivers/dma-buf/st-dma-fence.c

diff --git a/drivers/dma-buf/Makefile b/drivers/dma-buf/Makefile
index b5ae122a9349..03479da06422 100644
--- a/drivers/dma-buf/Makefile
+++ b/drivers/dma-buf/Makefile
@@ -5,5 +5,8 @@ obj-$(CONFIG_SYNC_FILE)		+= sync_file.o
 obj-$(CONFIG_SW_SYNC)		+= sw_sync.o sync_debug.o
 obj-$(CONFIG_UDMABUF)		+= udmabuf.o
 
-dmabuf_selftests-y := selftest.o
+dmabuf_selftests-y := \
+	selftest.o \
+	st-dma-fence.o
+
 obj-$(CONFIG_DMABUF_SELFTESTS)	+= dmabuf_selftests.o
diff --git a/drivers/dma-buf/selftests.h b/drivers/dma-buf/selftests.h
index 44b44390d23a..5320386f02e5 100644
--- a/drivers/dma-buf/selftests.h
+++ b/drivers/dma-buf/selftests.h
@@ -10,3 +10,4 @@
  * Tests are executed in order by igt/dmabuf_selftest
  */
 selftest(sanitycheck, __sanitycheck__) /* keep first (igt selfcheck) */
+selftest(dma_fence, dma_fence)
diff --git a/drivers/dma-buf/st-dma-fence.c b/drivers/dma-buf/st-dma-fence.c
new file mode 100644
index 000000000000..a365dc7440e5
--- /dev/null
+++ b/drivers/dma-buf/st-dma-fence.c
@@ -0,0 +1,571 @@
+/* SPDX-License-Identifier: MIT */
+
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#include <linux/delay.h>
+#include <linux/dma-fence.h>
+#include <linux/kernel.h>
+#include <linux/kthread.h>
+#include <linux/sched/signal.h>
+#include <linux/slab.h>
+#include <linux/spinlock.h>
+
+#include "selftest.h"
+
+static struct kmem_cache *slab_fences;
+
+static struct mock_fence {
+	struct dma_fence base;
+	struct spinlock lock;
+} *to_mock_fence(struct dma_fence *f) {
+	return container_of(f, struct mock_fence, base);
+}
+
+static const char *mock_name(struct dma_fence *f)
+{
+	return "mock";
+}
+
+static void mock_fence_release(struct dma_fence *f)
+{
+	kmem_cache_free(slab_fences, to_mock_fence(f));
+}
+
+struct wait_cb {
+	struct dma_fence_cb cb;
+	struct task_struct *task;
+};
+
+static void mock_wakeup(struct dma_fence *f, struct dma_fence_cb *cb)
+{
+	wake_up_process(container_of(cb, struct wait_cb, cb)->task);
+}
+
+static long mock_wait(struct dma_fence *f, bool intr, long timeout)
+{
+	const int state = intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE;
+	struct wait_cb cb = { .task = current };
+
+	if (dma_fence_add_callback(f, &cb.cb, mock_wakeup))
+		return timeout;
+
+	while (timeout) {
+		set_current_state(state);
+
+		if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &f->flags))
+			break;
+
+		if (signal_pending_state(state, current))
+			break;
+
+		timeout = schedule_timeout(timeout);
+	}
+	__set_current_state(TASK_RUNNING);
+
+	if (!dma_fence_remove_callback(f, &cb.cb))
+		return timeout;
+
+	if (signal_pending_state(state, current))
+		return -ERESTARTSYS;
+
+	return -ETIME;
+}
+
+static const struct dma_fence_ops mock_ops = {
+	.get_driver_name = mock_name,
+	.get_timeline_name = mock_name,
+	.wait = mock_wait,
+	.release = mock_fence_release,
+};
+
+static struct dma_fence *mock_fence(void)
+{
+	struct mock_fence *f;
+
+	f = kmem_cache_alloc(slab_fences, GFP_KERNEL);
+	if (!f)
+		return NULL;
+
+	spin_lock_init(&f->lock);
+	dma_fence_init(&f->base, &mock_ops, &f->lock, 0, 0);
+
+	return &f->base;
+}
+
+static int sanitycheck(void *arg)
+{
+	struct dma_fence *f;
+
+	f = mock_fence();
+	if (!f)
+		return -ENOMEM;
+
+	dma_fence_signal(f);
+	dma_fence_put(f);
+
+	return 0;
+}
+
+static int test_signaling(void *arg)
+{
+	struct dma_fence *f;
+	int err = -EINVAL;
+
+	f = mock_fence();
+	if (!f)
+		return -ENOMEM;
+
+	if (dma_fence_is_signaled(f)) {
+		pr_err("Fence unexpectedly signaled on creation\n");
+		goto err_free;
+	}
+
+	if (dma_fence_signal(f)) {
+		pr_err("Fence reported being already signaled\n");
+		goto err_free;
+	}
+
+	if (!dma_fence_is_signaled(f)) {
+		pr_err("Fence not reporting signaled\n");
+		goto err_free;
+	}
+
+	if (!dma_fence_signal(f)) {
+		pr_err("Fence reported not being already signaled\n");
+		goto err_free;
+	}
+
+	err = 0;
+err_free:
+	dma_fence_put(f);
+	return err;
+}
+
+struct simple_cb {
+	struct dma_fence_cb cb;
+	bool seen;
+};
+
+static void simple_callback(struct dma_fence *f, struct dma_fence_cb *cb)
+{
+	smp_store_mb(container_of(cb, struct simple_cb, cb)->seen, true);
+}
+
+static int test_add_callback(void *arg)
+{
+	struct simple_cb cb = {};
+	struct dma_fence *f;
+	int err = -EINVAL;
+
+	f = mock_fence();
+	if (!f)
+		return -ENOMEM;
+
+	if (dma_fence_add_callback(f, &cb.cb, simple_callback)) {
+		pr_err("Failed to add callback, fence already signaled!\n");
+		goto err_free;
+	}
+
+	dma_fence_signal(f);
+	if (!cb.seen) {
+		pr_err("Callback failed!\n");
+		goto err_free;
+	}
+
+	err = 0;
+err_free:
+	dma_fence_put(f);
+	return err;
+}
+
+static int test_late_add_callback(void *arg)
+{
+	struct simple_cb cb = {};
+	struct dma_fence *f;
+	int err = -EINVAL;
+
+	f = mock_fence();
+	if (!f)
+		return -ENOMEM;
+
+	dma_fence_signal(f);
+
+	if (!dma_fence_add_callback(f, &cb.cb, simple_callback)) {
+		pr_err("Added callback, but fence was already signaled!\n");
+		goto err_free;
+	}
+
+	dma_fence_signal(f);
+	if (cb.seen) {
+		pr_err("Callback called after failed attachment !\n");
+		goto err_free;
+	}
+
+	err = 0;
+err_free:
+	dma_fence_put(f);
+	return err;
+}
+
+static int test_rm_callback(void *arg)
+{
+	struct simple_cb cb = {};
+	struct dma_fence *f;
+	int err = -EINVAL;
+
+	f = mock_fence();
+	if (!f)
+		return -ENOMEM;
+
+	if (dma_fence_add_callback(f, &cb.cb, simple_callback)) {
+		pr_err("Failed to add callback, fence already signaled!\n");
+		goto err_free;
+	}
+
+	if (!dma_fence_remove_callback(f, &cb.cb)) {
+		pr_err("Failed to remove callback!\n");
+		goto err_free;
+	}
+
+	dma_fence_signal(f);
+	if (cb.seen) {
+		pr_err("Callback still signaled after removal!\n");
+		goto err_free;
+	}
+
+	err = 0;
+err_free:
+	dma_fence_put(f);
+	return err;
+}
+
+static int test_late_rm_callback(void *arg)
+{
+	struct simple_cb cb = {};
+	struct dma_fence *f;
+	int err = -EINVAL;
+
+	f = mock_fence();
+	if (!f)
+		return -ENOMEM;
+
+	if (dma_fence_add_callback(f, &cb.cb, simple_callback)) {
+		pr_err("Failed to add callback, fence already signaled!\n");
+		goto err_free;
+	}
+
+	dma_fence_signal(f);
+	if (!cb.seen) {
+		pr_err("Callback failed!\n");
+		goto err_free;
+	}
+
+	if (dma_fence_remove_callback(f, &cb.cb)) {
+		pr_err("Callback removal succeed after being executed!\n");
+		goto err_free;
+	}
+
+	err = 0;
+err_free:
+	dma_fence_put(f);
+	return err;
+}
+
+static int test_status(void *arg)
+{
+	struct dma_fence *f;
+	int err = -EINVAL;
+
+	f = mock_fence();
+	if (!f)
+		return -ENOMEM;
+
+	if (dma_fence_get_status(f)) {
+		pr_err("Fence unexpectedly has signaled status on creation\n");
+		goto err_free;
+	}
+
+	dma_fence_signal(f);
+	if (!dma_fence_get_status(f)) {
+		pr_err("Fence not reporting signaled status\n");
+		goto err_free;
+	}
+
+	err = 0;
+err_free:
+	dma_fence_put(f);
+	return err;
+}
+
+static int test_error(void *arg)
+{
+	struct dma_fence *f;
+	int err = -EINVAL;
+
+	f = mock_fence();
+	if (!f)
+		return -ENOMEM;
+
+	dma_fence_set_error(f, -EIO);
+
+	if (dma_fence_get_status(f)) {
+		pr_err("Fence unexpectedly has error status before signal\n");
+		goto err_free;
+	}
+
+	dma_fence_signal(f);
+	if (dma_fence_get_status(f) != -EIO) {
+		pr_err("Fence not reporting error status, got %d\n",
+		       dma_fence_get_status(f));
+		goto err_free;
+	}
+
+	err = 0;
+err_free:
+	dma_fence_put(f);
+	return err;
+}
+
+static int test_wait(void *arg)
+{
+	struct dma_fence *f;
+	int err = -EINVAL;
+
+	f = mock_fence();
+	if (!f)
+		return -ENOMEM;
+
+	if (dma_fence_wait_timeout(f, false, 0) != -ETIME) {
+		pr_err("Wait reported complete before being signaled\n");
+		goto err_free;
+	}
+
+	dma_fence_signal(f);
+
+	if (dma_fence_wait_timeout(f, false, 0) != 0) {
+		pr_err("Wait reported incomplete after being signaled\n");
+		goto err_free;
+	}
+
+	err = 0;
+err_free:
+	dma_fence_signal(f);
+	dma_fence_put(f);
+	return err;
+}
+
+struct wait_timer {
+	struct timer_list timer;
+	struct dma_fence *f;
+};
+
+static void wait_timer(struct timer_list *timer)
+{
+	struct wait_timer *wt = from_timer(wt, timer, timer);
+
+	dma_fence_signal(wt->f);
+}
+
+static int test_wait_timeout(void *arg)
+{
+	struct wait_timer wt;
+	int err = -EINVAL;
+
+	timer_setup(&wt.timer, wait_timer, 0);
+
+	wt.f = mock_fence();
+	if (!wt.f)
+		return -ENOMEM;
+
+	if (dma_fence_wait_timeout(wt.f, false, 1) != -ETIME) {
+		pr_err("Wait reported complete before being signaled\n");
+		goto err_free;
+	}
+
+	mod_timer(&wt.timer, jiffies + 1);
+
+	if (dma_fence_wait_timeout(wt.f, false, 2) == -ETIME) {
+		if (timer_pending(&wt.timer)) {
+			pr_notice("Timer did not fire within the jiffie!\n");
+			err = 0; /* not our fault! */
+		} else {
+			pr_err("Wait reported incomplete after timeout\n");
+		}
+		goto err_free;
+	}
+
+	err = 0;
+err_free:
+	del_timer_sync(&wt.timer);
+	dma_fence_signal(wt.f);
+	dma_fence_put(wt.f);
+	return err;
+}
+
+static int test_stub(void *arg)
+{
+	struct dma_fence *f[64];
+	int err = -EINVAL;
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(f); i++) {
+		f[i] = dma_fence_get_stub();
+		if (!dma_fence_is_signaled(f[i])) {
+			pr_err("Obtained unsignaled stub fence!\n");
+			goto err;
+		}
+	}
+
+	err = 0;
+err:
+	while (i--)
+		dma_fence_put(f[i]);
+	return err;
+}
+
+/* Now off to the races! */
+
+struct race_thread {
+	struct dma_fence __rcu **fences;
+	struct task_struct *task;
+	bool before;
+	int id;
+};
+
+static void __wait_for_callbacks(struct dma_fence *f)
+{
+	spin_lock_irq(f->lock);
+	spin_unlock_irq(f->lock);
+}
+
+static int thread_signal_callback(void *arg)
+{
+	const struct race_thread *t = arg;
+	unsigned long pass = 0;
+	unsigned long miss = 0;
+	int err = 0;
+
+	while (!err && !kthread_should_stop()) {
+		struct dma_fence *f1, *f2;
+		struct simple_cb cb;
+
+		f1 = mock_fence();
+		if (!f1) {
+			err = -ENOMEM;
+			break;
+		}
+
+		rcu_assign_pointer(t->fences[t->id], f1);
+		smp_wmb();
+
+		rcu_read_lock();
+		do {
+			f2 = dma_fence_get_rcu_safe(&t->fences[!t->id]);
+		} while (!f2 && !kthread_should_stop());
+		rcu_read_unlock();
+
+		if (t->before)
+			dma_fence_signal(f1);
+
+		smp_store_mb(cb.seen, false);
+		if (!f2 || dma_fence_add_callback(f2, &cb.cb, simple_callback))
+			miss++, cb.seen = true;
+
+		if (!t->before)
+			dma_fence_signal(f1);
+
+		if (!cb.seen) {
+			dma_fence_wait(f2, false);
+			__wait_for_callbacks(f2);
+		}
+
+		if (!READ_ONCE(cb.seen)) {
+			pr_err("Callback not seen on thread %d, pass %lu (%lu misses), signaling %s add_callback; fence signaled? %s\n",
+			       t->id, pass, miss,
+			       t->before ? "before" : "after",
+			       dma_fence_is_signaled(f2) ? "yes" : "no");
+			err = -EINVAL;
+		}
+
+		dma_fence_put(f2);
+
+		rcu_assign_pointer(t->fences[t->id], NULL);
+		smp_wmb();
+
+		dma_fence_put(f1);
+
+		pass++;
+	}
+
+	pr_info("%s[%d] completed %lu passes, %lu misses\n",
+		__func__, t->id, pass, miss);
+	return err;
+}
+
+static int race_signal_callback(void *arg)
+{
+	struct dma_fence __rcu *f[2] = {};
+	int ret = 0;
+	int pass;
+
+	for (pass = 0; !ret && pass <= 1; pass++) {
+		struct race_thread t[2];
+		int i;
+
+		for (i = 0; i < ARRAY_SIZE(t); i++) {
+			t[i].fences = f;
+			t[i].id = i;
+			t[i].before = pass;
+			t[i].task = kthread_run(thread_signal_callback, &t[i],
+						"dma-fence:%d", i);
+			get_task_struct(t[i].task);
+		}
+
+		msleep(50);
+
+		for (i = 0; i < ARRAY_SIZE(t); i++) {
+			int err;
+
+			err = kthread_stop(t[i].task);
+			if (err && !ret)
+				ret = err;
+
+			put_task_struct(t[i].task);
+		}
+	}
+
+	return ret;
+}
+
+int dma_fence(void)
+{
+	static const struct subtest tests[] = {
+		SUBTEST(sanitycheck),
+		SUBTEST(test_signaling),
+		SUBTEST(test_add_callback),
+		SUBTEST(test_late_add_callback),
+		SUBTEST(test_rm_callback),
+		SUBTEST(test_late_rm_callback),
+		SUBTEST(test_status),
+		SUBTEST(test_error),
+		SUBTEST(test_wait),
+		SUBTEST(test_wait_timeout),
+		SUBTEST(test_stub),
+		SUBTEST(race_signal_callback),
+	};
+	int ret;
+
+	pr_info("sizeof(dma_fence)=%lu\n", sizeof(struct dma_fence));
+
+	slab_fences = KMEM_CACHE(mock_fence,
+				 SLAB_TYPESAFE_BY_RCU |
+				 SLAB_HWCACHE_ALIGN);
+
+	ret = subtests(tests, NULL);
+
+	kmem_cache_destroy(slab_fences);
+
+	return ret;
+}
-- 
2.23.0.rc1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 3/3] dma-fence: Set the timestamp after the notifying the cb_list
  2019-08-19  9:59 [PATCH 1/3] dma-buf: Introduce selftesting framework Chris Wilson
  2019-08-19  9:59 ` [PATCH 2/3] dma-buf: Add selftests for dma-fence Chris Wilson
@ 2019-08-19  9:59 ` Chris Wilson
  2019-08-19 13:27 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] dma-buf: Introduce selftesting framework Patchwork
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2019-08-19  9:59 UTC (permalink / raw)
  To: dri-devel; +Cc: intel-gfx, Christian König

Now that the timestamp and cb_list share the same slot in the fence,
with the current order of setting the timestamp before notifying the
cb_list, we have to take a temporary copy of the list. If we don't set
the timestamp, we can simply process the list in situ. This also gives
us the advantage that we get a signal when the cb_list is complete,
useful in a few cases that need to serialise against the cb_list.

Suggested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Christian König <christian.koenig@amd.com>
---
 drivers/dma-buf/dma-fence.c                 | 41 +++++++-----------
 drivers/dma-buf/st-dma-fence.c              |  8 +---
 drivers/dma-buf/sync_file.c                 |  5 +--
 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c | 28 +-----------
 include/linux/dma-fence.h                   | 47 ++++++++++++++++++++-
 5 files changed, 65 insertions(+), 64 deletions(-)

diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
index 2c136aee3e79..972a4b90b820 100644
--- a/drivers/dma-buf/dma-fence.c
+++ b/drivers/dma-buf/dma-fence.c
@@ -111,47 +111,36 @@ u64 dma_fence_context_alloc(unsigned num)
 EXPORT_SYMBOL(dma_fence_context_alloc);
 
 /**
- * dma_fence_signal_locked - signal completion of a fence
+ * __dma_fence_signal_locked - Perform signaling of a fence
  * @fence: the fence to signal
+ * @timestamp: the timsetamp of fence completion
  *
- * Signal completion for software callbacks on a fence, this will unblock
- * dma_fence_wait() calls and run all the callbacks added with
- * dma_fence_add_callback(). Can be called multiple times, but since a fence
- * can only go from the unsignaled to the signaled state and not back, it will
- * only be effective the first time.
+ * See dma_fence_signal() for the typical interface.
  *
- * Unlike dma_fence_signal(), this function must be called with &dma_fence.lock
- * held.
+ * This provides the low-level operations required upon signaling a fence,
+ * such as processing the callback list and setting the timestamp.
  *
- * Returns 0 on success and a negative error value when @fence has been
- * signalled already.
+ * Requires the caller to hold the fence->lock and already have marked the
+ * fence as signaled in an exclusive manner.
+ *
+ * Great care must be taken in calling this function!
  */
-int dma_fence_signal_locked(struct dma_fence *fence)
+void __dma_fence_signal_locked(struct dma_fence *fence, ktime_t timestamp)
 {
 	struct dma_fence_cb *cur, *tmp;
-	struct list_head cb_list;
 
 	lockdep_assert_held(fence->lock);
 
-	if (unlikely(test_and_set_bit(DMA_FENCE_FLAG_SIGNALED_BIT,
-				      &fence->flags)))
-		return -EINVAL;
-
-	/* Stash the cb_list before replacing it with the timestamp */
-	list_replace(&fence->cb_list, &cb_list);
-
-	fence->timestamp = ktime_get();
-	set_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags);
-	trace_dma_fence_signaled(fence);
-
-	list_for_each_entry_safe(cur, tmp, &cb_list, node) {
+	list_for_each_entry_safe(cur, tmp, &fence->cb_list, node) {
 		INIT_LIST_HEAD(&cur->node);
 		cur->func(fence, cur);
 	}
 
-	return 0;
+	fence->timestamp = timestamp; /* overwrites fence->cb_list */
+	set_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags);
+	trace_dma_fence_signaled(fence);
 }
-EXPORT_SYMBOL(dma_fence_signal_locked);
+EXPORT_SYMBOL(__dma_fence_signal_locked);
 
 /**
  * dma_fence_signal - signal completion of a fence
diff --git a/drivers/dma-buf/st-dma-fence.c b/drivers/dma-buf/st-dma-fence.c
index a365dc7440e5..1fba51a5a46b 100644
--- a/drivers/dma-buf/st-dma-fence.c
+++ b/drivers/dma-buf/st-dma-fence.c
@@ -434,12 +434,6 @@ struct race_thread {
 	int id;
 };
 
-static void __wait_for_callbacks(struct dma_fence *f)
-{
-	spin_lock_irq(f->lock);
-	spin_unlock_irq(f->lock);
-}
-
 static int thread_signal_callback(void *arg)
 {
 	const struct race_thread *t = arg;
@@ -478,7 +472,7 @@ static int thread_signal_callback(void *arg)
 
 		if (!cb.seen) {
 			dma_fence_wait(f2, false);
-			__wait_for_callbacks(f2);
+			dma_fence_wait_for_notify(f2);
 		}
 
 		if (!READ_ONCE(cb.seen)) {
diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
index 25c5c071645b..f801dabb33a4 100644
--- a/drivers/dma-buf/sync_file.c
+++ b/drivers/dma-buf/sync_file.c
@@ -384,9 +384,8 @@ static int sync_fill_fence_info(struct dma_fence *fence,
 		sizeof(info->driver_name));
 
 	info->status = dma_fence_get_status(fence);
-	while (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags) &&
-	       !test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags))
-		cpu_relax();
+	if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags))
+		dma_fence_wait_for_notify(fence);
 	info->timestamp_ns =
 		test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags) ?
 		ktime_to_ns(fence->timestamp) :
diff --git a/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c b/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c
index 09c68dda2098..dbfb3b5348c4 100644
--- a/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c
+++ b/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c
@@ -105,29 +105,6 @@ __dma_fence_signal(struct dma_fence *fence)
 	return !test_and_set_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags);
 }
 
-static void
-__dma_fence_signal__timestamp(struct dma_fence *fence, ktime_t timestamp)
-{
-	fence->timestamp = timestamp;
-	set_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags);
-	trace_dma_fence_signaled(fence);
-}
-
-static void
-__dma_fence_signal__notify(struct dma_fence *fence,
-			   const struct list_head *list)
-{
-	struct dma_fence_cb *cur, *tmp;
-
-	lockdep_assert_held(fence->lock);
-	lockdep_assert_irqs_disabled();
-
-	list_for_each_entry_safe(cur, tmp, list, node) {
-		INIT_LIST_HEAD(&cur->node);
-		cur->func(fence, cur);
-	}
-}
-
 void intel_engine_breadcrumbs_irq(struct intel_engine_cs *engine)
 {
 	struct intel_breadcrumbs *b = &engine->breadcrumbs;
@@ -187,12 +164,9 @@ void intel_engine_breadcrumbs_irq(struct intel_engine_cs *engine)
 	list_for_each_safe(pos, next, &signal) {
 		struct i915_request *rq =
 			list_entry(pos, typeof(*rq), signal_link);
-		struct list_head cb_list;
 
 		spin_lock(&rq->lock);
-		list_replace(&rq->fence.cb_list, &cb_list);
-		__dma_fence_signal__timestamp(&rq->fence, timestamp);
-		__dma_fence_signal__notify(&rq->fence, &cb_list);
+		__dma_fence_signal_locked(&rq->fence, timestamp);
 		spin_unlock(&rq->lock);
 
 		i915_request_put(rq);
diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h
index 3347c54f3a87..b93c83f240c2 100644
--- a/include/linux/dma-fence.h
+++ b/include/linux/dma-fence.h
@@ -357,8 +357,36 @@ dma_fence_get_rcu_safe(struct dma_fence __rcu **fencep)
 	} while (1);
 }
 
+void __dma_fence_signal_locked(struct dma_fence *fence, ktime_t timestamp);
+
+/**
+ * dma_fence_signal_locked - signal completion of a fence
+ * @fence: the fence to signal
+ *
+ * Signal completion for software callbacks on a fence, this will unblock
+ * dma_fence_wait() calls and run all the callbacks added with
+ * dma_fence_add_callback(). Can be called multiple times, but since a fence
+ * can only go from the unsignaled to the signaled state and not back, it will
+ * only be effective the first time.
+ *
+ * Unlike dma_fence_signal(), this function must be called with &dma_fence.lock
+ * held.
+ *
+ * Returns 0 on success and a negative error value when @fence has been
+ * signalled already.
+ */
+static inline int dma_fence_signal_locked(struct dma_fence *fence)
+{
+	if (unlikely(test_and_set_bit(DMA_FENCE_FLAG_SIGNALED_BIT,
+				      &fence->flags)))
+		return -EINVAL;
+
+	__dma_fence_signal_locked(fence, ktime_get());
+	return 0;
+}
+
 int dma_fence_signal(struct dma_fence *fence);
-int dma_fence_signal_locked(struct dma_fence *fence);
+
 signed long dma_fence_default_wait(struct dma_fence *fence,
 				   bool intr, signed long timeout);
 int dma_fence_add_callback(struct dma_fence *fence,
@@ -426,6 +454,23 @@ dma_fence_is_signaled(struct dma_fence *fence)
 	return false;
 }
 
+/**
+ * dma_fence_wait_for_notify - Wait until the notifications are complete
+ * @fence: the fence to wait on
+ *
+ * After marking the fence as signaled, a number of operations but we
+ * are completely done, from notifying all the listeners culminating
+ * in setting the timestamp on the fence. This signals the completion
+ * of all the callbacks and the end of the siganling operation.
+ */
+static inline void
+dma_fence_wait_for_notify(struct dma_fence *fence)
+{
+	WARN_ON(!test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags));
+	while (!test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags))
+		cpu_relax();
+}
+
 /**
  * __dma_fence_is_later - return if f1 is chronologically later than f2
  * @f1: the first fence's seqno
-- 
2.23.0.rc1

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

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

* ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] dma-buf: Introduce selftesting framework
  2019-08-19  9:59 [PATCH 1/3] dma-buf: Introduce selftesting framework Chris Wilson
  2019-08-19  9:59 ` [PATCH 2/3] dma-buf: Add selftests for dma-fence Chris Wilson
  2019-08-19  9:59 ` [PATCH 3/3] dma-fence: Set the timestamp after the notifying the cb_list Chris Wilson
@ 2019-08-19 13:27 ` Patchwork
  2019-08-19 14:17 ` ✓ Fi.CI.BAT: success " Patchwork
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2019-08-19 13:27 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/3] dma-buf: Introduce selftesting framework
URL   : https://patchwork.freedesktop.org/series/65403/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
3e28d146e83c dma-buf: Introduce selftesting framework
-:28: WARNING:CONFIG_DESCRIPTION: please write a paragraph that describes the config symbol fully
#28: FILE: drivers/dma-buf/Kconfig:42:
+config DMABUF_SELFTESTS

-:46: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#46: 
new file mode 100644

-:51: WARNING:SPDX_LICENSE_TAG: Improper SPDX comment style for 'drivers/dma-buf/selftest.c', please use '//' instead
#51: FILE: drivers/dma-buf/selftest.c:1:
+/* SPDX-License-Identifier: MIT */

-:51: WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier tag in line 1
#51: FILE: drivers/dma-buf/selftest.c:1:
+/* SPDX-License-Identifier: MIT */

-:71: ERROR:BRACKET_SPACE: space prohibited before open square bracket '['
#71: FILE: drivers/dma-buf/selftest.c:21:
+#define selftest(n, f) [__idx_##n] = { .name = #n, .func = f },

-:79: CHECK:LINE_SPACING: Please use a blank line after function/struct/union/enum declarations
#79: FILE: drivers/dma-buf/selftest.c:29:
+};
+#undef selftest

-:83: WARNING:TRAILING_SEMICOLON: macros should not use a trailing semicolon
#83: FILE: drivers/dma-buf/selftest.c:33:
+#define selftest_0(n, func, id) \
+module_param_named(id, selftests[__idx_##n].enabled, bool, 0400);

-:85: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'n' - possible side-effects?
#85: FILE: drivers/dma-buf/selftest.c:35:
+#define selftest(n, func) selftest_0(n, func, param(n))

-:224: WARNING:SPDX_LICENSE_TAG: Improper SPDX comment style for 'drivers/dma-buf/selftest.h', please use '/*' instead
#224: FILE: drivers/dma-buf/selftest.h:1:
+// SPDX-License-Identifier: MIT

-:224: WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier tag in line 1
#224: FILE: drivers/dma-buf/selftest.h:1:
+// SPDX-License-Identifier: MIT

-:235: WARNING:TRAILING_SEMICOLON: macros should not use a trailing semicolon
#235: FILE: drivers/dma-buf/selftest.h:12:
+#define selftest(name, func) int func(void);

-:248: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'T' - possible side-effects?
#248: FILE: drivers/dma-buf/selftest.h:25:
+#define subtests(T, data) \
+	__subtests(__func__, T, ARRAY_SIZE(T), data)

total: 1 errors, 8 warnings, 3 checks, 224 lines checked
92af2c1430bb dma-buf: Add selftests for dma-fence
-:35: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#35: 
new file mode 100644

-:40: WARNING:SPDX_LICENSE_TAG: Improper SPDX comment style for 'drivers/dma-buf/st-dma-fence.c', please use '//' instead
#40: FILE: drivers/dma-buf/st-dma-fence.c:1:
+/* SPDX-License-Identifier: MIT */

-:40: WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier tag in line 1
#40: FILE: drivers/dma-buf/st-dma-fence.c:1:
+/* SPDX-License-Identifier: MIT */

-:60: WARNING:USE_SPINLOCK_T: struct spinlock should be spinlock_t
#60: FILE: drivers/dma-buf/st-dma-fence.c:21:
+	struct spinlock lock;

-:192: WARNING:MEMORY_BARRIER: memory barrier without comment
#192: FILE: drivers/dma-buf/st-dma-fence.c:153:
+	smp_store_mb(container_of(cb, struct simple_cb, cb)->seen, true);

-:500: WARNING:MEMORY_BARRIER: memory barrier without comment
#500: FILE: drivers/dma-buf/st-dma-fence.c:461:
+		smp_wmb();

-:511: WARNING:MEMORY_BARRIER: memory barrier without comment
#511: FILE: drivers/dma-buf/st-dma-fence.c:472:
+		smp_store_mb(cb.seen, false);

-:534: WARNING:MEMORY_BARRIER: memory barrier without comment
#534: FILE: drivers/dma-buf/st-dma-fence.c:495:
+		smp_wmb();

-:599: WARNING:EMBEDDED_FUNCTION_NAME: Prefer using '"%s...", __func__' to using 'dma_fence', this function's name, in a string
#599: FILE: drivers/dma-buf/st-dma-fence.c:560:
+	pr_info("sizeof(dma_fence)=%lu\n", sizeof(struct dma_fence));

total: 0 errors, 9 warnings, 0 checks, 584 lines checked
ccc4463bfea8 dma-fence: Set the timestamp after the notifying the cb_list

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

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

* ✓ Fi.CI.BAT: success for series starting with [1/3] dma-buf: Introduce selftesting framework
  2019-08-19  9:59 [PATCH 1/3] dma-buf: Introduce selftesting framework Chris Wilson
                   ` (2 preceding siblings ...)
  2019-08-19 13:27 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] dma-buf: Introduce selftesting framework Patchwork
@ 2019-08-19 14:17 ` Patchwork
  2019-08-19 17:09 ` ✓ Fi.CI.IGT: " Patchwork
  2019-08-19 17:12 ` [PATCH 1/3] " Chris Wilson
  5 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2019-08-19 14:17 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/3] dma-buf: Introduce selftesting framework
URL   : https://patchwork.freedesktop.org/series/65403/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6735 -> Patchwork_14079
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/

Known issues
------------

  Here are the changes found in Patchwork_14079 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@kms_frontbuffer_tracking@basic:
    - fi-icl-u2:          [PASS][1] -> [FAIL][2] ([fdo#103167])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/fi-icl-u2/igt@kms_frontbuffer_tracking@basic.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/fi-icl-u2/igt@kms_frontbuffer_tracking@basic.html

  
#### Possible fixes ####

  * igt@gem_mmap_gtt@basic-copy:
    - fi-icl-u3:          [DMESG-WARN][3] ([fdo#107724]) -> [PASS][4]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/fi-icl-u3/igt@gem_mmap_gtt@basic-copy.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/fi-icl-u3/igt@gem_mmap_gtt@basic-copy.html

  * igt@i915_selftest@live_execlists:
    - fi-skl-gvtdvm:      [DMESG-FAIL][5] ([fdo#111108]) -> [PASS][6]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/fi-skl-gvtdvm/igt@i915_selftest@live_execlists.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/fi-skl-gvtdvm/igt@i915_selftest@live_execlists.html

  * igt@kms_frontbuffer_tracking@basic:
    - fi-hsw-peppy:       [DMESG-WARN][7] ([fdo#102614]) -> [PASS][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/fi-hsw-peppy/igt@kms_frontbuffer_tracking@basic.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/fi-hsw-peppy/igt@kms_frontbuffer_tracking@basic.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#102614]: https://bugs.freedesktop.org/show_bug.cgi?id=102614
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#111045]: https://bugs.freedesktop.org/show_bug.cgi?id=111045
  [fdo#111096]: https://bugs.freedesktop.org/show_bug.cgi?id=111096
  [fdo#111108]: https://bugs.freedesktop.org/show_bug.cgi?id=111108


Participating hosts (54 -> 46)
------------------------------

  Missing    (8): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-icl-y fi-byt-clapper fi-bdw-samus 


Build changes
-------------

  * CI: CI-20190529 -> None
  * Linux: CI_DRM_6735 -> Patchwork_14079

  CI-20190529: 20190529
  CI_DRM_6735: 5305f9021a18ff8344cb9dd74592f3c86ba3d079 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5140: 7d99ce7cab1e1e9d896bf0ddfc7227610ab77c7f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_14079: ccc4463bfea8e3a8e63d7dad9d78151bfc909646 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

ccc4463bfea8 dma-fence: Set the timestamp after the notifying the cb_list
92af2c1430bb dma-buf: Add selftests for dma-fence
3e28d146e83c dma-buf: Introduce selftesting framework

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.IGT: success for series starting with [1/3] dma-buf: Introduce selftesting framework
  2019-08-19  9:59 [PATCH 1/3] dma-buf: Introduce selftesting framework Chris Wilson
                   ` (3 preceding siblings ...)
  2019-08-19 14:17 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2019-08-19 17:09 ` Patchwork
  2019-08-19 17:12 ` [PATCH 1/3] " Chris Wilson
  5 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2019-08-19 17:09 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/3] dma-buf: Introduce selftesting framework
URL   : https://patchwork.freedesktop.org/series/65403/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6735_full -> Patchwork_14079_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  

Known issues
------------

  Here are the changes found in Patchwork_14079_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_schedule@preempt-queue-bsd1:
    - shard-iclb:         [PASS][1] -> [SKIP][2] ([fdo#109276]) +21 similar issues
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/shard-iclb2/igt@gem_exec_schedule@preempt-queue-bsd1.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/shard-iclb7/igt@gem_exec_schedule@preempt-queue-bsd1.html

  * igt@gem_exec_schedule@preemptive-hang-bsd:
    - shard-iclb:         [PASS][3] -> [SKIP][4] ([fdo#111325]) +3 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/shard-iclb7/igt@gem_exec_schedule@preemptive-hang-bsd.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/shard-iclb2/igt@gem_exec_schedule@preemptive-hang-bsd.html

  * igt@gem_workarounds@suspend-resume-context:
    - shard-apl:          [PASS][5] -> [DMESG-WARN][6] ([fdo#108566]) +1 similar issue
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/shard-apl5/igt@gem_workarounds@suspend-resume-context.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/shard-apl5/igt@gem_workarounds@suspend-resume-context.html

  * igt@kms_flip@flip-vs-expired-vblank-interruptible:
    - shard-skl:          [PASS][7] -> [FAIL][8] ([fdo#105363])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/shard-skl3/igt@kms_flip@flip-vs-expired-vblank-interruptible.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/shard-skl8/igt@kms_flip@flip-vs-expired-vblank-interruptible.html

  * igt@kms_flip@plain-flip-interruptible:
    - shard-apl:          [PASS][9] -> [INCOMPLETE][10] ([fdo#103927])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/shard-apl7/igt@kms_flip@plain-flip-interruptible.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/shard-apl2/igt@kms_flip@plain-flip-interruptible.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-draw-render:
    - shard-iclb:         [PASS][11] -> [FAIL][12] ([fdo#103167]) +2 similar issues
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/shard-iclb1/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-draw-render.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/shard-iclb2/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-draw-render.html

  * igt@kms_pipe_crc_basic@hang-read-crc-pipe-a:
    - shard-skl:          [PASS][13] -> [FAIL][14] ([fdo#103191])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/shard-skl10/igt@kms_pipe_crc_basic@hang-read-crc-pipe-a.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/shard-skl3/igt@kms_pipe_crc_basic@hang-read-crc-pipe-a.html

  * igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
    - shard-skl:          [PASS][15] -> [FAIL][16] ([fdo#108145])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/shard-skl10/igt@kms_plane_alpha_blend@pipe-a-coverage-7efc.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/shard-skl3/igt@kms_plane_alpha_blend@pipe-a-coverage-7efc.html

  * igt@kms_psr@psr2_primary_mmap_cpu:
    - shard-iclb:         [PASS][17] -> [SKIP][18] ([fdo#109441]) +2 similar issues
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/shard-iclb8/igt@kms_psr@psr2_primary_mmap_cpu.html

  
#### Possible fixes ####

  * igt@gem_ctx_isolation@rcs0-s3:
    - shard-apl:          [DMESG-WARN][19] ([fdo#108566]) -> [PASS][20] +3 similar issues
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/shard-apl6/igt@gem_ctx_isolation@rcs0-s3.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/shard-apl3/igt@gem_ctx_isolation@rcs0-s3.html

  * igt@gem_ctx_shared@exec-single-timeline-bsd:
    - shard-iclb:         [SKIP][21] ([fdo#110841]) -> [PASS][22]
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/shard-iclb4/igt@gem_ctx_shared@exec-single-timeline-bsd.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/shard-iclb7/igt@gem_ctx_shared@exec-single-timeline-bsd.html

  * igt@gem_exec_async@concurrent-writes-bsd:
    - shard-iclb:         [SKIP][23] ([fdo#111325]) -> [PASS][24] +3 similar issues
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/shard-iclb4/igt@gem_exec_async@concurrent-writes-bsd.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/shard-iclb7/igt@gem_exec_async@concurrent-writes-bsd.html

  * igt@kms_cursor_legacy@pipe-a-single-bo:
    - shard-apl:          [INCOMPLETE][25] ([fdo#103927]) -> [PASS][26] +1 similar issue
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/shard-apl5/igt@kms_cursor_legacy@pipe-a-single-bo.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/shard-apl1/igt@kms_cursor_legacy@pipe-a-single-bo.html

  * igt@kms_flip@flip-vs-fences-interruptible:
    - shard-iclb:         [INCOMPLETE][27] ([fdo#107713]) -> [PASS][28]
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/shard-iclb1/igt@kms_flip@flip-vs-fences-interruptible.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/shard-iclb4/igt@kms_flip@flip-vs-fences-interruptible.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-mmap-gtt:
    - shard-iclb:         [FAIL][29] ([fdo#103167]) -> [PASS][30] +7 similar issues
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/shard-iclb2/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-mmap-gtt.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/shard-iclb3/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-mmap-gtt.html

  * igt@kms_plane_lowres@pipe-a-tiling-x:
    - shard-iclb:         [FAIL][31] ([fdo#103166]) -> [PASS][32]
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/shard-iclb8/igt@kms_plane_lowres@pipe-a-tiling-x.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/shard-iclb8/igt@kms_plane_lowres@pipe-a-tiling-x.html

  * igt@kms_psr2_su@page_flip:
    - shard-iclb:         [SKIP][33] ([fdo#109642] / [fdo#111068]) -> [PASS][34]
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/shard-iclb8/igt@kms_psr2_su@page_flip.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/shard-iclb2/igt@kms_psr2_su@page_flip.html

  * igt@kms_psr@psr2_sprite_plane_move:
    - shard-iclb:         [SKIP][35] ([fdo#109441]) -> [PASS][36] +3 similar issues
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/shard-iclb1/igt@kms_psr@psr2_sprite_plane_move.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/shard-iclb2/igt@kms_psr@psr2_sprite_plane_move.html

  * igt@kms_vblank@pipe-a-ts-continuation-suspend:
    - shard-skl:          [INCOMPLETE][37] ([fdo#104108]) -> [PASS][38]
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/shard-skl2/igt@kms_vblank@pipe-a-ts-continuation-suspend.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/shard-skl7/igt@kms_vblank@pipe-a-ts-continuation-suspend.html

  * igt@prime_busy@hang-bsd2:
    - shard-iclb:         [SKIP][39] ([fdo#109276]) -> [PASS][40] +12 similar issues
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/shard-iclb3/igt@prime_busy@hang-bsd2.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/shard-iclb4/igt@prime_busy@hang-bsd2.html

  
#### Warnings ####

  * igt@gem_mocs_settings@mocs-isolation-bsd2:
    - shard-iclb:         [FAIL][41] ([fdo#111330]) -> [SKIP][42] ([fdo#109276])
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/shard-iclb2/igt@gem_mocs_settings@mocs-isolation-bsd2.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/shard-iclb8/igt@gem_mocs_settings@mocs-isolation-bsd2.html

  * igt@gem_mocs_settings@mocs-rc6-bsd2:
    - shard-iclb:         [SKIP][43] ([fdo#109276]) -> [FAIL][44] ([fdo#111330])
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6735/shard-iclb6/igt@gem_mocs_settings@mocs-rc6-bsd2.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/shard-iclb4/igt@gem_mocs_settings@mocs-rc6-bsd2.html

  
  [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
  [fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
  [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
  [fdo#110841]: https://bugs.freedesktop.org/show_bug.cgi?id=110841
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [fdo#111325]: https://bugs.freedesktop.org/show_bug.cgi?id=111325
  [fdo#111330]: https://bugs.freedesktop.org/show_bug.cgi?id=111330


Participating hosts (10 -> 10)
------------------------------

  No changes in participating hosts


Build changes
-------------

  * CI: CI-20190529 -> None
  * Linux: CI_DRM_6735 -> Patchwork_14079

  CI-20190529: 20190529
  CI_DRM_6735: 5305f9021a18ff8344cb9dd74592f3c86ba3d079 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5140: 7d99ce7cab1e1e9d896bf0ddfc7227610ab77c7f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_14079: ccc4463bfea8e3a8e63d7dad9d78151bfc909646 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14079/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 1/3] dma-buf: Introduce selftesting framework
  2019-08-19  9:59 [PATCH 1/3] dma-buf: Introduce selftesting framework Chris Wilson
                   ` (4 preceding siblings ...)
  2019-08-19 17:09 ` ✓ Fi.CI.IGT: " Patchwork
@ 2019-08-19 17:12 ` Chris Wilson
  5 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2019-08-19 17:12 UTC (permalink / raw)
  To: dri-devel; +Cc: Tomi Sarvela, Daniel Vetter, intel-gfx

Quoting Chris Wilson (2019-08-19 10:59:26)
> In light of recent review slip ups, the absence of a suite of tests for
> dma-buf became apparent. Given the current plethora of testing
> frameworks, opt for one already in use by Intel's CI and so allow easy
> hook up into igt.
> 
> We introduce a new module that when loaded will execute the list of
> selftests and their subtest. The names of the selftests are put into the
> modinfo as parameters so that igt can identify each, and run them
> independently, principally for ease of error reporting.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>

As a separate module with no exports, I feel confident in pushing this
with only Daniel's irc ack. As soon as it is coupled up to CI, we can
start beating on it and provide feedback for dma-fence-* / dma-resv
selftests as they are submitted.
-Chris
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2019-08-19 17:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-19  9:59 [PATCH 1/3] dma-buf: Introduce selftesting framework Chris Wilson
2019-08-19  9:59 ` [PATCH 2/3] dma-buf: Add selftests for dma-fence Chris Wilson
2019-08-19  9:59 ` [PATCH 3/3] dma-fence: Set the timestamp after the notifying the cb_list Chris Wilson
2019-08-19 13:27 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] dma-buf: Introduce selftesting framework Patchwork
2019-08-19 14:17 ` ✓ Fi.CI.BAT: success " Patchwork
2019-08-19 17:09 ` ✓ Fi.CI.IGT: " Patchwork
2019-08-19 17:12 ` [PATCH 1/3] " Chris Wilson

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.