[CI 11/12] debug
Tvrtko Ursulin
tvrtko.ursulin at linux.intel.com
Wed Feb 15 16:17:22 UTC 2023
From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
drivers/dma-buf/dma-fence-chain.c | 11 ++++++++++-
drivers/dma-buf/st-dma-fence-chain.c | 18 +++++++++++++-----
2 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/drivers/dma-buf/dma-fence-chain.c b/drivers/dma-buf/dma-fence-chain.c
index a0d920576ba6..68684d54c78b 100644
--- a/drivers/dma-buf/dma-fence-chain.c
+++ b/drivers/dma-buf/dma-fence-chain.c
@@ -126,9 +126,12 @@ static void dma_fence_chain_irq_work(struct irq_work *work)
chain = container_of(work, typeof(*chain), work);
/* Try to rearm the callback */
- if (!dma_fence_chain_enable_signaling(&chain->base))
+ if (!dma_fence_chain_enable_signaling(&chain->base)) {
/* Ok, we are done. No more unsignaled fences left */
+ trace_printk("chain %llx:%llu DONE\n",
+ chain->base.context, chain->base.seqno);
dma_fence_signal(&chain->base);
+ }
dma_fence_put(&chain->base);
}
@@ -137,6 +140,9 @@ static void dma_fence_chain_cb(struct dma_fence *f, struct dma_fence_cb *cb)
struct dma_fence_chain *chain;
chain = container_of(cb, typeof(*chain), cb);
+ trace_printk("chain %llx:%llu f %llx:%llu\n",
+ chain->base.context, chain->base.seqno,
+ f->context, f->seqno);
init_irq_work(&chain->work, dma_fence_chain_irq_work);
irq_work_queue(&chain->work);
dma_fence_put(f);
@@ -152,6 +158,9 @@ static bool dma_fence_chain_enable_signaling(struct dma_fence *fence)
dma_fence_get(f);
if (!dma_fence_add_callback(f, &head->cb, dma_fence_chain_cb)) {
+ trace_printk("chain %llx:%llu f %llx:%llu\n",
+ head->base.context, head->base.seqno,
+ f->context, f->seqno);
dma_fence_put(fence);
return true;
}
diff --git a/drivers/dma-buf/st-dma-fence-chain.c b/drivers/dma-buf/st-dma-fence-chain.c
index c0979c8049b5..33bfcbe04762 100644
--- a/drivers/dma-buf/st-dma-fence-chain.c
+++ b/drivers/dma-buf/st-dma-fence-chain.c
@@ -44,7 +44,7 @@ static const struct dma_fence_ops mock_ops = {
.release = mock_fence_release,
};
-static struct dma_fence *mock_fence(void)
+static struct dma_fence *mock_fence(u64 context, u64 seqno)
{
struct mock_fence *f;
@@ -79,7 +79,7 @@ static int sanitycheck(void *arg)
struct dma_fence *f, *chain;
int err = 0;
- f = mock_fence();
+ f = mock_fence(0, 0);
if (!f)
return -ENOMEM;
@@ -130,7 +130,7 @@ static int fence_chains_init(struct fence_chains *fc, unsigned int count,
fc->tail = NULL;
for (i = 0; i < count; i++) {
- fc->fences[i] = mock_fence();
+ fc->fences[i] = mock_fence(i, 0);
if (!fc->fences[i]) {
err = -ENOMEM;
goto unwind;
@@ -562,9 +562,14 @@ static int signal_backward(void *arg)
static int __wait_fence_chains(void *arg)
{
struct fence_chains *fc = arg;
+ long ret;
- if (dma_fence_wait(fc->tail, false))
+ ret = dma_fence_wait_timeout(fc->tail, false, HZ * 60);
+ if (ret <= 0) {
+ trace_printk("**** ret=%ld ****\n", ret);
+ ftrace_dump(DUMP_ALL);
return -EIO;
+ }
return 0;
}
@@ -618,8 +623,11 @@ static int wait_backward(void *arg)
get_task_struct(tsk);
yield_to(tsk, true);
- for (i = fc.chain_length; i--; )
+ for (i = fc.chain_length; i--; ) {
+ trace_printk("signal %llx:%llu (%u)\n",
+ fc.fences[i]->context, fc.fences[i]->seqno, fc.fences[i]->waitcount);
dma_fence_signal(fc.fences[i]);
+ }
err = kthread_stop(tsk);
put_task_struct(tsk);
--
2.34.1
More information about the Intel-gfx-trybot
mailing list