aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2019-08-05 14:24:55 +0200
committerChristian König <christian.koenig@amd.com>2019-08-13 09:07:58 +0200
commit5d344f58da760b226562e7d5199fb73294eb93fa (patch)
treedabe9434fb720c4c0d80b7078cccf3acde6e0f9a /include/linux
parentdma-buf/sw_sync: Synchronize signal vs syncpt free (diff)
downloadwireguard-linux-5d344f58da760b226562e7d5199fb73294eb93fa.tar.xz
wireguard-linux-5d344f58da760b226562e7d5199fb73294eb93fa.zip
dma-buf: nuke reservation_object seq number
The only remaining use for this is to protect against setting a new exclusive fence while we grab both exclusive and shared. That can also be archived by looking if the exclusive fence has changed or not after completing the operation. v2: switch setting excl fence to rcu_assign_pointer Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/322380/
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/reservation.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/include/linux/reservation.h b/include/linux/reservation.h
index c6c8c93785c4..acddefea694f 100644
--- a/include/linux/reservation.h
+++ b/include/linux/reservation.h
@@ -46,8 +46,6 @@
#include <linux/rcupdate.h>
extern struct ww_class reservation_ww_class;
-extern struct lock_class_key reservation_seqcount_class;
-extern const char reservation_seqcount_string[];
/**
* struct reservation_object_list - a list of shared fences
@@ -71,7 +69,6 @@ struct reservation_object_list {
*/
struct reservation_object {
struct ww_mutex lock;
- seqcount_t seq;
struct dma_fence __rcu *fence_excl;
struct reservation_object_list __rcu *fence;
@@ -130,14 +127,12 @@ reservation_object_fences(struct reservation_object *obj,
struct reservation_object_list **list,
u32 *shared_count)
{
- unsigned int seq;
-
do {
- seq = read_seqcount_begin(&obj->seq);
*excl = rcu_dereference(obj->fence_excl);
*list = rcu_dereference(obj->fence);
*shared_count = *list ? (*list)->shared_count : 0;
- } while (read_seqcount_retry(&obj->seq, seq));
+ smp_rmb(); /* See reservation_object_add_excl_fence */
+ } while (rcu_access_pointer(obj->fence_excl) != *excl);
}
/**