linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/5] de-stage SW_SYNC validation frawework
@ 2016-08-11 15:26 Gustavo Padovan
  2016-08-11 15:26 ` [PATCH v3 1/5] staging/android: do not let userspace trigger WARN_ON Gustavo Padovan
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Gustavo Padovan @ 2016-08-11 15:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, devel, dri-devel, Daniel Stone,
	Arve Hjønnevåg, Riley Andrews, Daniel Vetter,
	Rob Clark, Greg Hackmann, John Harrison, Maarten Lankhorst,
	Sumit Semwal, Gustavo Padovan, pavel, eric.engestrom

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

Hi Greg,

This is the last step in the Sync Framwork de-stage task. It de-stage
the SW_SYNC validation framework and the sync_debug info debugfs file.

The first 2 patches are clean up and improvements and the rest is preparation
to de-stage and then finally the actual de-stage.

v2:
 - add documentation about the SW_SYNC ioctl API (comments from Pavel Machek)
 - remove for now patch to add sync_pt name to debugfs

v3:
 - doc improvements (comments from Eric Engestrom)
 - remove patch that removes documentation (comments from Pavel Machek)

Gustavo Padovan (5):
  staging/android: do not let userspace trigger WARN_ON
  staging/android: move trace/sync.h to sync_trace.h
  staging/android: prepare sw_sync files for de-staging
  staging/android: add Doc for SW_SYNC ioctl interface
  dma-buf/sw_sync: de-stage SW_SYNC

 drivers/dma-buf/Kconfig                            | 13 ++++++++
 drivers/dma-buf/Makefile                           |  1 +
 drivers/{staging/android => dma-buf}/sw_sync.c     | 37 ++++++++++++++++++++--
 drivers/{staging/android => dma-buf}/sync_debug.c  |  2 +-
 drivers/{staging/android => dma-buf}/sync_debug.h  |  2 +-
 .../android/trace/sync.h => dma-buf/sync_trace.h}  |  6 ++--
 drivers/staging/android/Kconfig                    | 13 --------
 drivers/staging/android/Makefile                   |  1 -
 8 files changed, 53 insertions(+), 22 deletions(-)
 rename drivers/{staging/android => dma-buf}/sw_sync.c (87%)
 rename drivers/{staging/android => dma-buf}/sync_debug.c (99%)
 rename drivers/{staging/android => dma-buf}/sync_debug.h (97%)
 rename drivers/{staging/android/trace/sync.h => dma-buf/sync_trace.h} (84%)

-- 
2.5.5

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

* [PATCH v3 1/5] staging/android: do not let userspace trigger WARN_ON
  2016-08-11 15:26 [PATCH v3 0/5] de-stage SW_SYNC validation frawework Gustavo Padovan
@ 2016-08-11 15:26 ` Gustavo Padovan
  2016-08-11 15:26 ` [PATCH v3 2/5] staging/android: move trace/sync.h to sync_trace.h Gustavo Padovan
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Gustavo Padovan @ 2016-08-11 15:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, devel, dri-devel, Daniel Stone,
	Arve Hjønnevåg, Riley Andrews, Daniel Vetter,
	Rob Clark, Greg Hackmann, John Harrison, Maarten Lankhorst,
	Sumit Semwal, Gustavo Padovan, pavel, eric.engestrom

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

Closing the timeline without waiting all fences to signal is not
a critical failure, it is just bad usage from userspace so avoid
calling WARN_ON in this case.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 drivers/staging/android/sw_sync.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c
index 115c917..bda1f6a 100644
--- a/drivers/staging/android/sw_sync.c
+++ b/drivers/staging/android/sw_sync.c
@@ -176,7 +176,7 @@ static void timeline_fence_release(struct fence *fence)
 
 	spin_lock_irqsave(fence->lock, flags);
 	list_del(&pt->child_list);
-	if (WARN_ON_ONCE(!list_empty(&pt->active_list)))
+	if (!list_empty(&pt->active_list))
 		list_del(&pt->active_list);
 	spin_unlock_irqrestore(fence->lock, flags);
 
-- 
2.5.5

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

* [PATCH v3 2/5] staging/android: move trace/sync.h to sync_trace.h
  2016-08-11 15:26 [PATCH v3 0/5] de-stage SW_SYNC validation frawework Gustavo Padovan
  2016-08-11 15:26 ` [PATCH v3 1/5] staging/android: do not let userspace trigger WARN_ON Gustavo Padovan
@ 2016-08-11 15:26 ` Gustavo Padovan
  2016-08-11 15:26 ` [PATCH v3 3/5] staging/android: prepare sw_sync files for de-staging Gustavo Padovan
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Gustavo Padovan @ 2016-08-11 15:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, devel, dri-devel, Daniel Stone,
	Arve Hjønnevåg, Riley Andrews, Daniel Vetter,
	Rob Clark, Greg Hackmann, John Harrison, Maarten Lankhorst,
	Sumit Semwal, Gustavo Padovan, pavel, eric.engestrom

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

The common behaviour for trace headers is to have them in the same folder
they are used, instead of creating a special trace/ directory.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
---
 drivers/staging/android/sw_sync.c                      | 2 +-
 drivers/staging/android/{trace/sync.h => sync_trace.h} | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
 rename drivers/staging/android/{trace/sync.h => sync_trace.h} (84%)

diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c
index bda1f6a..92c1f8b 100644
--- a/drivers/staging/android/sw_sync.c
+++ b/drivers/staging/android/sw_sync.c
@@ -23,7 +23,7 @@
 #include "sync_debug.h"
 
 #define CREATE_TRACE_POINTS
-#include "trace/sync.h"
+#include "sync_trace.h"
 
 struct sw_sync_create_fence_data {
 	__u32	value;
diff --git a/drivers/staging/android/trace/sync.h b/drivers/staging/android/sync_trace.h
similarity index 84%
rename from drivers/staging/android/trace/sync.h
rename to drivers/staging/android/sync_trace.h
index 6b5ce96..ea485f7 100644
--- a/drivers/staging/android/trace/sync.h
+++ b/drivers/staging/android/sync_trace.h
@@ -1,11 +1,11 @@
 #undef TRACE_SYSTEM
-#define TRACE_INCLUDE_PATH ../../drivers/staging/android/trace
-#define TRACE_SYSTEM sync
+#define TRACE_INCLUDE_PATH ../../drivers/staging/android
+#define TRACE_SYSTEM sync_trace
 
 #if !defined(_TRACE_SYNC_H) || defined(TRACE_HEADER_MULTI_READ)
 #define _TRACE_SYNC_H
 
-#include "../sync_debug.h"
+#include "sync_debug.h"
 #include <linux/tracepoint.h>
 
 TRACE_EVENT(sync_timeline,
-- 
2.5.5

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

* [PATCH v3 3/5] staging/android: prepare sw_sync files for de-staging
  2016-08-11 15:26 [PATCH v3 0/5] de-stage SW_SYNC validation frawework Gustavo Padovan
  2016-08-11 15:26 ` [PATCH v3 1/5] staging/android: do not let userspace trigger WARN_ON Gustavo Padovan
  2016-08-11 15:26 ` [PATCH v3 2/5] staging/android: move trace/sync.h to sync_trace.h Gustavo Padovan
@ 2016-08-11 15:26 ` Gustavo Padovan
  2016-08-11 15:26 ` [PATCH v3 4/5] staging/android: add Doc for SW_SYNC ioctl interface Gustavo Padovan
  2016-08-11 15:26 ` [PATCH v3 5/5] dma-buf/sw_sync: de-stage SW_SYNC Gustavo Padovan
  4 siblings, 0 replies; 10+ messages in thread
From: Gustavo Padovan @ 2016-08-11 15:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, devel, dri-devel, Daniel Stone,
	Arve Hjønnevåg, Riley Andrews, Daniel Vetter,
	Rob Clark, Greg Hackmann, John Harrison, Maarten Lankhorst,
	Sumit Semwal, Gustavo Padovan, pavel, eric.engestrom

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

remove file paths in the comments and add short description about each
file.

v2: remove file paths instead of just change them.

v3: improve header description as sugggested by Eric

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
---
 drivers/staging/android/sw_sync.c    | 2 +-
 drivers/staging/android/sync_debug.c | 2 +-
 drivers/staging/android/sync_debug.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c
index 92c1f8b..039e1f4 100644
--- a/drivers/staging/android/sw_sync.c
+++ b/drivers/staging/android/sw_sync.c
@@ -1,5 +1,5 @@
 /*
- * drivers/dma-buf/sw_sync.c
+ * Sync File validation framework
  *
  * Copyright (C) 2012 Google, Inc.
  *
diff --git a/drivers/staging/android/sync_debug.c b/drivers/staging/android/sync_debug.c
index 4c5a855..fab9520 100644
--- a/drivers/staging/android/sync_debug.c
+++ b/drivers/staging/android/sync_debug.c
@@ -1,5 +1,5 @@
 /*
- * drivers/base/sync.c
+ * Sync File validation framework and debug information
  *
  * Copyright (C) 2012 Google, Inc.
  *
diff --git a/drivers/staging/android/sync_debug.h b/drivers/staging/android/sync_debug.h
index fab6639..d269aa6 100644
--- a/drivers/staging/android/sync_debug.h
+++ b/drivers/staging/android/sync_debug.h
@@ -1,5 +1,5 @@
 /*
- * include/linux/sync.h
+ * Sync File validation framework and debug infomation
  *
  * Copyright (C) 2012 Google, Inc.
  *
-- 
2.5.5

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

* [PATCH v3 4/5] staging/android: add Doc for SW_SYNC ioctl interface
  2016-08-11 15:26 [PATCH v3 0/5] de-stage SW_SYNC validation frawework Gustavo Padovan
                   ` (2 preceding siblings ...)
  2016-08-11 15:26 ` [PATCH v3 3/5] staging/android: prepare sw_sync files for de-staging Gustavo Padovan
@ 2016-08-11 15:26 ` Gustavo Padovan
  2016-08-11 15:39   ` Eric Engestrom
  2016-08-11 16:45   ` [PATCH] " Gustavo Padovan
  2016-08-11 15:26 ` [PATCH v3 5/5] dma-buf/sw_sync: de-stage SW_SYNC Gustavo Padovan
  4 siblings, 2 replies; 10+ messages in thread
From: Gustavo Padovan @ 2016-08-11 15:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, devel, dri-devel, Daniel Stone,
	Arve Hjønnevåg, Riley Andrews, Daniel Vetter,
	Rob Clark, Greg Hackmann, John Harrison, Maarten Lankhorst,
	Sumit Semwal, Gustavo Padovan, pavel, eric.engestrom

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

This interface is hidden from kernel headers and it is intended for use
only for testing. So testers would have to add the ioctl information
internally. This is to prevent misuse of this feature.

v2: take in Eric suggestions for the Documentation

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
---
 drivers/staging/android/sw_sync.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c
index 039e1f4..498ab55 100644
--- a/drivers/staging/android/sw_sync.c
+++ b/drivers/staging/android/sw_sync.c
@@ -25,6 +25,36 @@
 #define CREATE_TRACE_POINTS
 #include "sync_trace.h"
 
+/*
+ * SW SYNC validation framework
+ *
+ * A sync object driver that uses a 32bit counter to coordinate
+ * synchronization.  Useful when there is no hardware primitive backing
+ * the synchronization.
+ *
+ * To start the framework just open:
+ *
+ * <debugfs>/sync/sw_sync
+ *
+ * That will create a sync timeline, all fences created under this timeline
+ * file descriptor will belong to the this timeline.
+ *
+ * The 'sw_sync' file can be opened many times as to create different
+ * timelines.
+ *
+ * Fences can be created with SW_SYNC_IOC_CREATE_FENCE ioctl with struct
+ * sw_sync_ioctl_create_fence as parameter.
+ *
+ * To increment the timeline counter, SW_SYNC_IOC_INC ioctl should be used
+ * with the increment as u32. This will update the last signaled value
+ * from the timeline and signal any fence that has seqno smaller of equal
+ * it.
+ *
+ * struct sw_sync_ioctl_create_fence
+ * @value:	the seqno to initialise the fence with
+ * @name:	the name of the new sync point
+ * @fence:	return the fd of the new sync_file with the created fence
+ */
 struct sw_sync_create_fence_data {
 	__u32	value;
 	char	name[32];
@@ -35,6 +65,7 @@ struct sw_sync_create_fence_data {
 
 #define SW_SYNC_IOC_CREATE_FENCE	_IOWR(SW_SYNC_IOC_MAGIC, 0,\
 		struct sw_sync_create_fence_data)
+
 #define SW_SYNC_IOC_INC			_IOW(SW_SYNC_IOC_MAGIC, 1, __u32)
 
 static const struct fence_ops timeline_fence_ops;
-- 
2.5.5

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

* [PATCH v3 5/5] dma-buf/sw_sync: de-stage SW_SYNC
  2016-08-11 15:26 [PATCH v3 0/5] de-stage SW_SYNC validation frawework Gustavo Padovan
                   ` (3 preceding siblings ...)
  2016-08-11 15:26 ` [PATCH v3 4/5] staging/android: add Doc for SW_SYNC ioctl interface Gustavo Padovan
@ 2016-08-11 15:26 ` Gustavo Padovan
  4 siblings, 0 replies; 10+ messages in thread
From: Gustavo Padovan @ 2016-08-11 15:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, devel, dri-devel, Daniel Stone,
	Arve Hjønnevåg, Riley Andrews, Daniel Vetter,
	Rob Clark, Greg Hackmann, John Harrison, Maarten Lankhorst,
	Sumit Semwal, Gustavo Padovan, pavel, eric.engestrom

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

SW_SYNC allows to run tests on the sync_file framework via debugfs on

<debugfs>/sync/sw_sync

Opening and closing the file triggers creation and release of a sync
timeline. To create fences on this timeline the SW_SYNC_IOC_CREATE_FENCE
ioctl should be used. To increment the timeline value use SW_SYNC_IOC_INC.

Also it exports Sync information on

<debugfs>/sync/info

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
---
 drivers/dma-buf/Kconfig                           | 13 +++++++++++++
 drivers/dma-buf/Makefile                          |  1 +
 drivers/{staging/android => dma-buf}/sw_sync.c    |  0
 drivers/{staging/android => dma-buf}/sync_debug.c |  0
 drivers/{staging/android => dma-buf}/sync_debug.h |  0
 drivers/{staging/android => dma-buf}/sync_trace.h |  2 +-
 drivers/staging/android/Kconfig                   | 13 -------------
 drivers/staging/android/Makefile                  |  1 -
 8 files changed, 15 insertions(+), 15 deletions(-)
 rename drivers/{staging/android => dma-buf}/sw_sync.c (100%)
 rename drivers/{staging/android => dma-buf}/sync_debug.c (100%)
 rename drivers/{staging/android => dma-buf}/sync_debug.h (100%)
 rename drivers/{staging/android => dma-buf}/sync_trace.h (92%)

diff --git a/drivers/dma-buf/Kconfig b/drivers/dma-buf/Kconfig
index 25bcfa0..2585821 100644
--- a/drivers/dma-buf/Kconfig
+++ b/drivers/dma-buf/Kconfig
@@ -17,4 +17,17 @@ config SYNC_FILE
 	  Files fds, to the DRM driver for example. More details at
 	  Documentation/sync_file.txt.
 
+config SW_SYNC
+	bool "Sync File Validation Framework"
+	default n
+	depends on SYNC_FILE
+	depends on DEBUG_FS
+	---help---
+	  A sync object driver that uses a 32bit counter to coordinate
+	  synchronization.  Useful when there is no hardware primitive backing
+	  the synchronization.
+
+	  WARNING: improper use of this can result in deadlocking kernel
+	  drivers from userspace. Intended for test and debug only.
+
 endmenu
diff --git a/drivers/dma-buf/Makefile b/drivers/dma-buf/Makefile
index f353db2..210a10b 100644
--- a/drivers/dma-buf/Makefile
+++ b/drivers/dma-buf/Makefile
@@ -1,2 +1,3 @@
 obj-y := dma-buf.o fence.o reservation.o seqno-fence.o fence-array.o
 obj-$(CONFIG_SYNC_FILE)		+= sync_file.o
+obj-$(CONFIG_SW_SYNC)		+= sw_sync.o sync_debug.o
diff --git a/drivers/staging/android/sw_sync.c b/drivers/dma-buf/sw_sync.c
similarity index 100%
rename from drivers/staging/android/sw_sync.c
rename to drivers/dma-buf/sw_sync.c
diff --git a/drivers/staging/android/sync_debug.c b/drivers/dma-buf/sync_debug.c
similarity index 100%
rename from drivers/staging/android/sync_debug.c
rename to drivers/dma-buf/sync_debug.c
diff --git a/drivers/staging/android/sync_debug.h b/drivers/dma-buf/sync_debug.h
similarity index 100%
rename from drivers/staging/android/sync_debug.h
rename to drivers/dma-buf/sync_debug.h
diff --git a/drivers/staging/android/sync_trace.h b/drivers/dma-buf/sync_trace.h
similarity index 92%
rename from drivers/staging/android/sync_trace.h
rename to drivers/dma-buf/sync_trace.h
index ea485f7..d13d59f 100644
--- a/drivers/staging/android/sync_trace.h
+++ b/drivers/dma-buf/sync_trace.h
@@ -1,5 +1,5 @@
 #undef TRACE_SYSTEM
-#define TRACE_INCLUDE_PATH ../../drivers/staging/android
+#define TRACE_INCLUDE_PATH ../../drivers/dma-buf
 #define TRACE_SYSTEM sync_trace
 
 #if !defined(_TRACE_SYNC_H) || defined(TRACE_HEADER_MULTI_READ)
diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig
index 06e41d2..6c00d6f 100644
--- a/drivers/staging/android/Kconfig
+++ b/drivers/staging/android/Kconfig
@@ -24,19 +24,6 @@ config ANDROID_LOW_MEMORY_KILLER
 	  scripts (/init.rc), and it defines priority values with minimum free memory size
 	  for each priority.
 
-config SW_SYNC
-	bool "Software synchronization framework"
-	default n
-	depends on SYNC_FILE
-	depends on DEBUG_FS
-	---help---
-	  A sync object driver that uses a 32bit counter to coordinate
-	  synchronization.  Useful when there is no hardware primitive backing
-	  the synchronization.
-
-	  WARNING: improper use of this can result in deadlocking kernel
-	  drivers from userspace. Intended for test and debug only.
-
 source "drivers/staging/android/ion/Kconfig"
 
 endif # if ANDROID
diff --git a/drivers/staging/android/Makefile b/drivers/staging/android/Makefile
index 7ca61b7..7ed1be7 100644
--- a/drivers/staging/android/Makefile
+++ b/drivers/staging/android/Makefile
@@ -4,4 +4,3 @@ obj-y					+= ion/
 
 obj-$(CONFIG_ASHMEM)			+= ashmem.o
 obj-$(CONFIG_ANDROID_LOW_MEMORY_KILLER)	+= lowmemorykiller.o
-obj-$(CONFIG_SW_SYNC)			+= sw_sync.o sync_debug.o
-- 
2.5.5

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

* Re: [PATCH v3 4/5] staging/android: add Doc for SW_SYNC ioctl interface
  2016-08-11 15:26 ` [PATCH v3 4/5] staging/android: add Doc for SW_SYNC ioctl interface Gustavo Padovan
@ 2016-08-11 15:39   ` Eric Engestrom
  2016-08-11 16:41     ` Gustavo Padovan
  2016-08-11 16:45   ` [PATCH] " Gustavo Padovan
  1 sibling, 1 reply; 10+ messages in thread
From: Eric Engestrom @ 2016-08-11 15:39 UTC (permalink / raw)
  To: Gustavo Padovan
  Cc: Greg Kroah-Hartman, linux-kernel, devel, dri-devel, Daniel Stone,
	Arve Hjønnevåg, Riley Andrews, Daniel Vetter,
	Rob Clark, Greg Hackmann, John Harrison, Maarten Lankhorst,
	Sumit Semwal, Gustavo Padovan, pavel

On Thu, Aug 11, 2016 at 12:26:43PM -0300, Gustavo Padovan wrote:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> 
> This interface is hidden from kernel headers and it is intended for use
> only for testing. So testers would have to add the ioctl information
> internally. This is to prevent misuse of this feature.
> 
> v2: take in Eric suggestions for the Documentation
> 
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
> ---
>  drivers/staging/android/sw_sync.c | 31 +++++++++++++++++++++++++++++++
>  1 file changed, 31 insertions(+)
> 
> diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c
> index 039e1f4..498ab55 100644
> --- a/drivers/staging/android/sw_sync.c
> +++ b/drivers/staging/android/sw_sync.c
> @@ -25,6 +25,36 @@
>  #define CREATE_TRACE_POINTS
>  #include "sync_trace.h"
>  
> +/*
> + * SW SYNC validation framework
> + *
> + * A sync object driver that uses a 32bit counter to coordinate
> + * synchronization.  Useful when there is no hardware primitive backing
> + * the synchronization.
> + *
> + * To start the framework just open:
> + *
> + * <debugfs>/sync/sw_sync
> + *
> + * That will create a sync timeline, all fences created under this timeline
> + * file descriptor will belong to the this timeline.
> + *
> + * The 'sw_sync' file can be opened many times as to create different
> + * timelines.
> + *
> + * Fences can be created with SW_SYNC_IOC_CREATE_FENCE ioctl with struct
> + * sw_sync_ioctl_create_fence as parameter.
> + *
> + * To increment the timeline counter, SW_SYNC_IOC_INC ioctl should be used
> + * with the increment as u32. This will update the last signaled value
> + * from the timeline and signal any fence that has seqno smaller of equal
> + * it.

You didn't fix all of it: "that has a seqno smaller or equal to it."
Missing "a" (just noticed), s/of/or/, and missing "to"  :)

Cheers,
  Eric

> + *
> + * struct sw_sync_ioctl_create_fence
> + * @value:	the seqno to initialise the fence with
> + * @name:	the name of the new sync point
> + * @fence:	return the fd of the new sync_file with the created fence
> + */
>  struct sw_sync_create_fence_data {
>  	__u32	value;
>  	char	name[32];
> @@ -35,6 +65,7 @@ struct sw_sync_create_fence_data {
>  
>  #define SW_SYNC_IOC_CREATE_FENCE	_IOWR(SW_SYNC_IOC_MAGIC, 0,\
>  		struct sw_sync_create_fence_data)
> +
>  #define SW_SYNC_IOC_INC			_IOW(SW_SYNC_IOC_MAGIC, 1, __u32)
>  
>  static const struct fence_ops timeline_fence_ops;
> -- 
> 2.5.5
> 

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

* Re: [PATCH v3 4/5] staging/android: add Doc for SW_SYNC ioctl interface
  2016-08-11 15:39   ` Eric Engestrom
@ 2016-08-11 16:41     ` Gustavo Padovan
  0 siblings, 0 replies; 10+ messages in thread
From: Gustavo Padovan @ 2016-08-11 16:41 UTC (permalink / raw)
  To: Eric Engestrom
  Cc: Gustavo Padovan, Greg Kroah-Hartman, linux-kernel, devel,
	dri-devel, Daniel Stone, Arve Hjønnevåg, Riley Andrews,
	Daniel Vetter, Rob Clark, Greg Hackmann, John Harrison,
	Maarten Lankhorst, Sumit Semwal, Gustavo Padovan, pavel

2016-08-11 Eric Engestrom <eric.engestrom@imgtec.com>:

> On Thu, Aug 11, 2016 at 12:26:43PM -0300, Gustavo Padovan wrote:
> > From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> > 
> > This interface is hidden from kernel headers and it is intended for use
> > only for testing. So testers would have to add the ioctl information
> > internally. This is to prevent misuse of this feature.
> > 
> > v2: take in Eric suggestions for the Documentation
> > 
> > Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> > Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
> > ---
> >  drivers/staging/android/sw_sync.c | 31 +++++++++++++++++++++++++++++++
> >  1 file changed, 31 insertions(+)
> > 
> > diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c
> > index 039e1f4..498ab55 100644
> > --- a/drivers/staging/android/sw_sync.c
> > +++ b/drivers/staging/android/sw_sync.c
> > @@ -25,6 +25,36 @@
> >  #define CREATE_TRACE_POINTS
> >  #include "sync_trace.h"
> >  
> > +/*
> > + * SW SYNC validation framework
> > + *
> > + * A sync object driver that uses a 32bit counter to coordinate
> > + * synchronization.  Useful when there is no hardware primitive backing
> > + * the synchronization.
> > + *
> > + * To start the framework just open:
> > + *
> > + * <debugfs>/sync/sw_sync
> > + *
> > + * That will create a sync timeline, all fences created under this timeline
> > + * file descriptor will belong to the this timeline.
> > + *
> > + * The 'sw_sync' file can be opened many times as to create different
> > + * timelines.
> > + *
> > + * Fences can be created with SW_SYNC_IOC_CREATE_FENCE ioctl with struct
> > + * sw_sync_ioctl_create_fence as parameter.
> > + *
> > + * To increment the timeline counter, SW_SYNC_IOC_INC ioctl should be used
> > + * with the increment as u32. This will update the last signaled value
> > + * from the timeline and signal any fence that has seqno smaller of equal
> > + * it.
> 
> You didn't fix all of it: "that has a seqno smaller or equal to it."
> Missing "a" (just noticed), s/of/or/, and missing "to"  :)

Oh. Right. I didn't pay attention to all your fixes in that phrase.
Thanks. I'll send an updated patch.

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

* [PATCH] staging/android: add Doc for SW_SYNC ioctl interface
  2016-08-11 15:26 ` [PATCH v3 4/5] staging/android: add Doc for SW_SYNC ioctl interface Gustavo Padovan
  2016-08-11 15:39   ` Eric Engestrom
@ 2016-08-11 16:45   ` Gustavo Padovan
  2016-08-18 12:07     ` Pavel Machek
  1 sibling, 1 reply; 10+ messages in thread
From: Gustavo Padovan @ 2016-08-11 16:45 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, devel, dri-devel, Daniel Stone,
	Arve Hjønnevåg, Riley Andrews, Daniel Vetter,
	Rob Clark, Greg Hackmann, John Harrison, Maarten Lankhorst,
	Sumit Semwal, Gustavo Padovan, pavel, eric.engestrom

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

This interface is hidden from kernel headers and it is intended for use
only for testing. So testers would have to add the ioctl information
internally. This is to prevent misuse of this feature.

v2: take in Eric suggestions for the Documentation

v3: really take in Eric suggestions

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
---
 drivers/staging/android/sw_sync.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c
index 039e1f4..62e8e6d 100644
--- a/drivers/staging/android/sw_sync.c
+++ b/drivers/staging/android/sw_sync.c
@@ -25,6 +25,36 @@
 #define CREATE_TRACE_POINTS
 #include "sync_trace.h"
 
+/*
+ * SW SYNC validation framework
+ *
+ * A sync object driver that uses a 32bit counter to coordinate
+ * synchronization.  Useful when there is no hardware primitive backing
+ * the synchronization.
+ *
+ * To start the framework just open:
+ *
+ * <debugfs>/sync/sw_sync
+ *
+ * That will create a sync timeline, all fences created under this timeline
+ * file descriptor will belong to the this timeline.
+ *
+ * The 'sw_sync' file can be opened many times as to create different
+ * timelines.
+ *
+ * Fences can be created with SW_SYNC_IOC_CREATE_FENCE ioctl with struct
+ * sw_sync_ioctl_create_fence as parameter.
+ *
+ * To increment the timeline counter, SW_SYNC_IOC_INC ioctl should be used
+ * with the increment as u32. This will update the last signaled value
+ * from the timeline and signal any fence that has a seqno smaller or equal
+ * to it.
+ *
+ * struct sw_sync_ioctl_create_fence
+ * @value:	the seqno to initialise the fence with
+ * @name:	the name of the new sync point
+ * @fence:	return the fd of the new sync_file with the created fence
+ */
 struct sw_sync_create_fence_data {
 	__u32	value;
 	char	name[32];
@@ -35,6 +65,7 @@ struct sw_sync_create_fence_data {
 
 #define SW_SYNC_IOC_CREATE_FENCE	_IOWR(SW_SYNC_IOC_MAGIC, 0,\
 		struct sw_sync_create_fence_data)
+
 #define SW_SYNC_IOC_INC			_IOW(SW_SYNC_IOC_MAGIC, 1, __u32)
 
 static const struct fence_ops timeline_fence_ops;
-- 
2.5.5

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

* Re: [PATCH] staging/android: add Doc for SW_SYNC ioctl interface
  2016-08-11 16:45   ` [PATCH] " Gustavo Padovan
@ 2016-08-18 12:07     ` Pavel Machek
  0 siblings, 0 replies; 10+ messages in thread
From: Pavel Machek @ 2016-08-18 12:07 UTC (permalink / raw)
  To: Gustavo Padovan
  Cc: Greg Kroah-Hartman, linux-kernel, devel, dri-devel, Daniel Stone,
	Arve Hjønnevåg, Riley Andrews, Daniel Vetter,
	Rob Clark, Greg Hackmann, John Harrison, Maarten Lankhorst,
	Sumit Semwal, Gustavo Padovan, eric.engestrom

On Thu 2016-08-11 13:45:53, Gustavo Padovan wrote:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> 
> This interface is hidden from kernel headers and it is intended for use
> only for testing. So testers would have to add the ioctl information
> internally. This is to prevent misuse of this feature.
> 
> v2: take in Eric suggestions for the Documentation
> 
> v3: really take in Eric suggestions
> 
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>

Acked-by: Pavel Machek <pavel@ucw.cz>

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

end of thread, other threads:[~2016-08-18 12:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-11 15:26 [PATCH v3 0/5] de-stage SW_SYNC validation frawework Gustavo Padovan
2016-08-11 15:26 ` [PATCH v3 1/5] staging/android: do not let userspace trigger WARN_ON Gustavo Padovan
2016-08-11 15:26 ` [PATCH v3 2/5] staging/android: move trace/sync.h to sync_trace.h Gustavo Padovan
2016-08-11 15:26 ` [PATCH v3 3/5] staging/android: prepare sw_sync files for de-staging Gustavo Padovan
2016-08-11 15:26 ` [PATCH v3 4/5] staging/android: add Doc for SW_SYNC ioctl interface Gustavo Padovan
2016-08-11 15:39   ` Eric Engestrom
2016-08-11 16:41     ` Gustavo Padovan
2016-08-11 16:45   ` [PATCH] " Gustavo Padovan
2016-08-18 12:07     ` Pavel Machek
2016-08-11 15:26 ` [PATCH v3 5/5] dma-buf/sw_sync: de-stage SW_SYNC Gustavo Padovan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).