Skip to content

Commit 6decf70

Browse files
dept: Apply Dept to dma fence's default wait and wakeup
Makes Dept able to track dma fence things. Let's start with applying to default wait and default wait callback(wakeup). Signed-off-by: Byungchul Park <byungchul.park@lge.com>
1 parent 8e9a7ed commit 6decf70

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

drivers/dma-buf/dma-fence.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/dma-fence.h>
1717
#include <linux/sched/signal.h>
1818
#include <linux/seq_file.h>
19+
#include <linux/dept_sdt.h>
1920

2021
#define CREATE_TRACE_POINTS
2122
#include <trace/events/dma_fence.h>
@@ -741,6 +742,7 @@ dma_fence_default_wait_cb(struct dma_fence *fence, struct dma_fence_cb *cb)
741742
struct default_wait_cb *wait =
742743
container_of(cb, struct default_wait_cb, base);
743744

745+
sdt_event(&fence->dmap);
744746
wake_up_state(wait->task, TASK_NORMAL);
745747
}
746748

@@ -789,6 +791,7 @@ dma_fence_default_wait(struct dma_fence *fence, bool intr, signed long timeout)
789791
__set_current_state(TASK_UNINTERRUPTIBLE);
790792
spin_unlock_irqrestore(fence->lock, flags);
791793

794+
sdt_wait(&fence->dmap);
792795
ret = schedule_timeout(ret);
793796

794797
spin_lock_irqsave(fence->lock, flags);
@@ -950,6 +953,7 @@ dma_fence_init(struct dma_fence *fence, const struct dma_fence_ops *ops,
950953
BUG_ON(!lock);
951954
BUG_ON(!ops || !ops->get_driver_name || !ops->get_timeline_name);
952955

956+
sdt_map_init(&fence->dmap);
953957
kref_init(&fence->refcount);
954958
fence->ops = ops;
955959
INIT_LIST_HEAD(&fence->cb_list);

include/linux/dma-fence.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <linux/sched.h>
2222
#include <linux/printk.h>
2323
#include <linux/rcupdate.h>
24+
#include <linux/dept.h>
2425

2526
struct dma_fence;
2627
struct dma_fence_ops;
@@ -93,6 +94,7 @@ struct dma_fence {
9394
unsigned long flags;
9495
struct kref refcount;
9596
int error;
97+
struct dept_map dmap;
9698
};
9799

98100
enum dma_fence_flag_bits {

0 commit comments

Comments
 (0)