[PATCH 16/16] [DEBUG] dump_stack stolen resource freeing during test
Robert Beckett
bob.beckett at collabora.com
Sun Jun 26 16:02:45 UTC 2022
---
drivers/gpu/drm/i915/gt/selftest_reset.c | 12 ++++++++++++
drivers/gpu/drm/i915/intel_memory_region.h | 1 +
2 files changed, 13 insertions(+)
diff --git a/drivers/gpu/drm/i915/gt/selftest_reset.c b/drivers/gpu/drm/i915/gt/selftest_reset.c
index ca130ccf63c7..2185d99532cd 100644
--- a/drivers/gpu/drm/i915/gt/selftest_reset.c
+++ b/drivers/gpu/drm/i915/gt/selftest_reset.c
@@ -58,6 +58,14 @@ static struct page ** alloc_orig(unsigned long num_pages)
return pages;
}
+static void debug_free(struct intel_memory_region *mem, struct ttm_resource *res)
+{
+ pr_info("BOB_DEBUG: %s(): mem->name=%.16s res={ start=0x%lx num_pages=0x%lx mem_type=0x%x placement=0x%x }\n",
+ __func__, mem->name, res->start, res->num_pages, res->mem_type, res->placement);
+ pr_info("BOB_DEBUG: %s(): STACK:\n", __func__);
+ dump_stack();
+}
+
static int
__igt_reset_stolen(struct intel_gt *gt,
intel_engine_mask_t mask,
@@ -141,6 +149,8 @@ __igt_reset_stolen(struct intel_gt *gt,
i915_request_add(rq);
}
+ gt->i915->mm.stolen_region->debug_free = debug_free;
+
for (page = 0; page < num_pages; page++) {
dma_addr_t dma = (dma_addr_t)dsm->start + (page << PAGE_SHIFT);
void __iomem *s;
@@ -257,6 +267,8 @@ __igt_reset_stolen(struct intel_gt *gt,
mb();
ggtt->vm.clear_range(&ggtt->vm, ggtt->error_capture.start, PAGE_SIZE);
+ gt->i915->mm.stolen_region->debug_free = NULL;
+
if (count > 0) {
pr_info("%s reset clobbered %ld pages of stolen, last clobber at page %ld\n",
msg, count, max);
diff --git a/drivers/gpu/drm/i915/intel_memory_region.h b/drivers/gpu/drm/i915/intel_memory_region.h
index 048955b5429f..d278a0eb0f7c 100644
--- a/drivers/gpu/drm/i915/intel_memory_region.h
+++ b/drivers/gpu/drm/i915/intel_memory_region.h
@@ -93,6 +93,7 @@ struct intel_memory_region {
bool is_range_manager;
void *region_private;
+ void (*debug_free)(struct intel_memory_region *mem, struct ttm_resource *res);
};
struct intel_memory_region *
--
2.25.1
More information about the Intel-gfx-trybot
mailing list