summaryrefslogtreecommitdiffstats
path: root/include/linux/dma-resv.h
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2021-05-06 14:16:01 +0200
committerChristian König <christian.koenig@amd.com>2021-06-04 14:04:59 +0200
commit0c6b522abc2a592468992780babd3c3629c7ceac (patch)
tree91c506b02a3b2db54295638d92eb2c1a3e6247b2 /include/linux/dma-resv.h
parent068d9d754bc15f30ff2f73b9f50aba85420a08b2 (diff)
downloadlinux-stable-0c6b522abc2a592468992780babd3c3629c7ceac.tar.gz
linux-stable-0c6b522abc2a592468992780babd3c3629c7ceac.tar.bz2
linux-stable-0c6b522abc2a592468992780babd3c3629c7ceac.zip
dma-buf: cleanup dma-resv shared fence debugging a bit v2
Make that a function instead of inline. v2: improve the kerneldoc wording as suggested by Daniel Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210602111714.212426-3-christian.koenig@amd.com
Diffstat (limited to 'include/linux/dma-resv.h')
-rw-r--r--include/linux/dma-resv.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/include/linux/dma-resv.h b/include/linux/dma-resv.h
index d44a77e8a7e3..f32a3d176513 100644
--- a/include/linux/dma-resv.h
+++ b/include/linux/dma-resv.h
@@ -92,6 +92,12 @@ static inline struct dma_resv_list *dma_resv_get_list(struct dma_resv *obj)
dma_resv_held(obj));
}
+#ifdef CONFIG_DEBUG_MUTEXES
+void dma_resv_reset_shared_max(struct dma_resv *obj);
+#else
+static inline void dma_resv_reset_shared_max(struct dma_resv *obj) {}
+#endif
+
/**
* dma_resv_lock - lock the reservation object
* @obj: the reservation object
@@ -215,14 +221,7 @@ static inline struct ww_acquire_ctx *dma_resv_locking_ctx(struct dma_resv *obj)
*/
static inline void dma_resv_unlock(struct dma_resv *obj)
{
-#ifdef CONFIG_DEBUG_MUTEXES
- /* Test shared fence slot reservation */
- if (rcu_access_pointer(obj->fence)) {
- struct dma_resv_list *fence = dma_resv_get_list(obj);
-
- fence->shared_max = fence->shared_count;
- }
-#endif
+ dma_resv_reset_shared_max(obj);
ww_mutex_unlock(&obj->lock);
}