mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gustavo Padovan <gustavo@padovan.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
	dri-devel@lists.freedesktop.org,
	"Daniel Stone" <daniels@collabora.com>,
	"Arve Hjønnevåg" <arve@android.com>,
	"Riley Andrews" <riandrews@android.com>,
	"Daniel Vetter" <daniel.vetter@ffwll.ch>,
	"Rob Clark" <robdclark@gmail.com>,
	"Greg Hackmann" <ghackmann@google.com>,
	"John Harrison" <John.C.Harrison@Intel.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Gustavo Padovan" <gustavo.padovan@collabora.co.uk>
Subject: [PATCH 02/11] staging/android: sync: remove interfaces that are not used
Date: Thu, 21 Jan 2016 10:49:15 -0200	[thread overview]
Message-ID: <1453380564-3328-3-git-send-email-gustavo@padovan.org> (raw)
In-Reply-To: <1453380564-3328-1-git-send-email-gustavo@padovan.org>

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

These interfaces are not used nor have plans to be used in the near
future so remove them for a cleaner solution before de-staging the sync
framework.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 drivers/staging/android/sync.c       | 56 ------------------------------------
 drivers/staging/android/sync.h       | 50 --------------------------------
 drivers/staging/android/sync_debug.c | 15 ----------
 3 files changed, 121 deletions(-)

diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
index ed43796..7a84f88 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/staging/android/sync.c
@@ -317,62 +317,6 @@ struct sync_fence *sync_fence_merge(const char *name,
 }
 EXPORT_SYMBOL(sync_fence_merge);
 
-int sync_fence_wake_up_wq(wait_queue_t *curr, unsigned mode,
-			  int wake_flags, void *key)
-{
-	struct sync_fence_waiter *wait;
-
-	wait = container_of(curr, struct sync_fence_waiter, work);
-	list_del_init(&wait->work.task_list);
-
-	wait->callback(wait->work.private, wait);
-	return 1;
-}
-
-int sync_fence_wait_async(struct sync_fence *fence,
-			  struct sync_fence_waiter *waiter)
-{
-	int err = atomic_read(&fence->status);
-	unsigned long flags;
-
-	if (err < 0)
-		return err;
-
-	if (!err)
-		return 1;
-
-	init_waitqueue_func_entry(&waiter->work, sync_fence_wake_up_wq);
-	waiter->work.private = fence;
-
-	spin_lock_irqsave(&fence->wq.lock, flags);
-	err = atomic_read(&fence->status);
-	if (err > 0)
-		__add_wait_queue_tail(&fence->wq, &waiter->work);
-	spin_unlock_irqrestore(&fence->wq.lock, flags);
-
-	if (err < 0)
-		return err;
-
-	return !err;
-}
-EXPORT_SYMBOL(sync_fence_wait_async);
-
-int sync_fence_cancel_async(struct sync_fence *fence,
-			    struct sync_fence_waiter *waiter)
-{
-	unsigned long flags;
-	int ret = 0;
-
-	spin_lock_irqsave(&fence->wq.lock, flags);
-	if (!list_empty(&waiter->work.task_list))
-		list_del_init(&waiter->work.task_list);
-	else
-		ret = -ENOENT;
-	spin_unlock_irqrestore(&fence->wq.lock, flags);
-	return ret;
-}
-EXPORT_SYMBOL(sync_fence_cancel_async);
-
 int sync_fence_wait(struct sync_fence *fence, long timeout)
 {
 	long ret;
diff --git a/drivers/staging/android/sync.h b/drivers/staging/android/sync.h
index 7a4d820..e0865b9 100644
--- a/drivers/staging/android/sync.h
+++ b/drivers/staging/android/sync.h
@@ -159,27 +159,6 @@ struct sync_fence {
 	struct sync_fence_cb	cbs[];
 };
 
-struct sync_fence_waiter;
-typedef void (*sync_callback_t)(struct sync_fence *fence,
-				struct sync_fence_waiter *waiter);
-
-/**
- * struct sync_fence_waiter - metadata for asynchronous waiter on a fence
- * @work:		wait_queue for the fence waiter
- * @callback:		function pointer to call when fence signals
- */
-struct sync_fence_waiter {
-	wait_queue_t work;
-	sync_callback_t callback;
-};
-
-static inline void sync_fence_waiter_init(struct sync_fence_waiter *waiter,
-					  sync_callback_t callback)
-{
-	INIT_LIST_HEAD(&waiter->work.task_list);
-	waiter->callback = callback;
-}
-
 /*
  * API for sync_timeline implementers
  */
@@ -304,33 +283,6 @@ void sync_fence_put(struct sync_fence *fence);
 void sync_fence_install(struct sync_fence *fence, int fd);
 
 /**
- * sync_fence_wait_async() - registers and async wait on the fence
- * @fence:		fence to wait on
- * @waiter:		waiter callback struck
- *
- * Registers a callback to be called when @fence signals or has an error.
- * @waiter should be initialized with sync_fence_waiter_init().
- *
- * Returns 1 if @fence has already signaled, 0 if not or <0 if error.
- */
-int sync_fence_wait_async(struct sync_fence *fence,
-			  struct sync_fence_waiter *waiter);
-
-/**
- * sync_fence_cancel_async() - cancels an async wait
- * @fence:		fence to wait on
- * @waiter:		waiter callback struck
- *
- * Cancels a previously registered async wait.  Will fail gracefully if
- * @waiter was never registered or if @fence has already signaled @waiter.
- *
- * Returns 0 if waiter was removed from fence's async waiter list.
- * Returns -ENOENT if waiter was not found on fence's async waiter list.
- */
-int sync_fence_cancel_async(struct sync_fence *fence,
-			    struct sync_fence_waiter *waiter);
-
-/**
  * sync_fence_wait() - wait on fence
  * @fence:	fence to wait on
  * @tiemout:	timeout in ms
@@ -357,7 +309,5 @@ void sync_dump(void);
 # define sync_fence_debug_remove(fence)
 # define sync_dump()
 #endif
-int sync_fence_wake_up_wq(wait_queue_t *curr, unsigned mode,
-				 int wake_flags, void *key);
 
 #endif /* _LINUX_SYNC_H */
diff --git a/drivers/staging/android/sync_debug.c b/drivers/staging/android/sync_debug.c
index f45d13c..b366461 100644
--- a/drivers/staging/android/sync_debug.c
+++ b/drivers/staging/android/sync_debug.c
@@ -151,8 +151,6 @@ static void sync_print_obj(struct seq_file *s, struct sync_timeline *obj)
 
 static void sync_print_fence(struct seq_file *s, struct sync_fence *fence)
 {
-	wait_queue_t *pos;
-	unsigned long flags;
 	int i;
 
 	seq_printf(s, "[%p] %s: %s\n", fence, fence->name,
@@ -161,19 +159,6 @@ static void sync_print_fence(struct seq_file *s, struct sync_fence *fence)
 	for (i = 0; i < fence->num_fences; ++i) {
 		sync_print_pt(s, fence->cbs[i].sync_pt, true);
 	}
-
-	spin_lock_irqsave(&fence->wq.lock, flags);
-	list_for_each_entry(pos, &fence->wq.task_list, task_list) {
-		struct sync_fence_waiter *waiter;
-
-		if (pos->func != &sync_fence_wake_up_wq)
-			continue;
-
-		waiter = container_of(pos, struct sync_fence_waiter, work);
-
-		seq_printf(s, "waiter %pF\n", waiter->callback);
-	}
-	spin_unlock_irqrestore(&fence->wq.lock, flags);
 }
 
 static int sync_debugfs_show(struct seq_file *s, void *unused)
-- 
2.5.0

  parent reply	other threads:[~2016-01-21 12:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-21 12:49 [PATCH 00/11] sync framework de-staging: part 1 - clean up Gustavo Padovan
2016-01-21 12:49 ` [PATCH 01/11] staging/android: fix sync framework documentation Gustavo Padovan
2016-01-21 12:49 ` Gustavo Padovan [this message]
2016-01-21 12:49 ` [PATCH 03/11] staging/android: remove not used sync_timeline ops Gustavo Padovan
2016-01-21 12:49 ` [PATCH 04/11] staging/android: create a 'sync' dir for debugfs information Gustavo Padovan
2016-01-21 12:49 ` [PATCH 05/11] staging/android: move SW_SYNC_USER to a debugfs file Gustavo Padovan
2016-01-21 12:49 ` [PATCH 06/11] staging/android: rename sync_fence to sync_file Gustavo Padovan
2016-01-21 12:49 ` [PATCH 07/11] staging/android: rename 'sync_pt' to 'fence' in struct sync_fence_cb Gustavo Padovan
2016-01-21 12:49 ` [PATCH 08/11] staging/android: remove struct sync_pt Gustavo Padovan
2016-01-21 12:49 ` [PATCH 09/11] staging/android: remove unused var from sync_timeline_signal() Gustavo Padovan
2016-01-21 12:49 ` [PATCH 10/11] staging/android: remove pointless sync_timeline_signal at destroy phase Gustavo Padovan
2016-01-21 12:49 ` [PATCH 11/11] staging/android: remove sync_fence_create_dma() Gustavo Padovan
2016-01-25 11:23 ` [PATCH 00/11] sync framework de-staging: part 1 - clean up Maarten Lankhorst
2016-01-29 14:47   ` Gustavo Padovan
2016-01-29 16:10     ` Greg Kroah-Hartman

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=1453380564-3328-3-git-send-email-gustavo@padovan.org \
    --to=gustavo@padovan.org \
    --cc=John.C.Harrison@Intel.com \
    --cc=arve@android.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniels@collabora.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ghackmann@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavo.padovan@collabora.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=riandrews@android.com \
    --cc=robdclark@gmail.com \
    /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

all inboxes | Powered by JetHome®